entry question, thanks
-
In my dialog function as following, the key_board input wouldn't get response, why? BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { case WM_INITDIALOG: ..... return TRUE; case WM_CHAR: switch(wParam) { case '1': record_data_pair(1); break; case '2': record_data_pair(2); break; case '3': record_data_pair(3); break; default: break; } return TRUE; } default: return FALSE; } Thanks Sean
-
In my dialog function as following, the key_board input wouldn't get response, why? BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { case WM_INITDIALOG: ..... return TRUE; case WM_CHAR: switch(wParam) { case '1': record_data_pair(1); break; case '2': record_data_pair(2); break; case '3': record_data_pair(3); break; default: break; } return TRUE; } default: return FALSE; } Thanks Sean
-
hi maybe you havn't called TranslateMessage in your message loop. you know what's message loop, yes? any way this is a simple message loop: while(GetMessage(...)) { TranslateMessage(...); DispatchMessage(...); } hope it helps:)
NO, I guess you misunderstood the question. The code I posted is a callback function of a DIALOG, which is launched by the main window. i.e, that's not the main window's callback function. I have TranslateMessage in my WinMain() function. Any idea about this situation? Thanks Sean
-
In my dialog function as following, the key_board input wouldn't get response, why? BOOL CALLBACK Parameter_Window_Exper(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch (Message) { case WM_INITDIALOG: ..... return TRUE; case WM_CHAR: switch(wParam) { case '1': record_data_pair(1); break; case '2': record_data_pair(2); break; case '3': record_data_pair(3); break; default: break; } return TRUE; } default: return FALSE; } Thanks Sean
The only other recommendation is to debug the thing and check to see if it's even going into the function at all, when you press a key. Regards, Alvaro
Well done is better than well said. -- Benjamin Franklin (I actually prefer medium-well.)