Click here to Skip to main content
15,891,951 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMouse scroll wheel Pin
DanYELL20-Apr-10 9:55
DanYELL20-Apr-10 9:55 
AnswerRe: Mouse scroll wheel Pin
Michel Godfroid20-Apr-10 11:17
Michel Godfroid20-Apr-10 11:17 
AnswerRe: Mouse scroll wheel Pin
@Intersect☺™20-Apr-10 20:51
professional@Intersect☺™20-Apr-10 20:51 
QuestionHow to read a txt file in Windows CE (C++) Pin
Software200720-Apr-10 8:39
Software200720-Apr-10 8:39 
AnswerRe: How to read a txt file in Windows CE (C++) Pin
Eugen Podsypalnikov20-Apr-10 9:04
Eugen Podsypalnikov20-Apr-10 9:04 
GeneralRe: How to read a txt file in Windows CE (C++) Pin
Software200720-Apr-10 9:20
Software200720-Apr-10 9:20 
QuestionRe: How to read a txt file in Windows CE (C++) Pin
David Crow20-Apr-10 9:19
David Crow20-Apr-10 9:19 
QuestionWhy does this dode fail injection? Pin
rain-1320-Apr-10 6:51
rain-1320-Apr-10 6:51 
AnswerRe: Why does this dode fail injection? Pin
«_Superman_»20-Apr-10 7:37
professional«_Superman_»20-Apr-10 7:37 
GeneralRe: Why does this dode fail injection? Pin
rain-1320-Apr-10 8:14
rain-1320-Apr-10 8:14 
GeneralRe: Why does this dode fail injection? Pin
«_Superman_»20-Apr-10 8:15
professional«_Superman_»20-Apr-10 8:15 
AnswerRe: Why does this dode fail injection? Pin
elchupathingy20-Apr-10 8:34
elchupathingy20-Apr-10 8:34 
GeneralRe: Why does this dode fail injection? [modified] Pin
rain-1320-Apr-10 8:55
rain-1320-Apr-10 8:55 
AnswerRe: Why does this dode fail injection? Pin
Stephen Hewitt20-Apr-10 15:01
Stephen Hewitt20-Apr-10 15:01 
AnswerRe: Why does this dode fail injection? Pin
Adam Roderick J20-Apr-10 20:26
Adam Roderick J20-Apr-10 20:26 
GeneralRe: Why does this dode fail injection? Pin
rain-1321-Apr-10 2:31
rain-1321-Apr-10 2:31 
QuestionOperator Usage Pin
ForNow20-Apr-10 6:32
ForNow20-Apr-10 6:32 
AnswerRe: Operator Usage Pin
Maximilien20-Apr-10 6:56
Maximilien20-Apr-10 6:56 
AnswerRe: Operator Usage Pin
«_Superman_»20-Apr-10 7:45
professional«_Superman_»20-Apr-10 7:45 
AnswerRe: Operator Usage [modified] Pin
Gwenio20-Apr-10 9:15
Gwenio20-Apr-10 9:15 
GeneralRe: Operator Usage Pin
CPallini20-Apr-10 11:40
mveCPallini20-Apr-10 11:40 
GeneralRe: Operator Usage Pin
ForNow21-Apr-10 2:52
ForNow21-Apr-10 2:52 
QuestionRe: Operator Usage Pin
CPallini21-Apr-10 10:31
mveCPallini21-Apr-10 10:31 
QuestionSwallow a keyup Pin
Rozis20-Apr-10 6:05
Rozis20-Apr-10 6:05 
QuestionRe: Swallow a keyup Pin
Iain Clarke, Warrior Programmer20-Apr-10 22:20
Iain Clarke, Warrior Programmer20-Apr-10 22:20 
If you're fixated on WM_KEYDOWN, rather than WM_KEYUP, you have another problem to consider. When someone holds down a key, you get multiple down messages, followed by a single up message.

Are you requiring someone to hold down the menu button? If not, what's wrong with using the UP message? If you are requiring they hold down this button, then a) typing will be hard, and b) you could use the up button to dismiss your edit box.

Answering your question more directly, if you can handle the down message, can't you just handle the up message with 99% identical code:

case WM_KEYDOWN:
   if (wParam == VK_MENU)
      DoSomething ();
   else
      DoAnotherThing ();
   break;

case WM_KEYUP:
   if (wParam == VK_MENU)
      ;
   else
      DoYetAnotherThing ();
   break;


You say you're using C, so I assume some win32 code stuff.

Yours trying to help but puzzled why your tying your shoe laces together,

Iain.
I have now moved to Sweden for love (awwww).

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.