Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/02/2012 in all areas

  1. Dunno. How about this? Run(@ProgramFilesDir & "Mozilla Firefoxfirefox.exe", "", @SW_MINIMIZE) WinWaitActive("Google - Mozilla Firefox", "", 10000) WinSetState("Google - Mozilla Firefox", "", @SW_MINIMIZE)
    1 point
  2. biase, Did you look at the Help file examples? I think not because you are not even registering the correct message! This works for me: #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiToolbar.au3> #include <WindowsConstants.au3> #include <Array.au3> Global $iItem Global $aStrings[5] Global $aTitles[6] = ["Radio", "TV", "Movie", "", "About", "Exit"] ; We need the blank so the CIDs match the indices Global Enum $idRadio = 1000, $idTV, $idMovie, $idAbout, $idExit Global $aCID[6] $hGUI = GUICreate("Multimedia", 623, 449, 192, 114) $hImageList = _GUIImageList_Create(32, 32, 5) _GUIImageList_AddIcon($hImageList, @ScriptDir & 'Iron_Radio.ico', '', True) _GUIImageList_AddIcon($hImageList, @ScriptDir & 'Iron_TV.ico', '', True) _GUIImageList_AddIcon($hImageList, @ScriptDir & 'Iron_Movie.ico', '', True) _GUIImageList_AddIcon($hImageList, @ScriptDir & 'Iron_About.ico', '', True) _GUIImageList_AddIcon($hImageList, @ScriptDir & 'Iron_Exit.ico', '', True) $hToolBar = _GUICtrlToolbar_Create($hGUI, 0) _GUICtrlToolbar_SetImageList($hToolBar, $hImageList) ; Add strings $aStrings[0] = _GUICtrlToolbar_AddString($hToolBar, $aTitles[0]) $aStrings[1] = _GUICtrlToolbar_AddString($hToolBar, $aTitles[1]) $aStrings[2] = _GUICtrlToolbar_AddString($hToolBar, $aTitles[2]) $aStrings[3] = _GUICtrlToolbar_AddString($hToolBar, $aTitles[4]) ; Careful with the index numbering here $aStrings[4] = _GUICtrlToolbar_AddString($hToolBar, $aTitles[5]) _GUICtrlToolbar_AddButton($hToolBar, $idRadio, 0, 0) _GUICtrlToolbar_AddButton($hToolBar, $idTv, 1, 1) _GUICtrlToolbar_AddButton($hToolBar, $idMovie, 2, 2) _GUICtrlToolbar_AddButtonSep($hToolbar) _GUICtrlToolbar_AddButton($hToolBar, $idAbout, 3, 3) _GUICtrlToolbar_AddButton($hToolBar, $idExit, 4, 4) ; This dummy will fire when a button is clicked $cDummy = GUICtrlCreateDummy() GUISetState() ; Register WM_COMMAND messages GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cDummy ; The dummy was fired so read the index and show the button title MsgBox(0, "Clicked", $aTitles[GUICtrlRead($cDummy)]) EndSwitch WEnd ; WM_NOTIFY event handler Func _WM_NOTIFY($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tNMHDR, $hwndFrom, $code, $i_idNew, $dwFlags, $i_idOld Local $tNMTBHOTITEM $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hwndFrom = DllStructGetData($tNMHDR, "hWndFrom") $code = DllStructGetData($tNMHDR, "Code") Switch $hwndFrom Case $hToolbar Switch $code Case $NM_LDOWN ; A button was clicked so fire the dummy control with the index of the "hot" item $iClicked = _GUICtrlToolbar_CommandToIndex($hToolbar, $iItem) GUICtrlSendToDummy($cDummy, $iClicked) Case $TBN_HOTITEMCHANGE $tNMTBHOTITEM = DllStructCreate($tagNMTBHOTITEM, $lParam) $i_idOld = DllStructGetData($tNMTBHOTITEM, "idOld") $i_idNew = DllStructGetData($tNMTBHOTITEM, "idNew") ; Note the "hot" item $iItem = $i_idNew $dwFlags = DllStructGetData($tNMTBHOTITEM, "dwFlags") EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>_WM_NOTIFYYou may wonder why I went to all the trouble of using a dummy control rather then showing the MsgBox directly from the message handler - read the Help file page for GUIRegisterMsg to find out. M23
    1 point
  3. I would suggest looking at the help file for _GUICtrlToolBar_Create, the example in there should give you a good idea of how to use the toolbar buttons and how the window message should be interpreted.
    1 point
  4. Uninteresting topic is uninteresting. I hate having to guess what OPs want, so I'll do what most anyone else is doing. Ignore it and move on.
    1 point
  5. I showed only the next-Button, the Back-Button will be implemented the same way. Using SwitchToStep you can jump to any step you want.For a 50-Page GUI, I would recommend an additional TreeView on the left side where you can manually jump to the pages PS: An example of what I mean from monodevelop: http://monodevelop.com/@api/deki/files/189/=OptionsDialogReorg.png
    1 point
×
×
  • Create New...