Jump to content

Windows 8 simple start menu


grimmlock
 Share

Recommended Posts

Hello,

I really do like windows 8 and how you have to get to the start menu. I created a small little app that allows you to open the start menu, search for something, open the run command, and log off, lock, shutdown or restart your pc.

#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>



$main = GUICreate("", 150, 265, 5, 560) ; $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0x0094FF)
; _WinAPI_SetLayeredWindowAttributes($main, 0x0000F4, 100)


GUISetState(@SW_Show)


$Input1 = GuiCtrlCreateInput("", 10, 95, 130, 20)
$button1 = GuiCtrlCreateButton("Start Menu", 10, 20, 130, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)
$button2 = GuiCtrlCreateButton("Search", 10, 125, 130, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)
$button3 = GuiCtrlCreateButton("Run", 10, 160, 130, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)
$button4 = GuiCtrlCreateButton("Log Off...", 10, 220, 110, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)
$button8 = GuiCtrlCreateButton(">", 110, 220, 30, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)


; _AddHorzSep(10, 40, 290)
   _AddHorzSep(10, 65, 130)
   _AddHorzSep(10, 205, 130)



While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit

Case $button1
; Run("Explorer.exe C:\ProgramData\Microsoft\Windows\Start Menu\Programs")
Send("{LWin}") ; <<<<<< Start Menu
Exit

Case $button2
Run("C:\Windows\System32\explorer.exe search-ms:") ; <<<<<<< Windows Search
Sleep(1000)
Send(GuiCtrlRead($Input1))
Exit

Case $button3
Send("#r") ; <<<<<<< Windows Run
Sleep(1000)
Send("!a{delete}")
Send(GuiCtrlRead($Input1))
Sleep(1000)
Send("{Enter}")
Exit

 Case $button4 ; <<<<<<< Logoff
$msg1 = msgbox(4, "", "Are you sure you want to Logoff")
If $msg1 = 6 Then
  Shutdown(0)
Else
  Exit
  ;GuiSetState(@SW_HIDE)
EndIf

Case $button8
Second()


EndSwitch
WEnd

Func Second()
$second = GUICreate("", 100, 130, 150, 721, $WS_POPUP) ;, $WS_EX_LAYERED)
GUISetBkColor(0x0094FF)
; _WinAPI_SetLayeredWindowAttributes($second, 0x0000F4, 200)


Local $button5 = GuiCtrlCreateButton("Lock", 10, 10, 75, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)
Local $button6 = GuiCtrlCreateButton("Restart", 10, 50, 75, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)
Local $button7 = GuiCtrlCreateButton("Shutdown", 10, 90, 75, 30)
GUICtrlSetBkColor(-1, 0x3FAFFF)



GUISetState(@SW_SHOW)

While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit

 Case $button5  ; <<<<<< Lock
Run("rundll32.exe user32.dll, LockWorkStation") 

Case $button6  ; <<<<<< Restart
$msg2 = msgbox(4, "", "Are you sure you want to Restart")
If $msg2 = 6 Then
  Shutdown(2)
Else
  Exit
  ; GuiSetState(@SW_HIDE)
  EndIf   

 Case $button7 ; <<<<<<<< Shutdown
$msg3 = msgbox(4, "", "Are you sure you want to Shutdown")
If $msg3 = 6 Then
  Shutdown(1)
Else
  Exit
  ;GuiSetState()
EndIf


EndSwitch
WEnd

EndFunc


Func _AddHorzSep($iX, $iY, $iW)

    GUICtrlCreateLabel("", $iX, $iY, $iW, 1)
    GUICtrlSetBkColor(-1, 0x000000)


EndFunc   ;==>_AddHorzSep

Please feel free to change it :)

Thanks

Grimm

Thanks

Grimm

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

×
×
  • Create New...