| | |
Tracking Clipboard Paste
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2008
Posts: 3
Reputation:
Solved Threads: 0
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 TAB
I tried adding printf("test\n"); to check, it never shows
why is it not entering the If Statment ?
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
C++ Syntax (Toggle Plain Text)
#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 ?
printf() can not be used to display text in a MS-Windows GUI program because there is no console window. Depending on your compiler the simplest way to test it is to compile for debug then set a breakpoint on the printf() line. Another alternative is to create a console window then output text to it (see the console win32 api functions).
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
Join Date: May 2008
Posts: 3
Reputation:
Solved Threads: 0
no, this is the code, and I need help completing it...
how can I make a window? and why do i need it,
I dont want to create any text box ... I want to capture the tab press where ever it is pressed (my case on a website running by firefox) and when the tab is pressed I want to paste the clipboard and move to the next text box...
how can I do this?
how can I make a window? and why do i need it,
I dont want to create any text box ... I want to capture the tab press where ever it is pressed (my case on a website running by firefox) and when the tab is pressed I want to paste the clipboard and move to the next text box...
how can I do this?
Last edited by perito; Jun 20th, 2008 at 10:44 am.
![]() |
Similar Threads
- antispylab on dad's computer :( (Viruses, Spyware and other Nasties)
Other Threads in the C++ Forum
- Previous Thread: C++ Simple graphics
- Next Thread: switch color of CListCtrl text
| Thread Tools | Search this Thread |
api array based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion count data database delete deploy desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph homeworkhelp homeworkhelper iamthwee ifstream input int integer lib linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






