首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

如何给没有窗口的程序发送消息

2012-01-07 
怎么给没有窗口的程序发送消息?用SendMessage一定要窗口句柄的?[解决办法]BOOL SendMessageCallback( HWND

怎么给没有窗口的程序发送消息?
用SendMessage一定要窗口句柄的?

[解决办法]
BOOL SendMessageCallback(
HWND hWnd, // handle to window
UINT Msg, // message
WPARAM wParam, // first message parameter
LPARAM lParam, // second message parameter
SENDASYNCPROC lpCallBack, // callback function
ULONG_PTR dwData // application-defined value
);


hWnd 
[in] Handle to the window whose window procedure will receive the message. If this parameter is HWND_BROADCAST, the message is sent to all top-level windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to child windows. 


BOOL PostMessage(
HWND hWnd, // handle to destination window
UINT Msg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
[解决办法]
PostThreadMessage()

热点排行