sendmessge listbox

if(WinExec("D:\\RLS_2_2_52_0\\LoggingTool.exe",SW_SHOW)<31)
{
// ShowMessage("LOG TOOL OPEN SUCCESS");
}
HWND MainWin;
Sleep(1000);
MainWin=FindWindow(0,"LoggingTool [Build: Dec 23 2013 17:53:54]");

/* if(MainWin !=NULL)
{
ShowMessage("logging tool find");
ShowMessage(IntToStr(MainWin));
}
*/
HWND m_hListBox=FindWindowExA(MainWin,NULL,"ListBox",NULL);

m_hListBox=FindWindowExA(MainWin,m_hListBox,"ListBox",NULL);
/* if(m_hListBox !=NULL)
{
ShowMessage("m_hListBox find");
ShowMessage(IntToStr(m_hListBox));
} */
// int count= ::SendMessage(m_hListBox,LB_GETCURSEL,0,0);
// ShowMessage(count);
::SendMessage(m_hListBox,LB_SETCURSEL,1,0);
::SendMessage(m_hListBox,BM_CLICK,1,0);

::SendMessage(m_hListBox,LB_SETSEL,true,1);
::SendMessage(MainWin ,LBN_SELCHANGE,1,0);
UpdateWindow;

::SendMessage(m_hListBox,WM_COMMAND,0x90000,(LPARAM)m_hListBox);
::SendMessage(m_hListBox,WM_COMMAND,0x10000,(LPARAM)m_hListBox);
::SendMessage(MainWin,WM_COMMAND,0x90000,(LPARAM)m_hListBox);
::SendMessage(MainWin,WM_COMMAND,0x10000,(LPARAM)m_hListBox);
Sleep(1000);
HWND GetConnection=FindWindowExA(MainWin,NULL,"Button","GetConnection");
::SendMessage( GetConnection,BM_CLICK, 0, 0);
//Sleep(10000);

// HWND LumEDIT=FindWindowExA(MainWin,NULL,"Edit",NULL);
/* if(LumEDIT !=NULL)
{
ShowMessage("LumEDIT find");
ShowMessage(IntToStr(LumEDIT));
} */
//AnsiString ee="200";
// ::SendMessage( LumEDIT,WM_SETTEXT,20,(LPARAM)ee.c_str());



// HWND SetBtn=FindWindowExA(MainWin,NULL,"Button","Set");
/* if(SetBtn !=NULL)
{
ShowMessage("SetBtn find");
ShowMessage(IntToStr(SetBtn));
} */

posted @ 2021-12-31 12:23  一梦五千年  阅读(111)  评论(0)    收藏  举报