Index: base/shell/explorer-new/precomp.h =================================================================== --- base/shell/explorer-new/precomp.h (revision 58137) +++ base/shell/explorer-new/precomp.h (working copy) @@ -168,6 +168,8 @@ * traywnd.c */ +HWND hRunDlg; + typedef HMENU (*PCREATECTXMENU)(IN HWND hWndOwner, IN PVOID *ppcmContext, IN PVOID Context OPTIONAL); Index: base/shell/explorer-new/traywnd.c =================================================================== --- base/shell/explorer-new/traywnd.c (revision 58137) +++ base/shell/explorer-new/traywnd.c (working copy) @@ -2000,11 +2000,14 @@ NULL, NULL); + hRunDlg = hwnd; + hShell32 = GetModuleHandle(TEXT("SHELL32.DLL")); RunFileDlg = (RUNFILEDLG)GetProcAddress(hShell32, (LPCSTR)61); RunFileDlg(hwnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY); + hRunDlg = NULL; DestroyWindow(hwnd); return 0; @@ -2529,13 +2532,14 @@ case IDM_RUN: { - CloseHandle(CreateThread(NULL, - 0, - RunFileDlgThread, - This, - 0, - NULL)); - + if ((hRunDlg) && (GetNextWindow(hRunDlg, GW_HWNDPREV) != hRunDlg)) + { + SetForegroundWindow(GetNextWindow(hRunDlg, GW_HWNDPREV)); + } + else + { + CloseHandle(CreateThread(NULL, 0, RunFileDlgThread, This, 0, NULL)); + } break; } @@ -2782,8 +2786,17 @@ switch (Msg.wParam) { case IDHK_RUN: /* Win+R */ - CloseHandle(CreateThread(NULL, 0, RunFileDlgThread, This, 0, NULL)); + { + if ((hRunDlg) && (GetNextWindow(hRunDlg, GW_HWNDPREV) != hRunDlg)) + { + SetForegroundWindow(GetNextWindow(hRunDlg, GW_HWNDPREV)); + } + else + { + CloseHandle(CreateThread(NULL, 0, RunFileDlgThread, This, 0, NULL)); + } break; + } } }