如何找QQ2010对话框的句柄
怎么找QQ2010对话框的句柄
就是输入框的句柄,想获取输入类容
------解决方案--------------------
HWND hwnd=FindWindow("QQ","对话模式");//这一句就可以了
在给点可以使用的QQ消息攻击器的寻找窗口的代码,你也可以通过QQ.exe的路径取得hwnd
void CMessagesDlg::OnTimer(UINT nIDEvent)
{
if(nIDEvent==1)
{
HWND hwndParent = ::FindWindow( NULL, "对话模式" );//查找对话框句柄
if(hwndParent==NULL)
return;
HWND hwndPasswd = ::FindWindowEx( hwndParent, NULL, "Edit", NULL );//查找EDIT句柄
if(hwndParent==NULL)
return;
if(::GetForegroundWindow()!=hwndParent)
::SetForegroundWindow( hwndParent );
::SetFocus( hwndPasswd );
CString Message;
Message=m_sArray.GetAt(count%m_sArray.GetSize());
::SendMessage(hwndPasswd, WM_SETTEXT, Message.GetLength(), (LPARAM)Message.GetBuffer(Message.GetLength()));
keybd_event(VK_MENU,0,0,0); //按下alt
keybd_event(83,0,0,0); //按下s
keybd_event(83,0,2,0); //释放s
keybd_event(VK_MENU,0,2,0); //释放alt
count++;
memset(count1,0,10);
itoa(count,count1,10);
GetDlgItem(IDC_COUNT)->SetWindowText(count1);
}
if(nIDEvent==2)
{
HWND hwndParent = ::FindWindow( NULL, "对话模式" );//查找对话框句柄
if(hwndParent==NULL)
return;
HWND hwndPasswd = ::FindWindowEx( hwndParent, NULL, "Edit", NULL );//查找EDIT句柄
if(hwndParent==NULL)
return;
if(::GetForegroundWindow()!=hwndParent)
::SetForegroundWindow( hwndParent );
::SetFocus( hwndPasswd );
CString Message;
GetDlgItem(IDC_MESSAGES)->GetWindowText(Message);
::SendMessage(hwndPasswd, WM_SETTEXT, Message.GetLength(), (LPARAM)Message.GetBuffer(Message.GetLength()));
keybd_event(VK_MENU,0,0,0); //按下alt
keybd_event(83,0,0,0); //按下s
keybd_event(83,0,2,0); //释放s
keybd_event(VK_MENU,0,2,0); //释放alt
count++;
memset(count1,0,10);
itoa(count,count1,10);
GetDlgItem(IDC_COUNT)->SetWindowText(count1);
}
CDialog::OnTimer(nIDEvent);
}
就是输入框的句柄,想获取输入类容
------解决方案--------------------
HWND hwnd=FindWindow("QQ","对话模式");//这一句就可以了
在给点可以使用的QQ消息攻击器的寻找窗口的代码,你也可以通过QQ.exe的路径取得hwnd
void CMessagesDlg::OnTimer(UINT nIDEvent)
{
if(nIDEvent==1)
{
HWND hwndParent = ::FindWindow( NULL, "对话模式" );//查找对话框句柄
if(hwndParent==NULL)
return;
HWND hwndPasswd = ::FindWindowEx( hwndParent, NULL, "Edit", NULL );//查找EDIT句柄
if(hwndParent==NULL)
return;
if(::GetForegroundWindow()!=hwndParent)
::SetForegroundWindow( hwndParent );
::SetFocus( hwndPasswd );
CString Message;
Message=m_sArray.GetAt(count%m_sArray.GetSize());
::SendMessage(hwndPasswd, WM_SETTEXT, Message.GetLength(), (LPARAM)Message.GetBuffer(Message.GetLength()));
keybd_event(VK_MENU,0,0,0); //按下alt
keybd_event(83,0,0,0); //按下s
keybd_event(83,0,2,0); //释放s
keybd_event(VK_MENU,0,2,0); //释放alt
count++;
memset(count1,0,10);
itoa(count,count1,10);
GetDlgItem(IDC_COUNT)->SetWindowText(count1);
}
if(nIDEvent==2)
{
HWND hwndParent = ::FindWindow( NULL, "对话模式" );//查找对话框句柄
if(hwndParent==NULL)
return;
HWND hwndPasswd = ::FindWindowEx( hwndParent, NULL, "Edit", NULL );//查找EDIT句柄
if(hwndParent==NULL)
return;
if(::GetForegroundWindow()!=hwndParent)
::SetForegroundWindow( hwndParent );
::SetFocus( hwndPasswd );
CString Message;
GetDlgItem(IDC_MESSAGES)->GetWindowText(Message);
::SendMessage(hwndPasswd, WM_SETTEXT, Message.GetLength(), (LPARAM)Message.GetBuffer(Message.GetLength()));
keybd_event(VK_MENU,0,0,0); //按下alt
keybd_event(83,0,0,0); //按下s
keybd_event(83,0,2,0); //释放s
keybd_event(VK_MENU,0,2,0); //释放alt
count++;
memset(count1,0,10);
itoa(count,count1,10);
GetDlgItem(IDC_COUNT)->SetWindowText(count1);
}
CDialog::OnTimer(nIDEvent);
}