SendMessage用法问题
- C/C++ code
#include "stdafx.h"#include "windows.h"#pragma comment(lib,"user32.lib")int _tmain(int argc, _TCHAR* argv[]){ HWND hWnd = FindWindow(NULL, _T("xxyy.txt - 记事本")); if (hWnd != NULL) { printf("%s\n", "11111111111"); SendMessage(hWnd, WM_KEYDOWN, VK_TAB, 0); // 消息1 } printf("%s\n", "2222222222222222"); return 0;}
不知道为什么 消息1发了没有用
[解决办法]
PostMessage