HWND ThunderRT6FormDC = NULL;
DWORD dwProcessId = 0;
ThunderRT6FormDC = FindWindowEx(NULL, ThunderRT6FormDC, _T("ThunderRT6FormDC"), NULL);
{
HWND ThunderRT6TextBox = NULL;
DWORD dwThunderRT6TextBox = 0;
while (ThunderRT6TextBox = FindWindowEx(ThunderRT6FormDC, ThunderRT6TextBox, _T("ThunderRT6TextBox"), NULL))
{
++dwThunderRT6TextBox;
if (dwThunderRT6TextBox == 2)
{
DWORD dwLength = ::SendMessage(ThunderRT6TextBox, WM_GETTEXTLENGTH, 0, 0);
CWin32Heap win32Heap(0, 0);
LPVOID szThunderRT6TextBox = win32Heap.Allocate(dwLength);
::SendMessage(ThunderRT6TextBox, WM_GETTEXT, dwLength, (LPARAM) szThunderRT6TextBox);
CComBSTR bstr = (BSTR) szThunderRT6TextBox;
SetDlgItemText(IDC_EDIT_REGIST_CODE, CString(bstr));
}
}
}
获取VB文本框内容
最新推荐文章于 2023-01-26 22:18:39 发布