ok here is exactly what Im trying to do,
I have to insert 10 strings in 10 different textboxes in the shortest possible time (half a second counts), so I thought the best way is to store them all in a program before the timer starts and then simply press TAB 10 times when the timer starts, and my application would paste them each in a separate text box...
so I want it to paste it on the old focused control then move to the other control ...
After help of some friends, I got this code
the code is never entering the If statment, even when I press TABCode:#include <windows.h> #include <stdio.h> int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil) { HWND hWnd; for(;;) { MSG Msg; while(GetMessage(&Msg, NULL, 0, 0)){ if(Msg.message == WM_KEYUP && Msg.wParam == VK_TAB){ PostMessage(Msg.hwnd, WM_PASTE, 0, 0); printf("K\n"); //Never shows this == not entering the if statment ... why ? // you might need to try GetFocus() instead of Msg.hwnd } if(!IsDialogMessage(hWnd, &Msg)){ TranslateMessage(&Msg); DispatchMessage(&Msg); } } } return 0; }
I tried adding printf("test\n"); to check, it never shows
why is it not entering the If Statment ?




Reply With Quote