Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/20/2025 in all areas

  1. I just wanted to take a moment to thank everyone again who helped with this issue. I've completed the part of the project that relates to the menubar. I actually ended up coloring that line in such a way that it gives the GUI some depth and also made the statusbar sizing and style to match it. When I started learning AutoIt a little over a year ago, I never thought that such beautiful GUIs could be made. I was able to make that line semi-transparent along with the rest of the GUI so that it does the blur behind well and also the Windows 11 materials (Mica, Acrylic, etc.) Cheers everyone! 🍷
    2 points
  2. You could have more instances looking for it and report via IPC ( my take on "how" here ) and there are a few in the WiKi that you can try. This way if you run 8 chunks of screen, it'll 8 times faster of whatever technique you use.
    2 points
  3. #NoTrayIcon #include <AutoItConstants.au3> #include <TrayConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> Global $hGUI Opt("TrayMenuMode", 3) Opt("TrayAutoPause", 0) Opt("TrayOnEventMode", 1) TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, 'idGUI') TraySetClick(16) Global $idGUI = TrayCreateItem("Show GUI") TrayItemSetOnEvent($idGUI, "idGUI") TrayCreateItem("") Global $idExit = TrayCreateItem('Exit') TrayItemSetOnEvent($idExit, "_Exit") TraySetIcon(@AutoItExe, 1) TraySetToolTip("Show GUI") Example() Func Example() Local $sDefaultstatus = "Ready" $hGUI = GUICreate("My GUI menu", 300, 200) Local $idMnu_File = GUICtrlCreateMenu("&File") Local $idMnu_Help = GUICtrlCreateMenu("Help") Local $idMni_Info = GUICtrlCreateMenuItem("About", $idMnu_Help) Local $idMnu_View = GUICtrlCreateMenu("View", -1, 1) Local $idBtn_Hide = GUICtrlCreateButton("Hide GUI", 50, 130, 70, 20) GUICtrlSetState(-1, $GUI_FOCUS) Local $idBtn_Cancel = GUICtrlCreateButton("Exit", 180, 130, 70, 20) Local $idLbl_Status = GUICtrlCreateLabel($sDefaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN)) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $idBtn_Hide ;~ GUISetState(@SW_HIDE, $hGUI) WinSetState($hGUI, "", @SW_HIDE) Case $idBtn_Cancel, $GUI_EVENT_CLOSE ExitLoop Case $idMni_Info MsgBox($MB_SYSTEMMODAL, "Info", "Only a test...") EndSwitch WEnd GUIDelete() EndFunc ;==>Example Func _Exit() Exit EndFunc Func idGUI() If Not BitAND(WinGetState($hGUI), $WIN_STATE_VISIBLE) Then WinSetState($hGUI, "", @SW_SHOW) ;~ ; get GUI window state ;~ Local $iState = WinGetState($hGUI) ;~ If $iState <> $WIN_STATE_VISIBLE Then GUISetState(@SW_SHOW, $hGUI) EndFunc yes, is an old bug, and the way it is. Fortunately you can get around it.
    2 points
  4. It is a pleasure to see people getting the hang of it and realizing their visions 🍷
    1 point
  5. ios747, .....oooopppppssss...missed that one...obviously!!! Thanks!!
    1 point
  6. I came across this issue in one of my projects and decided to recreate a smaller script to reproduce the issue and see if anyone knows how I can get around this issue. The main GUI script has the ability to hide to it's system tray icon Clicking on the tray icon will show the GUI again In this case, the menu items (Help > About) and controls still work I have a situation where I use another script to show the GUI again since it is normally hidden in the system tray. GUI is already hidden in system tray This second script runs to show the GUI GUI does show and everything appears visually correct In this case, the menu items (Help > About) and controls do NOT work Yet if I hide the GUI again during the same run, and show itself again from the tray icon, everything works again. Therefore, it only seems to happen when showing the GUI from another process. Script1: #NoTrayIcon #include <AutoItConstants.au3> #include <TrayConstants.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <StaticConstants.au3> Global $hGUI Opt("TrayMenuMode", 3) Opt("TrayAutoPause", 0) Opt("TrayOnEventMode", 1) TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, 'idGUI') TraySetClick(16) $idGUI = TrayCreateItem("Show GUI") TrayItemSetOnEvent($idGUI, "idGUI") TrayCreateItem("") $idExit = TrayCreateItem('Exit') TrayItemSetOnEvent($idExit, "_Exit") TraySetIcon(@AutoItExe, 1) TraySetToolTip("Show GUI") Example() Func Example() Local $sDefaultstatus = "Ready" $hGUI = GUICreate("My GUI menu", 300, 200) Local $idMnu_File = GUICtrlCreateMenu("&File") Local $idMnu_Help = GUICtrlCreateMenu("Help") Local $idMni_Info = GUICtrlCreateMenuItem("About", $idMnu_Help) Local $idMnu_View = GUICtrlCreateMenu("View", -1, 1) Local $idBtn_Hide = GUICtrlCreateButton("Hide GUI", 50, 130, 70, 20) GUICtrlSetState(-1, $GUI_FOCUS) Local $idBtn_Cancel = GUICtrlCreateButton("Exit", 180, 130, 70, 20) Local $idLbl_Status = GUICtrlCreateLabel($sDefaultstatus, 0, 165, 300, 16, BitOR($SS_SIMPLE, $SS_SUNKEN)) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $idBtn_Hide GUISetState(@SW_HIDE, $hGUI) Case $idBtn_Cancel, $GUI_EVENT_CLOSE ExitLoop Case $idMni_Info MsgBox($MB_SYSTEMMODAL, "Info", "Only a test...") EndSwitch WEnd GUIDelete() EndFunc ;==>Example Func _Exit() Exit EndFunc Func idGUI() ; get GUI window state Local $iState = WinGetState($hGUI) If $iState <> $WIN_STATE_VISIBLE Then GUISetState(@SW_SHOW, $hGUI) EndFunc Script2: #include <WinAPISysWin.au3> ; show and activate the GUI window $hWnd = WinGetHandle("My GUI menu") _WinAPI_ShowWindow($hWnd, @SW_SHOW) _WinAPI_SetForegroundWindow($hWnd) By the way, I have tried all of the other functions such as WinActivate and various WinAPI to show and give focus to the GUI window. They all still work to show the GUI but also still have controls and menu items that fail. Does anyone know why this issue occurs or what I can do to fix it? Thank you for your time.
    1 point
  7. This is really creative. Thanks for sharing. I like how ideas turn into ideas and those ideas turn into more ideas. And now, I think I have some ideas for this technique.
    1 point
  8. Have you tried it? because I think it should be in this order ; from Case $idBtnAbout AboutMe() ; ----------------------------------------------- GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...") ; to GUICtrlSetData($idLabel1, "To copy [" & $aArray[$idx][1] & "]...select [Continue]..." & @CRLF & "Select [Cancel] to exit...") ; ----------------------------------------------- Case $idBtnAbout AboutMe()
    1 point
  9. playing with the idea a little Script1.au3 Script2.au3
    1 point
  10. ...there is also IPC. The code could ask the other code to show itself.
    1 point
  11. Interesting thread indeed. Based on WildByDesign and argumentum scripts, I just kept the minimum code in the following script, to reproduce the issue (no trayitem) 1) First script : we run it and click the Hide button => the gui is hidden ; ; 1st script : click button to hide the gui #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $hGUI = GUICreate("My GUI menu", 300, 200) Local $idMnu_File = GUICtrlCreateMenu("&File") Local $idMnu_Help = GUICtrlCreateMenu("Help") Local $idMni_Info = GUICtrlCreateMenuItem("About", $idMnu_Help) Local $idMnu_View = GUICtrlCreateMenu("View", -1, 1) Local $idBtn_Hide = GUICtrlCreateButton("Hide GUI", 50, 130, 70, 20) GUICtrlSetState(-1, $GUI_FOCUS) Local $idBtn_Cancel = GUICtrlCreateButton("Exit", 180, 130, 70, 20) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $idBtn_Hide ; watch out, another script won't be able to activate correctly the hidden GUI if GUISetState is used here. GUISetState(@SW_HIDE, $hGUI) ; <=============================== ; another script will be able to activate correctly the hidden GUI if WinSetState is used here. ; WinSetState($hGUI, "", @SW_HIDE) ; <========================= Case $idBtn_Cancel, $GUI_EVENT_CLOSE ExitLoop Case $idMni_Info MsgBox($MB_TOPMOST, "Info", "Only a test...") EndSwitch WEnd GUIDelete() EndFunc ;==>Example 2) Second script : we run it and the gui reappears, but its controls/menu don't respond : ; 2nd script : show & activate the hidden GUI #include <WinAPISysWin.au3> ; show and activate the GUI window . Watch out: controls won't react if the GUI was hidden using GUISetState in the 1st script Local $hWnd = WinGetHandle("My GUI menu") _WinAPI_ShowWindow($hWnd, @SW_SHOW) _WinAPI_SetForegroundWindow($hWnd) As argumentum suggested (thanks !) everything works fine if we use in the 1st script WinSetState (instead of GuiSetState) to hide the GUI @Melba23 wrote comments about it in this post. Dear Melba, in case you have some free time, could you please share your opinion about this, e.g. the fact that we need to use WinSetState in the 1st script (which isn't recommended when working with GUI's) because the hidden GUI needs to be shown/activated by an external script ? Thanks
    1 point
  12. So while this part worked and fixed the problem, it had an unexpected side effect of causing the controls on the GUI to have a delay in showing them. Even with the tiny example with only two buttons. Same with my project. The GUI shows immediately and the controls have a delayed load which is unusual. But I found another method that shows the GUI and controls instantly. Func idGUI() ; get GUI window state If Not BitAND(WinGetState($hGUI), $WIN_STATE_VISIBLE) Then _WinAPI_ShowWindow($hGUI, @SW_SHOW) EndFunc I have no idea why WinSetState has such a delay with showing the controls while _WinAPI_ShowWindow does not have the delay. But that is what I love about having so many options; so many different methods to achieve the same thing.
    1 point
  13. I am sure he's happy after 5 years!!! 😉
    1 point
×
×
  • Create New...