ashley Posted October 14, 2007 Share Posted October 14, 2007 how could i have icons in the list view when start is pressed, and how can i have it on the button which is currently blank(could that button just be trasparrent with just icon. heres my script: expandcollapse popup#include <GUIConstants.au3> #include <Date.au3> Global $List1, $Close=1, $Open=1, $Start, $Form1, $startmenu, $date, $Closedate #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("OS shell", 633, 430, 193, 115) GUISetBkColor(0x808080) $Start = GUICtrlCreateButton("Start", 3, 409, 75, 17, 0) $Time = GUICtrlCreateButton(@Hour & ":" & @Min, 544, 409, 75, 17, 0) $Paint = GUICtrlCreateButton("", 8, 8, 59, 49, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() If GuiCtrlRead($Time) <> @Hour & ":" & @Min then GUICtrlSetData($Time, @Hour & ":" & @Min) Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start Startmenu() Case $Close CloseStartmenu() Case $Open If GUICtrlRead($startmenu) = "Notepad" Then Run("Notepad") EndIf If GUICtrlRead($startmenu) = "Paint" Then Run("MSpaint") EndIf Case $Time $date = GUICtrlCreateMonthCal("2007/10/14", 432, 246, 191, 161) $Closedate = GUICtrlCreateButton("X", 504, 409, 35, 17, 0) Case $Closedate GUICtrlDelete($date) GUICtrlDelete($Closedate) Case $Paint Run("MSpaint") EndSwitch WEnd Func Startmenu() GUICtrlDelete($Start) $Open = GUICtrlCreateButton("Open", 3, 409, 75, 17, 0) $startmenu = GUICtrlCreateList("", 8, 305, 121, 97) GUICtrlSetData(-1, "Notepad|Paint") $Close = GUICtrlCreateButton("X", 83, 409, 35, 17, 0) EndFunc Func CloseStartmenu() GUICtrlDelete($startmenu) GUICtrlDelete($Close) GUICtrlDelete($Open) $Start = GUICtrlCreateButton("Start", 3, 409, 75, 17, 0) EndFunc Free icons for your programs Link to comment Share on other sites More sharing options...
Nahuel Posted October 14, 2007 Share Posted October 14, 2007 GUICtrlSetImage expandcollapse popup#include <GUIConstants.au3> Global $List1, $Close, $Open, $Start, $Form1, $startmenu Global $DoubleClicked = False Global Const $WM_NOTIFY = 0x004E #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("OS shell", 633, 430, 193, 115) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetBkColor(0x808080) $Start = GUICtrlCreateButton("Start", 3, 380, 50,50, $BS_ICON) GUICtrlSetImage (-1, "shell32.dll",-16) $Open = GUICtrlCreateButton("Open", 3, 409, 75, 17, 0) GUICtrlSetState(-1, $GUI_HIDE) $startmenu = GUICtrlCreateListView("Applications ", 8, 305, 85, 97,$LVS_NOSORTHEADER) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlCreateListViewItem("Notepad",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-56) GUICtrlCreateListViewItem("Paint",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-42) $Close = GUICtrlCreateButton("X", 83, 409, 35, 17, 0) GUICtrlSetState(-1, $GUI_HIDE) $date = GUICtrlCreateMonthCal("2007/10/14", 432, 246, 191, 161) GUICtrlSetState(-1, $GUI_HIDE) $Closedate = GUICtrlCreateButton("X", 504, 409, 35, 17, 0) GUICtrlSetState(-1, $GUI_HIDE) $Time = GUICtrlCreateButton(@Hour & ":" & @Min, 544, 409, 75, 17, 0) GUISetState() #EndRegion ### END Koda GUI section ### AdlibEnable("refresh_time",2000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start Startmenu() Case $Close CloseStartmenu() Case $Open Case $Time GUICtrlSetState($date, $GUI_SHOW) GUICtrlSetState($Closedate, $GUI_SHOW) Case $Closedate GUICtrlSetState($date, $GUI_HIDE) GUICtrlSetState($Closedate, $GUI_HIDE) EndSwitch If $DoubleClicked Then DoubleClickFunc() $DoubleClicked = False EndIf WEnd Func Startmenu() GUIctrlSetState($Start,$GUI_HIDE) GUICtrlSetState($Open, $GUI_SHOW) GUICtrlSetState($Startmenu, $GUI_SHOW) GUICtrlSetState($Close, $GUI_SHOW) EndFunc Func CloseStartmenu() GUICtrlSetState($Open, $GUI_HIDE) GUICtrlSetState($Startmenu, $GUI_HIDE) GUICtrlSetState($Close, $GUI_HIDE) GUIctrlSetState($Start,$GUI_SHOW) EndFunc Func refresh_time() GUICtrlSetData($Time,@Hour & ":" & @Min) EndFunc Func WM_NOTIFY($hWnd, $MsgID, $wParam, $lParam) Local $tagNMHDR, $event, $hwndFrom, $code $tagNMHDR = DllStructCreate("int;int;int", $lParam) If @error Then Return 0 $code = DllStructGetData($tagNMHDR, 3) If $wParam = $startmenu And $code = -3 Then $DoubleClicked = True Return $GUI_RUNDEFMSG EndFunc Func DoubleClickFunc() $App=GUICtrlRead(GUICtrlRead($Startmenu)) Switch $App Case "Notepad" Run("notepad") Case "Paint" Run("mspaint") EndSwitch EndFunc Link to comment Share on other sites More sharing options...
ashley Posted October 14, 2007 Author Share Posted October 14, 2007 GUICtrlSetImage expandcollapse popup#include <GUIConstants.au3> Global $List1, $Close, $Open, $Start, $Form1, $startmenu Global $DoubleClicked = False Global Const $WM_NOTIFY = 0x004E #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("OS shell", 633, 430, 193, 115) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetBkColor(0x808080) $Start = GUICtrlCreateButton("Start", 3, 380, 50,50, $BS_ICON) GUICtrlSetImage (-1, "shell32.dll",-16) $Open = GUICtrlCreateButton("Open", 3, 409, 75, 17, 0) GUICtrlSetState(-1, $GUI_HIDE) $startmenu = GUICtrlCreateListView("Applications ", 8, 305, 85, 97,$LVS_NOSORTHEADER) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlCreateListViewItem("Notepad",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-56) GUICtrlCreateListViewItem("Paint",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-42) $Close = GUICtrlCreateButton("X", 83, 409, 35, 17, 0) GUICtrlSetState(-1, $GUI_HIDE) $date = GUICtrlCreateMonthCal("2007/10/14", 432, 246, 191, 161) GUICtrlSetState(-1, $GUI_HIDE) $Closedate = GUICtrlCreateButton("X", 504, 409, 35, 17, 0) GUICtrlSetState(-1, $GUI_HIDE) $Time = GUICtrlCreateButton(@Hour & ":" & @Min, 544, 409, 75, 17, 0) GUISetState() #EndRegion ### END Koda GUI section ### AdlibEnable("refresh_time",2000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start Startmenu() Case $Close CloseStartmenu() Case $Open Case $Time GUICtrlSetState($date, $GUI_SHOW) GUICtrlSetState($Closedate, $GUI_SHOW) Case $Closedate GUICtrlSetState($date, $GUI_HIDE) GUICtrlSetState($Closedate, $GUI_HIDE) EndSwitch If $DoubleClicked Then DoubleClickFunc() $DoubleClicked = False EndIf WEnd Func Startmenu() GUIctrlSetState($Start,$GUI_HIDE) GUICtrlSetState($Open, $GUI_SHOW) GUICtrlSetState($Startmenu, $GUI_SHOW) GUICtrlSetState($Close, $GUI_SHOW) EndFunc Func CloseStartmenu() GUICtrlSetState($Open, $GUI_HIDE) GUICtrlSetState($Startmenu, $GUI_HIDE) GUICtrlSetState($Close, $GUI_HIDE) GUIctrlSetState($Start,$GUI_SHOW) EndFunc Func refresh_time() GUICtrlSetData($Time,@Hour & ":" & @Min) EndFunc Func WM_NOTIFY($hWnd, $MsgID, $wParam, $lParam) Local $tagNMHDR, $event, $hwndFrom, $code $tagNMHDR = DllStructCreate("int;int;int", $lParam) If @error Then Return 0 $code = DllStructGetData($tagNMHDR, 3) If $wParam = $startmenu And $code = -3 Then $DoubleClicked = True Return $GUI_RUNDEFMSG EndFunc Func DoubleClickFunc() $App=GUICtrlRead(GUICtrlRead($Startmenu)) Switch $App Case "Notepad" Run("notepad") Case "Paint" Run("mspaint") EndSwitch EndFuncTYVM just what i needed Free icons for your programs Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now