How to send characters to another program with another program and make it displayed

xiaoxiao2021-03-06  114

First get the window handle of the Windows program, then get the window handle of the input box, and finally, send the WM_CHAR message to the window handle, for example, for the NOTEPAD window, can enter one in it in the following way A ': // Get Notepad's window handle hwnd hwnd = :: FindWindow (NULL, "Unexpected Title - Notepad");

// Take the window handle of the input box hWnd Hedit = :: getdlgitem (hwnd, 0x0f); // Here 0x0f is the ID of the edit box, you can observe // ​​in SPY to fill in 'a' :: SendMessage (HEDIT, WM_CHAR, (WPARAM) 'A', 0x00000001);

转载请注明原文地址:https://www.9cbs.com/read-99112.html

New Post(0)