Jump to content

FMS_GETFILESEL


Deye
 Share

Recommended Posts

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

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

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 :unsure:

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...