Send message to window
-
If the target window is active, you can use
SendInput()
."Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Could you show me an example of using SendInput to send a key to an active window plz ? I find it difficult to find a specific example :(
I found this using Google.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
I found this using Google.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
I found this using Google.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
If the target window is active, you can use
SendInput()
."Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Plz help me one more time. I would like to know how to send WM_KEYUP by SendInput. When I send a key, it seems to be pressed forever ...
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
I've read many pages from the pages you gave me but I still can't find the answer :( They recommend to use SendMessage but it doesn't work with SendMessage...
Is the problem with sending or receiving? What does your code look like?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
-
Is the problem with sending or receiving? What does your code look like?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
This is my code :
HWND windowHandle = ::FindWindow(0, _T("Test"));
INPUT *key;
::SetForegroundWindow(windowHandle);
key = new INPUT;
key->type = INPUT_KEYBOARD;
key->ki.wVk = VK_CONTROL;
key->ki.dwFlags = 0;
key->ki.time = 0;
key->ki.wScan = 0;
key->ki.dwExtraInfo = 0;
SendInput(1,key,sizeof(INPUT));
key->ki.dwExtraInfo = KEYEVENTF_KEYUP;
SendInput(1,key,sizeof(INPUT));::SendMessage(windowHandle,WM_KEYUP,0,0); //==> No effect ?
-
This is my code :
HWND windowHandle = ::FindWindow(0, _T("Test"));
INPUT *key;
::SetForegroundWindow(windowHandle);
key = new INPUT;
key->type = INPUT_KEYBOARD;
key->ki.wVk = VK_CONTROL;
key->ki.dwFlags = 0;
key->ki.time = 0;
key->ki.wScan = 0;
key->ki.dwExtraInfo = 0;
SendInput(1,key,sizeof(INPUT));
key->ki.dwExtraInfo = KEYEVENTF_KEYUP;
SendInput(1,key,sizeof(INPUT));::SendMessage(windowHandle,WM_KEYUP,0,0); //==> No effect ?
capint wrote:
::SendMessage(windowHandle,WM_KEYUP,0,0); //==> No effect ?
What does
SendMessage()
return?"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne