Does it make a difference if you try WM_KEYDOWN and WM_KEYUP?
/Per W
On Wed, 21 Apr 2004, Tom Cai wrote:
>
> hi there,
>
> i'm trying to write a window program to send keyboard input to notepad,
> but notepad won't be able to accept the input. can anyone point to me as
> what's wrong with the following piece of code?
>
> #include <windows.h>
>
> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
> LPSTR lpCmdLine, int nCmdShow)
> {
> HWND hAppWnd;
>
> if ((hAppWnd =3D FindWindow(NULL, "Untitled - Notepad"))!=3DNULL) {
> MessageBox(NULL, "Send a MSG to NotePad", NULL, MB_OK);
> // SendMessage(hAppWnd, WM_DESTROY, NULL, NULL); // this line work=
s
> fine
> SendMessage(hAppWnd, WM_CHAR, 65, NULL); // send a "A" character
> } else {
> MessageBox(NULL, "Can't get notepad handle", NULL, MB_OK );
> }
> return 0;
> }
>
> TIA!
> please reply to tho...@ya...
>
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25=A2
|