002
22.05.2006, 04:38 Uhr
CppProgrammer
|
Damit sollte das ganze eigentlich auch gehn:
C++: |
bool GetWindowText(HWND hWnd, char* &Text) { if(hWnd) { int length = (int)::SendMessage(hWnd, WM_GETTEXTLENGTH, 0, 0); length++; Text = new char[length]; ::SendMessage(hWnd, WM_GETTEXT, (WPARAM)(length), (LPARAM)Text); return true; } else return false; }
bool SetWindowText(HWND hWnd, LPCTSTR Text) { if(hWnd) { ::SendMessage(hWnd, WM_SETTEXT, 0, (LPARAM)(LPCTSTR)Text); return true; } else return false; }
bool PostKeyToWindow(HWND hWnd, int KEY) { if(hWnd) { ::PostMessage(hWnd, WM_KEYDOWN, KEY, 0); return true; } else return false; }
|
|