本文整理汇总了C++中FindWindowEx函数的典型用法代码示例。如果您正苦于以下问题:C++ FindWindowEx函数的具体用法?C++ FindWindowEx怎么用?C++ FindWindowEx使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FindWindowEx函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindTrayWnd
HWND FindTrayWnd()
{
HWND hTrayWnd = FindWindow(L"Shell_TrayWnd", NULL);
hTrayWnd = FindWindowEx(hTrayWnd, 0, L"TrayNotifyWnd", NULL);
HWND hwndTmp;
hwndTmp = ::FindWindowEx(hTrayWnd, 0, L"SysPager", NULL);
if(!hwndTmp)
hTrayWnd=::FindWindowEx(hTrayWnd,0,L"ToolbarWindow32",NULL);
else
hTrayWnd=::FindWindowEx(hwndTmp,0,L"ToolbarWindow32",NULL);
return hTrayWnd;
}
示例2: FindVisibleWindow
HWND FindVisibleWindow(CTSTR lpClass, CTSTR lpTitle)
{
HWND hwndNext = nullptr;
HWND hwnd = nullptr;
do
{
hwnd = FindWindowEx(NULL, hwndNext, lpClass, lpTitle);
if (hwnd && IsWindowVisible(hwnd))
break;
hwndNext = hwnd;
} while (hwnd != nullptr);
return hwnd;
}
示例3: FindWindow
void CPostMsgData::Work()
{
std::vector<HWND> vhWnd;
HWND hWnd = FindWindow(NULL,L"{C3CE0473-57F7-4a0a-9CF4-C1ECB8A3C514}_dsmainmsg_ie");
UINT uCnt = 0;
while (hWnd != NULL)
{
uCnt++;
::PostMessage(hWnd,m_uMsg,m_wParam,m_lParam);
hWnd = FindWindowEx(HWND_MESSAGE, hWnd, NULL,L"{C3CE0473-57F7-4a0a-9CF4-C1ECB8A3C514}_dsmainmsg_ie");
}
if (m_lRef != LUA_REFNIL)
{
g_wndMsg.PostMessage(WM_POSTWNDMSG, uCnt, (LPARAM) this);
}
}
示例4: chromeHwnd
HWND CFrame::aigisHwnd()
{
HWND hChrome = chromeHwnd();
if (!hChrome)
{
return nullptr;
}
HWND hFrame = FindWindowEx(hChrome, 0, _T("Chrome_RenderWidgetHostHWND"), _T("Chrome Legacy Window"));
if (!hFrame)
{
return nullptr;
}
return hFrame;
}
示例5: vboxTrayRemoveTrayIcon
static void vboxTrayRemoveTrayIcon()
{
if (gNotifyIconData.cbSize > 0)
{
/* Remove the system tray icon and refresh system tray. */
Shell_NotifyIcon(NIM_DELETE, &gNotifyIconData);
HWND hTrayWnd = FindWindow("Shell_TrayWnd", NULL); /* We assume we only have one tray atm. */
if (hTrayWnd)
{
HWND hTrayNotifyWnd = FindWindowEx(hTrayWnd, 0, "TrayNotifyWnd", NULL);
if (hTrayNotifyWnd)
SendMessage(hTrayNotifyWnd, WM_PAINT, 0, NULL);
}
RT_ZERO(gNotifyIconData);
}
}
示例6: FindWindow
BOOL vmsOeWindows::Initialize()
{
m_hwndMain = FindWindow ("Outlook Express Browser Class", NULL);
if (m_hwndMain == NULL)
return FALSE;
m_hwndRebar = FindWindowEx (m_hwndMain, NULL, "SizableRebar", NULL);
if (m_hwndRebar)
m_hwndRebar = FindWindowEx (m_hwndRebar, NULL, "ReBarWindow32", NULL);
m_hwndMessageList = FindWindowEx (m_hwndMain, NULL, "Outlook Express Message View", NULL);
if (m_hwndMessageList)
m_hwndMessageList = FindWindowEx (m_hwndMessageList, NULL, "Outlook Express Message List", NULL);
if (m_hwndMessageList)
m_hwndMessageList = FindWindowEx (m_hwndMessageList, NULL, "ATL:SysListView32", NULL);
HWND m_hwndFoldersList = FindWindowEx (m_hwndMain, NULL, "Outlook Express Navigation Pane", NULL);
if (m_hwndFoldersList)
m_hwndFoldersList = FindWindowEx (m_hwndFoldersList, NULL, "Outlook Express Pane Frame", NULL);
if (m_hwndFoldersList)
m_hwndFoldersList = FindWindowEx (m_hwndFoldersList, NULL, "ThorTreeViewWndClass", NULL);
if (m_hwndFoldersList)
m_hwndFoldersList = FindWindowEx (m_hwndFoldersList, NULL, "SysTreeView32", NULL);
return TRUE;
}
示例7: _WndProcMain
/*********************************************************************
*
* _WndProcMain
*/
static LRESULT CALLBACK _WndProcMain(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
HWND hWndStatus;
SIM_GUI_HandleKeyEvents(message, wParam);
switch (message) {
case WM_SIZE:
hWndStatus = FindWindowEx(hWnd, NULL, STATUSCLASSNAME, NULL);
if (hWndStatus) {
_SetParts(hWndStatus);
SendMessage(hWndStatus, message, wParam, lParam);
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
示例8: SendMessage
int __stdcall COpenDirHelper::BrowseCallbackProcDIR(HWND hwnd,UINT uMsg,LPARAM lParam,LPARAM lpData)
{
HWND checkbox;
//Initialization callback message
if(uMsg==BFFM_INITIALIZED) {
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)(LPCTSTR)strLastOpenDir);
RECT ListViewRect;
RECT Dialog;
RECT ClientArea;
RECT ButtonRect;
checkbox = CreateWindowEx(0, _T("BUTTON"), ResStr(IDS_MAINFRM_DIR_CHECK),
WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | BS_AUTOCHECKBOX | BS_MULTILINE, 0, 100, 100,
50, hwnd, 0, AfxGetApp()->m_hInstance, NULL);
HWND ListView=FindWindowEx(hwnd,NULL,_T("SysTreeView32"),NULL);
HWND id_ok = GetDlgItem(hwnd, IDOK);
HWND id_cancel = GetDlgItem(hwnd, IDCANCEL);
GetWindowRect(hwnd,&Dialog);
MoveWindow(hwnd, Dialog.left, Dialog.top, Dialog.right-Dialog.left+50, Dialog.bottom-Dialog.top+70, TRUE);
GetWindowRect(hwnd,&Dialog);
GetClientRect(hwnd,&ClientArea);
GetWindowRect(ListView,&ListViewRect);
MoveWindow(ListView, ListViewRect.left-Dialog.left-3, ListViewRect.top-Dialog.top-55, ListViewRect.right-ListViewRect.left+49, ListViewRect.bottom-ListViewRect.top+115, TRUE);
GetWindowRect(ListView,&ListViewRect);
GetWindowRect(id_ok,&ButtonRect);
MoveWindow(id_ok, ButtonRect.left-Dialog.left+49, ButtonRect.top-Dialog.top+50, ButtonRect.right-ButtonRect.left, ButtonRect.bottom-ButtonRect.top, TRUE);
GetWindowRect(id_cancel,&ButtonRect);
MoveWindow(id_cancel, ButtonRect.left-Dialog.left+49, ButtonRect.top-Dialog.top+50, ButtonRect.right-ButtonRect.left, ButtonRect.bottom-ButtonRect.top, TRUE);
SetWindowPos(checkbox, HWND_BOTTOM, (ListViewRect.left-Dialog.left-3), ClientArea.bottom - 35, 120, 27, SWP_SHOWWINDOW);
SetFont(checkbox,_T("Tahoma"),13);
CBProc = (WNDPROC) SetWindowLongPtr(checkbox, GWLP_WNDPROC, (LONG_PTR) CheckBoxSubclassProc);
SendMessage(checkbox,BM_SETCHECK,(WPARAM)m_incl_subdir,0);
}
return 0;
}
示例9: AlreadyRun
void AlreadyRun(void)
{
HWND FirsthWnd, FirstChildhWnd;
if((FirsthWnd = FindWindowEx(NULL, NULL, szWindowClass, NULL )) != NULL)
{
FirstChildhWnd = GetLastActivePopup(FirsthWnd);
SetForegroundWindow(FirsthWnd);
if(FirsthWnd != FirstChildhWnd)
{
SetForegroundWindow(FirstChildhWnd);
}
ShowWindow(FirsthWnd, SW_SHOWNORMAL);
}
}
示例10: TelnetGetConsoleWindow
// Paul Brannan 8/7/98
// This code is from Michael 'Hacker' Krelin (author of KINSole)
// (slightly modified)
HWND TelnetGetConsoleWindow() {
DWORD pid = GetCurrentProcessId(), wpid;
char title[512], *t = title;
HWND hrv = NULL;
#ifndef __BORLANDC__ // Ioannou Dec. 8, 1998
if(!GetConsoleTitle(title, sizeof(title))) t = NULL;
for(;;) {
if((hrv = FindWindowEx(NULL, hrv, "tty", t)) == NULL) break;
if(!GetWindowThreadProcessId(hrv, &wpid)) continue;
if(wpid == pid) return hrv;
}
#endif
return GetForegroundWindow();
}
示例11: clickChildButton
void clickChildButton (HWND dialog, const char *caption) {
HWND dialogItem = NULL;
while (1) {
dialogItem = FindWindowEx(dialog, dialogItem, NULL, NULL);
if (dialogItem == NULL) {
break;
}
char windowText[255];
GetWindowText(dialogItem, windowText, 255);
printf("found subitem: %s\n", windowText);
if (strcmp(windowText, caption) == 0) {
SetActiveWindow(dialog);
SendMessage(dialogItem, BM_CLICK, NULL, NULL);
break;
}
}
}
示例12: FindTopWindow
static HWND FindTopWindow(HWND hParent, LPCWSTR sClass)
{
HWND hLast = NULL;
HWND hFind = NULL;
int Coord = 99999;
while ((hFind = FindWindowEx(hParent, hFind, sClass, NULL)) != NULL)
{
RECT rc; GetWindowRect(hFind, &rc);
if ((hLast == NULL)
|| (rc.top < Coord))
{
Coord = rc.top;
hLast = hFind;
}
}
return hLast;
}
示例13: GetCurrentProcessId
void vmsIeHelper::GetIeWindows(vector <HWND> &vWnds)
{
HWND hwnd = NULL;
DWORD dwCPID = GetCurrentProcessId ();
do
{
hwnd = FindWindowEx (NULL, hwnd, _T ("IEFrame"), NULL);
if (hwnd)
{
DWORD dwPID = 0;
GetWindowThreadProcessId (hwnd, &dwPID);
if (dwPID == dwCPID)
vWnds.push_back (hwnd);
}
}
while (hwnd != NULL);
}
示例14: FindWindowEx
int vmsIeHelper::GetTabCount(HWND hwndIeWindow)
{
HWND hwnd = NULL;
int cTabs = 0;
do
{
hwnd = FindWindowEx (hwndIeWindow, hwnd, _T ("Frame Tab"), NULL);
if (hwnd)
cTabs++;
}
while (hwnd != NULL);
if (!cTabs)
cTabs = 1;
return cTabs;
}
示例15: OpenFileSubclass
UINT_PTR CALLBACK OpenFileSubclass(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
OpenFileSubclassData *data= (OpenFileSubclassData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch(msg) {
case WM_INITDIALOG:
{
OPENFILENAME *ofn = (OPENFILENAME *)lParam;
data = (OpenFileSubclassData *) malloc(sizeof(OpenFileSubclassData));
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data);
data->locking_request = (BYTE *)ofn->lCustData;
data->setView = TRUE;
TranslateDialogDefault(hwnd);
CheckDlgButton(hwnd, IDC_PROTECTAVATAR, *(data->locking_request));
}
break;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_PROTECTAVATAR)
*(data->locking_request) = IsDlgButtonChecked(hwnd, IDC_PROTECTAVATAR) ? TRUE : FALSE;
break;
case WM_NOTIFY:
if (data->setView) {
HWND hwndParent = GetParent(hwnd);
HWND hwndLv = FindWindowEx(hwndParent, NULL, _T("SHELLDLL_DefView"), NULL) ;
if (hwndLv != NULL) {
SendMessage(hwndLv, WM_COMMAND, SHVIEW_THUMBNAIL, 0);
data->setView = FALSE;
}
}
break;
case WM_NCDESTROY:
free((OpenFileSubclassData *)data);
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)0);
break;
}
return FALSE;
}