Jump to content

Popup menu IDs


yehia
 Share

Recommended Posts

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

Link to comment
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.

Link to comment
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

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...