你是不是没有它的源码 是吧.一般是 HWND FindWindow( LPCTSTR lpClassName, // pointer to class name LPCTSTR lpWindowName // pointer to window name ); HWND FindWindowEx( HWND hwndParent, // handle to parent window HWND hwndChildAfter, // handle to a child window LPCTSTR lpszClass, // pointer to class name LPCTSTR lpszWindow // pointer to window name ); 获得你的目标句柄 然后 SendMessage(TheHandle, WM_GETTEXT, MaxLength, YourBuffer).不过具体的我没做过... 如果有问题 再商讨...
HWND FindWindow(
LPCTSTR lpClassName, // pointer to class name
LPCTSTR lpWindowName // pointer to window name
);
HWND FindWindowEx(
HWND hwndParent, // handle to parent window
HWND hwndChildAfter, // handle to a child window
LPCTSTR lpszClass, // pointer to class name
LPCTSTR lpszWindow // pointer to window name
);
获得你的目标句柄 然后 SendMessage(TheHandle, WM_GETTEXT, MaxLength, YourBuffer).不过具体的我没做过... 如果有问题 再商讨...
问他,他还说,一个查询,一个开单,另一个随便干什么,NND,什么逻辑。
char szBuf[255];
h1 = ::FindWindow(NULL, "ShowAllProcess"); // 获得主窗口句柄
if ( h1 != NULL )
{
::SendMessage(h1, WM_GETTEXT, 255, (LPARAM)szBuf);
GetDlgItem(IDC_EDIT1)->SetWindowText(szBuf);
memset(szBuf, 0, 255);
h2 = ::FindWindowEx(h1, NULL, "Button", "取消");
// 获得该 主窗口下类型为 Button Caption为"取消"的控件的句柄
if (h2 != NULL)
{
::SendMessage(h2, WM_GETTEXT, 255, (LPARAM)szBuf);
GetDlgItem(IDC_EDIT2)->SetWindowText(szBuf);
}
}// 建议 你在查找之前最后用类似 SPY++之类的工具查看 你所查找的控件/窗口的类型 就是
查找到::FindWindowEx(h1, NULL, "Button", "取消"); 里面那个"Button"的类型就是属于Button类型...
请再去看看 MSDN关于这两个函数的说明...还有,由于操作员的习惯性,操作员喜欢同时开着三个或三个以上的程序进行操作,
问他,他还说,一个查询,一个开单,另一个随便干什么,NND,什么逻辑。
// 这也照样可以查找的....你先一个问题一个解决掉
很好用...
像这样的代码能不能给我一点
EMIAL:
[email protected]
handle是可以通过查找获取的不太喜欢写DELPHI代码...VC代码要么...