Jump to content

Launcher that emulates Start Menu


Recommended Posts

Hi, I'm trying to make a program launcher that's controlled by the keyboard and looks like the Start Menu. I tried using ...CreateMenu but I can't figure out how to make the menu open right away. I tried using ...CreateList which looked good but I couldn't figure out how to make it respond to the <Enter> key. Any help would be appreciated.

Link to comment
Share on other sites

You can do something like this and put a toolbar or something on it ;]

#include <WinAPI.au3>
#include <WindowsConstants.au3>
HotKeySet('{ESC}', '_EXIT')

Const $SPI_GETWORKAREA = 0x0030

Dim $tRect = DllStructCreate($tagRECT), $hGUI

_WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($tRect))
Const $iWidth = DllStructGetData($tRect, 'Right')
Const $iHeight = DllStructGetData($tRect, 'Bottom')

$hGUI = GUICreate('', 200, 30, $iWidth, $iHeight-30, $WS_POPUPWINDOW, $WS_EX_TOOLWINDOW)

GUISetState()
AdlibEnable('_ShowWindow', 100)

While 1
    Sleep(20)
WEnd

Func _EXIT()
    AdlibDisable()
    GUIDelete()
    Exit
EndFunc

Func _ShowWindow()
    Local $aPos = MouseGetPos()
    If ($aPos[0] > $iWidth-199 And $aPos[0] < $iWidth+1) And _
        ($aPos[1] > $iHeight-31 And $aPos[1] < $iHeight-1) Then
        AdlibDisable()
        WinMove($hGUI, '', $iWidth-200, $iHeight-30, 200, 30, 2)
        
        While ($aPos[0] > $iWidth-199 And $aPos[0] < $iWidth+1) And _
                ($aPos[1] > $iHeight-31 And $aPos[1] < $iHeight-1)
            $aPos = MouseGetPos()
            Sleep(20)
        WEnd
            
        WinMove($hGUI, '', $iWidth, $iHeight-30, 200, 30, 2)
        AdlibEnable('_ShowWindow', 100)
    EndIf
EndFunc
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...