ashley Posted October 15, 2007 Posted October 15, 2007 Is it possibe to have VISTA type desktop icons as a button so i can use in my shell i ahve done the best i can but when they are draged the glitch any ideas? Free icons for your programs
Valuater Posted October 15, 2007 Posted October 15, 2007 Yes, I have one idea...."POST CODE!"That will help you!8)
ashley Posted October 15, 2007 Author Posted October 15, 2007 ok i dont see the point tho just look ia OShell in excaple scripts but anyways here my code expandcollapse popup#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_outfile=OShell.exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseAnsi=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstants.au3> #include <Misc.au3> #include <Date.au3> Opt("RunErrorsFatal",0) Opt("GUICloseOnESC",0) Global $List1, $Close, $Open, $Start, $Form1, $startmenu Global $DoubleClicked = False Global Const $WM_NOTIFY = 0x004E Global $StartMenuShow=False Global $DateMenuShow=False Global $SystemSettings=False $BackColor = IniRead(@ScriptDir & "\Settings.ini", "Settings", "BackColor", "0xC0C0C0") ; Reads the users Background Color from the settings ini file WinSetState("[CLASS:Shell_TrayWnd]","",@SW_HIDE) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("OS shell", 633, 430, 193, 115, BitOR($WS_POPUP,$WS_CLIPSIBLINGS)) $ContMenu=GUICtrlCreateContextMenu() $ChangeColor=GUICtrlCreateMenuItem("Change Background Color",$ContMenu) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetBkColor($BackColor) ; Sets the color read from the ini $Start = GUICtrlCreateButton("Start", 3, 409, 75, 17, 0) $Open = GUICtrlCreateButton("Open", 3, 409, 75, 17, 0) GUICtrlSetState(-1, $GUI_HIDE) $startmenu = GUICtrlCreateListView("Applications ", 0, 310, 85, 97,$LVS_NOSORTHEADER) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlCreateListViewItem("Paint",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-35) GUICtrlCreateListViewItem("Notepad",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-71) GUICtrlCreateListViewItem("System",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-166) GUICtrlCreateListViewItem("Shutdown",$startmenu ) GUICtrlSetImage (-1, "shell32.dll",-113) $date = GUICtrlCreateMonthCal("", 432, 246, 191, 161) GUICtrlSetState(-1, $GUI_HIDE) $Time = GUICtrlCreateButton(_NowTime(), 544, 409, 75, 17, 0) $Paint = GUICtrlCreateButton("Paint", 8, 8, 59, 49,BitOR($BS_PUSHBOX,$BS_FLAT,$BS_ICON)) GUICtrlSetImage (-1, "shell32.dll",-35) $Notepad = GUICtrlCreateButton("Notepad", 8, 80, 59, 49, BitOR($BS_PUSHBOX,$BS_FLAT,$BS_ICON)) GUICtrlSetImage (-1, "shell32.dll",-71) $SystemSettings = GUICtrlCreateListView("System ", 0, 310, 85, 97,$LVS_NOSORTHEADER) GUICtrlSetState(-1, $GUI_HIDE) GUICtrlCreateListViewItem("Background Color",$SystemSettings ) GUICtrlSetImage (-1, "shell32.dll",-166) $startbar = GUICtrlCreatePic(@ScriptDir & "\OSstartbar.bmp", 0, 394, 2000, 35, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetState() GUISetState(@SW_MAXIMIZE) #EndRegion ### END Koda GUI section ### AdlibEnable("refresh_time",1000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Start Startmenu() Case $Time If not $DateMenuShow Then GUICtrlSetState($date, $GUI_SHOW) $DateMenuShow=True Else GUICtrlSetState($date, $GUI_HIDE) $DateMenuShow=False EndIf Case $Paint GUICtrlDelete($Paint) $Paint = GUICtrlCreateButton("Paint", 8, 8, 59, 49,BitOR($BS_PUSHBOX,$BS_FLAT,$BS_ICON)) GUICtrlSetImage (-1, "shell32.dll",-35) Run("MSpaint") Case $Notepad GUICtrlDelete($Notepad) $Notepad = GUICtrlCreateButton("Notepad", 8, 64, 59, 49, BitOR($BS_PUSHBOX,$BS_FLAT,$BS_ICON)) GUICtrlSetImage (-1, "shell32.dll",-71) Run("notepad") Case $ChangeColor _ChangeColor() EndSwitch If $DoubleClicked Then DoubleClickFunc() $DoubleClicked = False EndIf WEnd Func Startmenu() If not $StartMenuShow Then GUICtrlSetState($SystemSettings, $GUI_HIDE) GUICtrlSetState($Startmenu, $GUI_SHOW) $StartMenuShow=True Else GUICtrlSetState($SystemSettings, $GUI_HIDE) GUICtrlSetState($Startmenu, $GUI_HIDE) $StartMenuShow=False EndIf EndFunc Func refresh_time() GUICtrlSetData($Time,_NowTime()) 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") Case "Shutdown" WinSetState("[CLASS:Shell_TrayWnd]","",@SW_SHOW) Exit Case "System" GUICtrlSetState($Startmenu, $GUI_HIDE) GUICtrlSetState($SystemSettings, $GUI_SHOW) Case "Background Color" _ChangeColor() EndSwitch EndFunc Func _ChangeColor() $bkColor=_ChooseColor(2) If not @error Then GUISetBkColor($bkColor) EndIf IniWrite(@ScriptDir & "\Settings.ini", "Settings", "BackColor", $bkColor) ; Saves the color EndFunc Free icons for your programs
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