vc++ SendMessage和WM_SETTEXT问题.
voidCFsaDlg::OnButton1(){HWNDhwnd,Ahwnd;hwnd=::FindWindow(NULL,"Form1");Ahwnd=::FindW...
void CFsaDlg::OnButton1()
{
HWND hwnd,Ahwnd;
hwnd=::FindWindow(NULL,"Form1");
Ahwnd=::FindWindowEx(hwnd,0,"ThunderRT6TextBox","");
CString s;
s="呵呵";
::SendMessage(Ahwnd,WM_SETTEXT,s,0);
}
hwnd,Ahwnd都能成功获得句柄.
D:\Microsoft Visual Studio 6\MyProjects\fsa\fsaDlg.cpp(184) : error C2664: 'SendMessageA' : cannot convert parameter 3 from 'class CString' to 'unsigned int'
void CFsaDlg::OnButton1()
{
HWND hwnd,Ahwnd;
hwnd=::FindWindow(NULL,"Form1");
Ahwnd=::FindWindowEx(hwnd,0,"ThunderRT6TextBox","");
::SendMessage(Ahwnd,WM_SETTEXT,0,LPARAM("呵呵"));
} 展开
{
HWND hwnd,Ahwnd;
hwnd=::FindWindow(NULL,"Form1");
Ahwnd=::FindWindowEx(hwnd,0,"ThunderRT6TextBox","");
CString s;
s="呵呵";
::SendMessage(Ahwnd,WM_SETTEXT,s,0);
}
hwnd,Ahwnd都能成功获得句柄.
D:\Microsoft Visual Studio 6\MyProjects\fsa\fsaDlg.cpp(184) : error C2664: 'SendMessageA' : cannot convert parameter 3 from 'class CString' to 'unsigned int'
void CFsaDlg::OnButton1()
{
HWND hwnd,Ahwnd;
hwnd=::FindWindow(NULL,"Form1");
Ahwnd=::FindWindowEx(hwnd,0,"ThunderRT6TextBox","");
::SendMessage(Ahwnd,WM_SETTEXT,0,LPARAM("呵呵"));
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询