如何用SendMessage通过消息向另一个窗口发送文本
展开全部
最简单的就是对一个文本框类的窗口发
lResult = SendMessage( // returns LRESULT in lResult
(HWND) hWndControl, // handle to destination control
(UINT) WM_SETTEXT, // message ID
(WPARAM) wParam, // = (WPARAM) () wParam;
(LPARAM) lParam // = (LPARAM) () lParam;);
复杂一点儿可以使用, WM_COPYDATA
hwDispatch = FindWindow( "Disp32Class", "Hidden Window" );
if( hwDispatch != NULL )
SendMessage( hwDispatch,
WM_COPYDATA,
(WPARAM)(HWND) hWnd,
(LPARAM) (LPVOID) &MyCDS );
else
MessageBox( hWnd, "Can't send WM_COPYDATA", "MyApp", MB_OK );
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询