Processor based direction

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • synistics
    Forum Member
    • Feb 2004
    • 67

    Processor based direction

    Total newbie to all of this, so diving into the deep end.

    I need to be able to grab the processor speed from the system so that I can tell viewers that they are below a threshold CPU and may find issues with the video/audio sync.

    result = Registry.GetValueType(HKEY_LOCAL_MACHINE, "HARDWARE\DESCRIPTION\System\CentralProcessor\0\~M Hz ", "Mhz");
    DecimalValue = tonumber(result, 16)
    Dialog.Message("Your processor","CPU"..DecimalValue.."Mhz",MB_OK, MB_ICONINFORMATION);


    if DecimalValue < 4294967294 then

    Dialog.Message("Notice","Your processor blah blah blah, and a lot more blah", MB_OK, MB_ICONINFORMATION);
    end

    I tried the set up from another thread in here and it just always returned me a value of 1



    It is going into the business community, focused at smalled business, which on times will be CPU challenged.

    Help will be greatly appreciated.
  • TJ_Tigger
    Indigo Rose Customer
    • Sep 2002
    • 3159

    #2
    It looks like you use the Registry.GetValueType and not Registry.GetValue action. Type "1" is Reg_sz.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment

    • synistics
      Forum Member
      • Feb 2004
      • 67

      #3
      Tried your variations, but let's go back to your original thread, when I plug in your coding it always gives me a value of one.

      This particula one that I pasted in always returns a constant number whether I stick it in a 2 gig or an old 166, so I know that is not working

      Comment

      • TJ_Tigger
        Indigo Rose Customer
        • Sep 2002
        • 3159

        #4
        Here try this.

        processorspeed_hex = Registry.GetValue(HKEY_LOCAL_MACHINE, "\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor \\0\\", "~MHz", true);
        Dialog.Message("Processor Speed", "The speed of your processor is "..processorspeed_hex, MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
        TJ-Tigger
        "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
        "Draco dormiens nunquam titillandus."
        Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

        Comment

        • synistics
          Forum Member
          • Feb 2004
          • 67

          #5
          Plugged it in no value

          OS is XP

          CPU AMD 2.0


          just comes back blank

          Comment

          • Stefan_M
            Indigo Rose Customer
            • Nov 2003
            • 315

            #6
            result = Registry.GetValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\ 0", "~MHZ", true);


            Stefan
            Attached Files
            "With a rubber duck, one's never alone."

            Douglas Adams, The Hitchhiker's Guide to the Galaxy

            Comment

            • TJ_Tigger
              Indigo Rose Customer
              • Sep 2002
              • 3159

              #7
              Originally posted by synistics
              Plugged it in no value

              OS is XP

              CPU AMD 2.0


              just comes back blank
              I don't know if it helps, but I should have posted my code like this

              Code:
              processorspeed_hex = Registry.GetValue(HKEY_LOCAL_MACHINE, "\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0\\", "~MHz", true); 
              Dialog.Message("Processor Speed", "The speed of your processor is "..processorspeed_hex.." MHz", MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
              or the project like Stefan_M did. This works on my Windows 2K machine, but I am not near an XP machine to test the app.
              Have you checked your registry to ensure that the path is correct and the data exist as typed into the code above?
              Attached Files
              TJ-Tigger
              "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
              "Draco dormiens nunquam titillandus."
              Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

              Comment

              • synistics
                Forum Member
                • Feb 2004
                • 67

                #8
                Well three tries, and by 4am I had this worked out.

                processor = Registry.GetValue(HKEY_LOCAL_MACHINE, "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\ 0\\","~Mhz", true);
                Dialog.Message("Processor Speed","CPU is a ".. processor.." processor" , MB_OK, MB_ICONNONE, MB_DEFBUTTON1);
                DecimalValue = tonumber(processor, 16)
                if (DecimalValue)< 4294947296 then
                Dialog.Message("Notice","Your processor may cause some this presentation ..........'No Sound'", MB_OK, MB_ICONINFORMATION);
                end

                When taken from machine to machine it works to a point.98 machines of coure are not giving me everything, I guess my stumble point was the if then on the processor speed. Using the straigh value from 'processor' it gave me argument of string versus number. So using your decimal value I played until I just came up with a number that would return me a response that would pop the message up.

                There has to be a more dynamic way to drive the message rather than having a fixed value there.

                Comment

                • Intrigued
                  Indigo Rose Customer
                  • Dec 2003
                  • 6138

                  #9
                  Thank you for asking this question!

                  Another piece of Registry/APMS information that will come in handy from time to time.
                  Intrigued

                  Comment

                  Working...
                  X