Why not?
-
I get this error when i compile, cannot convert from 'CWnd *' to 'HWND' here is the code: HWND hwndNotepad; // A handle to the Notepad window hwndNotepad = FindWindow("Notepad", NULL); How can I get this to work?
try HWND hwndNotepad; // A handle to the Notepad window hwndNotepad = ::FindWindow("Notepad", NULL);
-
try HWND hwndNotepad; // A handle to the Notepad window hwndNotepad = ::FindWindow("Notepad", NULL);
Thanks that helpt me. But when I try to send to that windows I cant use this way? hwndEdit = ::FindWindowEx(hwndNotepad, NULL, "Edit", NULL); SendMessage(hwndEdit, WM_CHAR, lpszText[i]); This is the error I get, cannot convert parameter 1 from 'HWND' to 'UINT'
-
Thanks that helpt me. But when I try to send to that windows I cant use this way? hwndEdit = ::FindWindowEx(hwndNotepad, NULL, "Edit", NULL); SendMessage(hwndEdit, WM_CHAR, lpszText[i]); This is the error I get, cannot convert parameter 1 from 'HWND' to 'UINT'
Same thing. You are using Windows APIs in MFC class member functions so the compiler sees the MFC version. Use ::SendMessage(...) Edit - reword that :) Same thing. You are using Windows APIs in CWnd-derived class member functions so the compiler sees the CWnd version. Use ::SendMessage(...)
-
Same thing. You are using Windows APIs in MFC class member functions so the compiler sees the MFC version. Use ::SendMessage(...) Edit - reword that :) Same thing. You are using Windows APIs in CWnd-derived class member functions so the compiler sees the CWnd version. Use ::SendMessage(...)
-
Thanks that helpt me. But when I try to send to that windows I cant use this way? hwndEdit = ::FindWindowEx(hwndNotepad, NULL, "Edit", NULL); SendMessage(hwndEdit, WM_CHAR, lpszText[i]); This is the error I get, cannot convert parameter 1 from 'HWND' to 'UINT'
Try this:
HWND hwndEdit = ::FindWindowEx(hwndNotepad, NULL, "Edit", NULL); ::SendMessage(hwndEdit, WM_CHAR, lpszText[i], 0);
_outp(0x64, 0xAD);
and__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do?? ;) (doesn't work on NT) -
I get this error when i compile, cannot convert from 'CWnd *' to 'HWND' here is the code: HWND hwndNotepad; // A handle to the Notepad window hwndNotepad = FindWindow("Notepad", NULL); How can I get this to work?
char *MY="Hello"; HWND hWnd = ::FindWindow("Notepad", NULL); CWnd *hWndEdit=FindWindowEx(hWnd,NULL,"Edit",NULL); ::SendMessage(hWndEdit->m_hWnd,WM_SETTEXT,0,(long)MY);
WhiteSky