Sign in to follow this  
Followers 0
yehia

Popup menu IDs

9 posts in this topic

hi after some searches i found this script for arranging the icons on the desktop

Const $WM_COMMAND = 0x0111

_SortIconsOnTheDesktop()

Func _SortIconsOnTheDesktop($sort_by = 1) ; 1 = Name, 2 = Size, 3 = Type, 4 = Modified (works for WinXP only)
    Local $hDesk, $sorting
    If @OSVersion = "WIN_XP" Then
        Local $iByName = 30210
        Local $iBySize = 30211
        Local $iByType = 30212
        Local $iByModified = 30213
    ElseIf @OSVersion = "WIN_VISTA" Then
        MsgBox(0, "Not supported", "This system is not yet supported by this program.")
        Return SetError(1, 0, -1)
    Else
        MsgBox(0, "Not supported", "This system is not supported by this program.")
        Return SetError(1, 0, -1)
    EndIf
   
    Select
        Case $sort_by = 1
            $sorting = $iByName
        Case $sort_by = 2
            $sorting = $iBySize
        Case $sort_by = 3
            $sorting = $iByType
        Case $sort_by = 4
            $sorting = $iByModified
        Case Else
            MsgBox(0, "Wrong Value", "Wrong option.")
            Return SetError(1, 0, -2)
    EndSelect

    $hDesk = WinGetHandle('[CLASS:Progman]')
    DllCall('user32.dll', 'int', 'SendMessage', 'hwnd', $hDesk, 'uint', $WM_COMMAND, 'wparam', $sorting, 'lparam', 0)
EndFunc   ;==>_SortIconsOnTheDesktop

but im looking for "show in groups" and "View" too so is there anyway to get this popup menu IDs as in the above script? or do anyone already have em?

;;"Arrange Icons By" popup menu IDs for WinXP:

$iByName = 30210

$iBySize = 30211

$iByType = 30212

$iByModified = 30213

thanks guys

Share this post


Link to post
Share on other sites



Auto arrange = 0x7051

Align to grid = 0x7054

Shot desktop icons = 0x7402

To check for other possibilities (actually it's not an ID rather a message value, wparam in this case) you can use Spy++ that comes with Microsoft's full Visual Studio, and capture WM_COMMAND messages that are posted to the desired window.

If you don't have Spy++ there are a few other tools that can do almost the same.

Share this post


Link to post
Share on other sites

Which tool are you using?

If Microsoft's Spy++ you can just start a new capture message session an use the Finder tool to specify the specific window you're wishing to capture it's messages and check the second tab window in the same dialog for the messages to capture.

Share this post


Link to post
Share on other sites

btw that didnt do the trick i tried those :

Auto arrange = 0x7051

Align to grid = 0x7054

Shot desktop icons = 0x7402

they all worked but i still cant get them my self

my spy ++ does shows alot of WM_commands but ...

can u tell me whats the WM_COMMAND for it?

thanks

Share this post


Link to post
Share on other sites

It's 0x0111 but it wouldn't matter because it supposed to be in the list on the second tab.... maybe your spy is old or doesn't support this option. Try WinSpector in case Spy++ doesn't give you this option.

Share this post


Link to post
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
Sign in to follow this  
Followers 0