ashley Posted October 14, 2007 Share Posted October 14, 2007 how would i open paint if paint had been dubble-clicked in the listview 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 All you had to do was search.expandcollapse popup#include <GuiConstants.au3> Global Const $WM_NOTIFY = 0x004E Global $DoubleClicked = False GUICreate("Double Click Demo", 400, 300) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") $ListViewID = GuiCtrlCreateListView("List Column", 10, 20, 380, 250) For $i = 1 To 10 GuiCtrlCreateListViewItem("Item " & $i, $ListViewID) Next GUISetState() While GUIGetMsg() <> -3 Sleep(10) If $DoubleClicked Then DoubleClickFunc() $DoubleClicked = False EndIf WEnd Func DoubleClickFunc() MsgBox(64, "OK", "Double Clicked: " & GUICtrlRead(GUICtrlRead($ListViewID))) 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 = $ListViewID And $code = -3 Then $DoubleClicked = True Return $GUI_RUNDEFMSG EndFunchttp://www.autoitscript.com/forum/index.ph...iew+doubleclick Link to comment Share on other sites More sharing options...
ashley Posted October 14, 2007 Author Share Posted October 14, 2007 All you had to do was search. #include <GuiConstants.au3> Global Const $WM_NOTIFY = 0x004E Global $DoubleClicked = False GUICreate("Double Click Demo", 400, 300) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") $ListViewID = GuiCtrlCreateListView("List Column", 10, 20, 380, 250) For $i = 1 To 10 GuiCtrlCreateListViewItem("Item " & $i, $ListViewID) Next GUISetState() While GUIGetMsg() <> -3 Sleep(10) If $DoubleClicked Then DoubleClickFunc() $DoubleClicked = False EndIf WEnd Func DoubleClickFunc() MsgBox(64, "OK", "Double Clicked: " & GUICtrlRead(GUICtrlRead($ListViewID))) 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 = $ListViewID And $code = -3 Then $DoubleClicked = True Return $GUI_RUNDEFMSG EndFunc http://www.autoitscript.com/forum/index.ph...iew+doubleclickthat dont work with the shell im making 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 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, 409, 75, 17, 0) $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 ) GUICtrlCreateListViewItem("Paint",$startmenu ) $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 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, 409, 75, 17, 0) $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 ) GUICtrlCreateListViewItem("Paint",$startmenu ) $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 but i found a way around it 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 Link to comment Share on other sites More sharing options...
ashley Posted October 14, 2007 Author Share Posted October 14, 2007 how could i ahve icon in the list view and how could i have icon buttons not in listview(somewere in the gui) 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 how could i ahve icon in the list view and how could i have icon buttons not in listview(somewere in the gui) What for? So when I give you a solution you go "tyvm but i found a way around it" 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 What for? So when I give you a solution you go "tyvm but i found a way around it" 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