• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

What does this statement mean

What does these statements mean?

case 0x50:  // How is this value generated?
      Pause(hwnd);
break;
0
khawaib
Asked:
khawaib
  • 6
  • 4
1 Solution
 
AxterCommented:
Hi khawaib,
> case 0x50:  // How is this value generated?
It's a hex value that translates into decimal number 80.
case 80: //Same as 0x50

David Maisonave (Axter)
Cheers!
0
 
khawaibAuthor Commented:
How is this value generated?
0
 
AxterCommented:
>>How is this value generated?
At compile time, the compiler converts it to a decimal number.
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 
khawaibAuthor Commented:
case WM_KEYDOWN:
            switch ((int)wParam){
                  case VK_UP:    // Code Here
                  break;
                  case VK_DOWN:    // Code Here
                  break;
                  case VK_LEFT:     // Code Here
                  break;                  
                  case VK_RIGHT:     // Code Here
                  break;
                  case 0x50:
                  Pause(hwnd);
                  break;
            }
            break;
      default:
      ..................
0
 
khawaibAuthor Commented:
this might clearify it bit more
0
 
AxterCommented:
>>this might clearify it bit more

What exactly are you trying to clearify?

0
 
khawaibAuthor Commented:
That this value is generated in keyboard events, I understand Key Up, down etc are generated when these keys are pressed, but what generates 0x50?
0
 
AxterCommented:
>> but what generates 0x50?

Where did you get this number from?
0
 
khawaibAuthor Commented:
Thats what I cannot see anywhere - I thougth may be some one else have accross something like this.
May be some one know some key which can generate this value?
0
 
AlexFMCommented:
From winuser.h:

* VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)

So, you need to find 0x50 in ASCII table, this is 'P'. Program author could save your time, writing:

case (int)'P':
0
 
khawaibAuthor Commented:
It is P key. thnx AlexFM
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now