From: Katayama Hirofumi MZ Date: Thu, 21 Jun 2018 16:18:57 +0000 (+0900) Subject: [EXPLORER] 'Run' (Win+R) should set the proper current directory (#593) X-Git-Tag: 0.4.11-dev~393 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=c84f39830697b4f1c55ccdea1e79b6dfc7b5835b [EXPLORER] 'Run' (Win+R) should set the proper current directory (#593) --- diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp index 4095bc10469..2484b23f77c 100644 --- a/base/shell/explorer/traywnd.cpp +++ b/base/shell/explorer/traywnd.cpp @@ -2,6 +2,7 @@ * ReactOS Explorer * * Copyright 2006 - 2007 Thomas Weidenmueller + * Copyright 2018 Katayama Hirofumi MZ * * this library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -365,7 +366,13 @@ public: m_RunFileDlgOwner = hwnd; - RunFileDlg(hwnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY); + // build the default directory from two environment variables + CStringW strDefaultDir, strHomePath; + strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE"); + strHomePath.GetEnvironmentVariable(L"HOMEPATH"); + strDefaultDir += strHomePath; + + RunFileDlg(hwnd, NULL, (LPCWSTR)strDefaultDir, NULL, NULL, RFF_CALCDIRECTORY); m_RunFileDlgOwner = NULL; ::DestroyWindow(hwnd);