Deye Posted December 17, 2017 Share Posted December 17, 2017 FMS_GETFILESEL Trying to figure how this can be used if at-all possible to do it this way .. ? in not alternative ways .. like https://www.autoitscript.com/forum/topic/89833-windows-explorer-current-folder/ Considering its to return an object then what can be used to get the long szName With FM_GETFILESELLFN Not quite sure about dll calling too, so this is all i have so far Local $hWnd = WinGetHandle("[REGEXPCLASS:^(Cabinet|Explore)WClass$]") If Not $hWnd Then Exit $hControl = ControlGetHandle($hWnd, "", "DirectUIHWND3") If Not $hControl Then Exit ;~ ControlFocus($hWnd, "", $hControl) ;~ ControlSend($hWnd, "", $hControl, "{down}") Local $aCall = DllCall('user32.dll', 'int', 'RegisterWindowMessage', 'WSTR', "FMS_GETFILESEL") Local Const $FMS_GETFILESEL = $aCall[0] $aCall = DllCall("user32.dll", "lresult", "SendMessageW", _ "hwnd", $hControl, _ "dword", $FMS_GETFILESEL, _ "wparam", 0, _ "lparam", 0) ; Wanting to get the szName of only 1 selected file Local $lResult = $aCall[0] Link to comment Share on other sites More sharing options...
Deye Posted December 20, 2017 Author Share Posted December 20, 2017 BTTCr4@ .. so what are $aResult [1] & [2] telling anyways Global Const $WM_USER = 0x400 ; Global Const $FM_GETSELCOUNT = BitOR($WM_USER, 0x202) Global Const $FM_GETSELCOUNTLFN = BitOR($WM_USER, 0x203) Global Const $FM_GETFILESEL = BitOR($WM_USER, 0x204) Global Const $FM_GETFILESELLFN = BitOR($WM_USER, 0x205) Local $hWnd = WinGetHandle("[REGEXPCLASS:^(Cabinet|Explore)WClass$]") If Not $hWnd Then Exit $hControl = ControlGetHandle($hWnd, "", "DirectUIHWND3") If Not $hControl Then Exit $aResult = DllCall("user32.dll", "lresult", "SendMessageW", "hwnd", $hControl, "uint", $FM_GETFILESEL, "wparam", 0, "lparam", 0) Link to comment Share on other sites More sharing options...
benners Posted December 20, 2017 Share Posted December 20, 2017 33 minutes ago, Deye said: BTTCr4@ .. so what are $aResult [1] & [2] telling anyways From $aResult[1] onwards they are just the values passed as parameters, $hControl and $FM_GETFILESEL. They should be the same values that you passed, unless they were modified by the SendMessageW function. And that's my DLL knowledge exhausted Deye 1 Link to comment Share on other sites More sharing options...
Deye Posted December 20, 2017 Author Share Posted December 20, 2017 think I did noticed that as swell while trying out stuff but as nothing worked I forgot about that Still it will be good to know how to start this up if workable at all and how .. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now