[EXPLORER_NEW]

- Do not allow multiple run dialogs. Based on patch by Edijs Kolesnikovičs & Grégori Macário Harbs.
CORE-6871 #resolve

svn path=/trunk/; revision=58208
This commit is contained in:
Thomas Faber 2013-01-23 21:07:37 +00:00
parent 87644827ce
commit 8c4e91a1fc

View file

@ -93,6 +93,7 @@ typedef struct
HBITMAP hbmStartMenu;
HWND hWndTrayProperties;
HWND hwndRunFileDlgOwner;
} ITrayWindowImpl;
BOOL LaunchCPanel(HWND hwnd, LPCTSTR applet)
@ -2000,16 +2001,37 @@ RunFileDlgThread(IN OUT PVOID pParam)
NULL,
NULL);
This->hwndRunFileDlgOwner = hwnd;
hShell32 = GetModuleHandle(TEXT("SHELL32.DLL"));
RunFileDlg = (RUNFILEDLG)GetProcAddress(hShell32, (LPCSTR)61);
RunFileDlg(hwnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
This->hwndRunFileDlgOwner = NULL;
DestroyWindow(hwnd);
return 0;
}
static void
ITrayWindowImpl_ShowRunFileDlg(IN ITrayWindowImpl *This)
{
HWND hRunDlg;
if (This->hwndRunFileDlgOwner)
{
hRunDlg = GetLastActivePopup(This->hwndRunFileDlgOwner);
if (hRunDlg != NULL &&
hRunDlg != This->hwndRunFileDlgOwner)
{
SetForegroundWindow(hRunDlg);
return;
}
}
CloseHandle(CreateThread(NULL, 0, RunFileDlgThread, This, 0, NULL));
}
static LRESULT CALLBACK
TrayWndProc(IN HWND hwnd,
IN UINT uMsg,
@ -2529,13 +2551,7 @@ HandleTrayContextMenu:
case IDM_RUN:
{
CloseHandle(CreateThread(NULL,
0,
RunFileDlgThread,
This,
0,
NULL));
ITrayWindowImpl_ShowRunFileDlg(This);
break;
}
@ -2782,7 +2798,7 @@ TrayMessageLoop(IN OUT ITrayWindow *Tray)
switch (Msg.wParam)
{
case IDHK_RUN: /* Win+R */
CloseHandle(CreateThread(NULL, 0, RunFileDlgThread, This, 0, NULL));
ITrayWindowImpl_ShowRunFileDlg(This);
break;
}
}