mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 12:23:14 +00:00
[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:
parent
87644827ce
commit
8c4e91a1fc
1 changed files with 24 additions and 8 deletions
|
@ -93,6 +93,7 @@ typedef struct
|
||||||
HBITMAP hbmStartMenu;
|
HBITMAP hbmStartMenu;
|
||||||
|
|
||||||
HWND hWndTrayProperties;
|
HWND hWndTrayProperties;
|
||||||
|
HWND hwndRunFileDlgOwner;
|
||||||
} ITrayWindowImpl;
|
} ITrayWindowImpl;
|
||||||
|
|
||||||
BOOL LaunchCPanel(HWND hwnd, LPCTSTR applet)
|
BOOL LaunchCPanel(HWND hwnd, LPCTSTR applet)
|
||||||
|
@ -2000,16 +2001,37 @@ RunFileDlgThread(IN OUT PVOID pParam)
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
This->hwndRunFileDlgOwner = hwnd;
|
||||||
|
|
||||||
hShell32 = GetModuleHandle(TEXT("SHELL32.DLL"));
|
hShell32 = GetModuleHandle(TEXT("SHELL32.DLL"));
|
||||||
RunFileDlg = (RUNFILEDLG)GetProcAddress(hShell32, (LPCSTR)61);
|
RunFileDlg = (RUNFILEDLG)GetProcAddress(hShell32, (LPCSTR)61);
|
||||||
|
|
||||||
RunFileDlg(hwnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
|
RunFileDlg(hwnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
|
||||||
|
|
||||||
|
This->hwndRunFileDlgOwner = NULL;
|
||||||
DestroyWindow(hwnd);
|
DestroyWindow(hwnd);
|
||||||
|
|
||||||
return 0;
|
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
|
static LRESULT CALLBACK
|
||||||
TrayWndProc(IN HWND hwnd,
|
TrayWndProc(IN HWND hwnd,
|
||||||
IN UINT uMsg,
|
IN UINT uMsg,
|
||||||
|
@ -2529,13 +2551,7 @@ HandleTrayContextMenu:
|
||||||
|
|
||||||
case IDM_RUN:
|
case IDM_RUN:
|
||||||
{
|
{
|
||||||
CloseHandle(CreateThread(NULL,
|
ITrayWindowImpl_ShowRunFileDlg(This);
|
||||||
0,
|
|
||||||
RunFileDlgThread,
|
|
||||||
This,
|
|
||||||
0,
|
|
||||||
NULL));
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2782,7 +2798,7 @@ TrayMessageLoop(IN OUT ITrayWindow *Tray)
|
||||||
switch (Msg.wParam)
|
switch (Msg.wParam)
|
||||||
{
|
{
|
||||||
case IDHK_RUN: /* Win+R */
|
case IDHK_RUN: /* Win+R */
|
||||||
CloseHandle(CreateThread(NULL, 0, RunFileDlgThread, This, 0, NULL));
|
ITrayWindowImpl_ShowRunFileDlg(This);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue