https://git.reactos.org/?p=reactos.git;a=commitdiff;h=51dd0523c7255806f2f433beea4f2d8cea6dce3f

commit 51dd0523c7255806f2f433beea4f2d8cea6dce3f
Author:     Hervé Poussineau <hpous...@reactos.org>
AuthorDate: Mon Sep 12 08:13:17 2022 +0200
Commit:     Hervé Poussineau <hpous...@reactos.org>
CommitDate: Mon Sep 12 08:14:03 2022 +0200

    [SHELL32] Fill link path before initializing the dialog
    
    This fixes the Target type, Target location and Target fields
    in shortcut properties window.
    
    CORE-15229
---
 dll/win32/shell32/CShellLink.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/dll/win32/shell32/CShellLink.cpp b/dll/win32/shell32/CShellLink.cpp
index dfb67d102ae..209961454e8 100644
--- a/dll/win32/shell32/CShellLink.cpp
+++ b/dll/win32/shell32/CShellLink.cpp
@@ -2735,8 +2735,13 @@ LPWSTR SH_GetTargetTypeByPath(LPCWSTR lpcwFullPath)
 
 BOOL CShellLink::OnInitDialog(HWND hwndDlg, HWND hwndFocus, LPARAM lParam)
 {
+    WCHAR buffer[MAX_PATH];
+
     TRACE("CShellLink::OnInitDialog(hwnd %p hwndFocus %p lParam %p)\n", 
hwndDlg, hwndFocus, lParam);
 
+    if (m_pPidl && SHGetPathFromIDListW(m_pPidl, buffer))
+        m_sPath = buffer;
+
     TRACE("m_sArgs: %S sComponent: %S m_sDescription: %S m_sIcoPath: %S 
m_sPath: %S m_sPathRel: %S sProduct: %S m_sWorkDir: %S\n", m_sArgs, sComponent, 
m_sDescription,
           m_sIcoPath, m_sPath, m_sPathRel, sProduct, m_sWorkDir);
 

Reply via email to