Some time ago i was having problems with the TAB Key not working on my app and people recommended me to add this 'if(IsDialogMessage(mainWindow,&messages)) {}' to it and the TAB key started working but i could not understand why. Shouldn i add something to its block in order to Translate and Dispatch the dialog messages to my DEFDLGPROC function? I really cant figure out how an empty block of code is actually doing it (because all my dialogs and dialog controls work)!
Im worrying about it now not only by simple curiosity, but because im having lots of problems with setting control collors dinamically and im willing to change that in order to use the 'PeekMessage' command...
Thanks you for any help :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
well... to answer your first question IsDialogMessage does its on translate and dispatch stuff... in fact you are specifically told/ask not to pass the message to translate or dispatch by the windows api documentation... thats why it you dont need to do anything in the block... i cant even begin to guess why you might not be able to set colors dinamically... I do have a sugestion to make your message pump cleaner... do this...
when IsDialogMessage is called IF IT IS PROCESSED it returns non zero... so... it returns 0 if it is not processed... so do this...
that cleans that up... if you want help with coloring on the fly you will have to post some code or a link to some code THAT WILL compile... in otherwords a complete working example of what you are doing... whether it actual colors on the fly or not is irrelevant we would need to see what you are doing and therefore what you are doing wrong if anyone knows...
Zero Valintine
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thats how my message loop looks like.
while (GetMessage (&messages, NULL, 0, 0)) {
if(IsDialogMessage(mainWindow,&messages)) {
}
else {
TranslateMessage(&messages);
DispatchMessage(&messages);
}
}
return messages.wParam;
Some time ago i was having problems with the TAB Key not working on my app and people recommended me to add this 'if(IsDialogMessage(mainWindow,&messages)) {}' to it and the TAB key started working but i could not understand why. Shouldn i add something to its block in order to Translate and Dispatch the dialog messages to my DEFDLGPROC function? I really cant figure out how an empty block of code is actually doing it (because all my dialogs and dialog controls work)!
Im worrying about it now not only by simple curiosity, but because im having lots of problems with setting control collors dinamically and im willing to change that in order to use the 'PeekMessage' command...
Thanks you for any help :)
well... to answer your first question IsDialogMessage does its on translate and dispatch stuff... in fact you are specifically told/ask not to pass the message to translate or dispatch by the windows api documentation... thats why it you dont need to do anything in the block... i cant even begin to guess why you might not be able to set colors dinamically... I do have a sugestion to make your message pump cleaner... do this...
when IsDialogMessage is called IF IT IS PROCESSED it returns non zero... so... it returns 0 if it is not processed... so do this...
while (GetMessage (&messages, NULL, 0, 0)){
if(!IsDialogMessage(mainWindow,&messages)){
TranslateMessage(&messages);
DispatchMessage(&messages);}}
return messages.wParam;
that cleans that up... if you want help with coloring on the fly you will have to post some code or a link to some code THAT WILL compile... in otherwords a complete working example of what you are doing... whether it actual colors on the fly or not is irrelevant we would need to see what you are doing and therefore what you are doing wrong if anyone knows...
Zero Valintine