Sign in to follow this  
Followers 0
ChrisN

Flyout menus (like XP start menu)

5 posts in this topic

Is there a way to create menus like XP's "All Programs" menu? Or, better yet, is there a way to make a menu like Vista's "All programs" menu?

TIA,

ChrisN

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I use something like this (thanks go to taietel I believe)

$hWnd = Handle to your Gui

$dll = DllOpen("user32.dll")

then use this before your GuiSetState

DllCall($dll, "int", "AnimateWindow", "hwnd", $hWnd, "int", 100, "long", 0x00040006)

changing the last perameter changes the animation type I believe

*edit*

Fixed Taietel's name LOL

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

See if this helps:

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
;written by taietel
;modify to fit your needs
Global $bToggle = 0, $bEditToggle=0, $iW=500, $iH=450
$aDrive = DriveGetDrive("all")
Global $iItems=$aDrive[0]
Global $aButtons[$iItems][3]
$hGui = GUICreate("Select drives", $iW, $iH, -1, -1, BitOR($WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetBkColor(0x000000)
$hExit = GUICtrlCreateIcon("shell32.dll", -28, $iW-24, 8, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetTip(-1, "Close me!...")
GUICtrlSetCursor(-1,0)
GUICtrlSetDefColor(0xDEDEDE)

For $i=1 To $iItems-1
Local $iIcon
Switch DriveGetType($aDrive[$i])
Case "fixed"
$iIcon = -8
Case "cdrom"
$iIcon = -189
Case "removable"
$iIcon = -195
Case "network"
$iIcon = -10
Case "ramdisk"
$iIcon = -13
Case Else
$iIcon = -9
EndSwitch
$aButtons[$i][0] = GUICtrlCreateIcon("shell32.dll", $iIcon, 8, $iH-40, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetCursor(-1,0)
GUICtrlSetState(-1,$GUI_HIDE)
$aButtons[$i][1]=GUICtrlCreateLabel(StringUpper(DriveGetType($aDrive[$i]) & " " & $aDrive[$i]), 48, $iH-30,100,17,$SS_CENTERIMAGE)
;~GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) ;if you want the background of the label transparent, uncomment this line and comment the next one
GUICtrlSetBkColor(-1,0x222222)
GUICtrlSetCursor(-1,0)
GUICtrlSetState(-1,$GUI_HIDE)
Next
$aButtons[0][0] = GUICtrlCreateIcon("shell32.dll", -131, 8, $iH-40, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetCursor(-1,0)
GUICtrlSetTip(-1, "Press me to expand/retract!")
$aButtons[0][1]=GUICtrlCreateLabel("Drives", 48, $iH-30)
GUICtrlSetTip(-1, "Press me to expand/retract!")
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetCursor(-1,0)
GUICtrlCreatePic("", 1, 1, $iW-2, $iH-2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS), $GUI_WS_EX_PARENTDRAG)
WinSetTrans($hGui,"",210)
GUISetState(@SW_SHOW)

While 1
Sleep(10)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $hExit
Exit
Case $aButtons[0][0], $aButtons[0][1]
_ExpandRetract()
Case $aButtons[1][0] To $aButtons[$iItems-1][0], $aButtons[1][1] To $aButtons[$iItems-1][1]
For $i=1 To $iItems-1
If $nMsg = $aButtons[$i][0] Or $nMsg = $aButtons[$i][1] Then ShellExecute($aDrive[$i]&"\","","","open")
Next
Sleep(200)
_ExpandRetract()
EndSwitch
WEnd

Func _ExpandRetract()
Switch $bToggle
Case 0
For $i=1 To $iItems-1
;~ControlMove($hGui,"",$aButtons[$i][0], 8 + 2*$i^2, $iH - 40 - $i*32);curved expansion
ControlMove($hGui,"",$aButtons[$i][0], 8, $iH - 40 - $i*32);vertical expansion
GUICtrlSetState($aButtons[$i][0],$GUI_SHOW)
;~ControlMove($hGui,"",$aButtons[$i][1], 48 + 2*$i^2, $iH - 30 - $i*32);curved expansion
ControlMove($hGui,"",$aButtons[$i][1], 48, $iH - 30 - $i*32);vertical expansion
GUICtrlSetState($aButtons[$i][1],$GUI_SHOW)
Sleep(20)
Next
$bToggle=1
Case 1
For $i=$iItems-1 To 1 Step -1
GUICtrlSetState($aButtons[$i][0],$GUI_HIDE)
ControlMove($hGui,"",$aButtons[$i][0], 8, $iH-40)
GUICtrlSetState($aButtons[$i][1],$GUI_HIDE)
ControlMove($hGui,"",$aButtons[$i][1], 48, $iH-30)
Sleep(20)
Next
$bToggle=0
EndSwitch
EndFunc

Share this post


Link to post
Share on other sites

Hey, that's pretty awesome! :D Thanks, taietel! Now, to figure out how it works... :oops:

Share this post


Link to post
Share on other sites

See if this helps:

#include <StaticConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
;written by taietel
;modify to fit your needs
Global $bToggle = 0, $bEditToggle=0, $iW=500, $iH=450
$aDrive = DriveGetDrive("all")
Global $iItems=$aDrive[0]
Global $aButtons[$iItems][3]
$hGui = GUICreate("Select drives", $iW, $iH, -1, -1, BitOR($WS_POPUP, $WS_BORDER, $WS_CLIPSIBLINGS))
GUISetBkColor(0x000000)
$hExit = GUICtrlCreateIcon("shell32.dll", -28, $iW-24, 8, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetTip(-1, "Close me!...")
GUICtrlSetCursor(-1,0)
GUICtrlSetDefColor(0xDEDEDE)

For $i=1 To $iItems-1
Local $iIcon
Switch DriveGetType($aDrive[$i])
Case "fixed"
$iIcon = -8
Case "cdrom"
$iIcon = -189
Case "removable"
$iIcon = -195
Case "network"
$iIcon = -10
Case "ramdisk"
$iIcon = -13
Case Else
$iIcon = -9
EndSwitch
$aButtons[$i][0] = GUICtrlCreateIcon("shell32.dll", $iIcon, 8, $iH-40, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetCursor(-1,0)
GUICtrlSetState(-1,$GUI_HIDE)
$aButtons[$i][1]=GUICtrlCreateLabel(StringUpper(DriveGetType($aDrive[$i]) & " " & $aDrive[$i]), 48, $iH-30,100,17,$SS_CENTERIMAGE)
;~GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT) ;if you want the background of the label transparent, uncomment this line and comment the next one
GUICtrlSetBkColor(-1,0x222222)
GUICtrlSetCursor(-1,0)
GUICtrlSetState(-1,$GUI_HIDE)
Next
$aButtons[0][0] = GUICtrlCreateIcon("shell32.dll", -131, 8, $iH-40, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP))
GUICtrlSetCursor(-1,0)
GUICtrlSetTip(-1, "Press me to expand/retract!")
$aButtons[0][1]=GUICtrlCreateLabel("Drives", 48, $iH-30)
GUICtrlSetTip(-1, "Press me to expand/retract!")
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetCursor(-1,0)
GUICtrlCreatePic("", 1, 1, $iW-2, $iH-2, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS), $GUI_WS_EX_PARENTDRAG)
WinSetTrans($hGui,"",210)
GUISetState(@SW_SHOW)

While 1
Sleep(10)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE, $hExit
Exit
Case $aButtons[0][0], $aButtons[0][1]
_ExpandRetract()
Case $aButtons[1][0] To $aButtons[$iItems-1][0], $aButtons[1][1] To $aButtons[$iItems-1][1]
For $i=1 To $iItems-1
If $nMsg = $aButtons[$i][0] Or $nMsg = $aButtons[$i][1] Then ShellExecute($aDrive[$i]&"","","","open")
Next
Sleep(200)
_ExpandRetract()
EndSwitch
WEnd

Func _ExpandRetract()
Switch $bToggle
Case 0
For $i=1 To $iItems-1
;~ControlMove($hGui,"",$aButtons[$i][0], 8 + 2*$i^2, $iH - 40 - $i*32);curved expansion
ControlMove($hGui,"",$aButtons[$i][0], 8, $iH - 40 - $i*32);vertical expansion
GUICtrlSetState($aButtons[$i][0],$GUI_SHOW)
;~ControlMove($hGui,"",$aButtons[$i][1], 48 + 2*$i^2, $iH - 30 - $i*32);curved expansion
ControlMove($hGui,"",$aButtons[$i][1], 48, $iH - 30 - $i*32);vertical expansion
GUICtrlSetState($aButtons[$i][1],$GUI_SHOW)
Sleep(20)
Next
$bToggle=1
Case 1
For $i=$iItems-1 To 1 Step -1
GUICtrlSetState($aButtons[$i][0],$GUI_HIDE)
ControlMove($hGui,"",$aButtons[$i][0], 8, $iH-40)
GUICtrlSetState($aButtons[$i][1],$GUI_HIDE)
ControlMove($hGui,"",$aButtons[$i][1], 48, $iH-30)
Sleep(20)
Next
$bToggle=0
EndSwitch
EndFunc

This is very cool, if I were to try and include folders with specific applications in each folder, what might be a good first step or another script that would push me in the right direction.

I'm attempting to build a WinPE "StartMenu" that can directly launch apps but also has cascading Folders (Backup, diagnostics, etc...) that contain other apps.

Any suggestions would be greatly appreciated.

-Mike

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