Tracking Paste

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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;
}

the code is never entering the If statment, even when I press TAB
I tried adding printf("test\n"); to check, it never shows

why is it not entering the If Statment ?
Have you done a printf/cout on Msg to see what values it actually comes back with the make sure you are checking it correctly?
Topic archived. No new replies allowed.