DannyJ Posted August 8, 2019 Share Posted August 8, 2019 Hello Auto It Forum. I want to minimalize my program to Windows Taskbar if I press a Button, then my program does something and reactivate my window. (What I mean Taskbar: https://support.microsoft.com/en-us/help/29280/windows-10-how-to-use-the-taskbar) My Example code which is works perfectly but it puts the script to the script to the pin bar instead of the of the task bar: expandcollapse popupHotKeySet("{Ins}", "ShowGUI") HotKeySet("{esc}", "_Exit") #include <Misc.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Clipboard.au3> #Region Contents ;; which data is contained in the button and assigned into the clipboard Global $clip1 = "Clip 1" Global $clip2 = "Clip 2" Global $clip3 = "Clip 3" #EndRegion Contents #Region gui ;; creates gui Global $Show = False Global $Form1 = GUICreate("Clipboard Copier", 322, 146, 238, 287) Global $Button1 = GUICtrlCreateButton($clip1, 16, 16, 283, 25) Global $Button2 = GUICtrlCreateButton($clip2, 16, 56, 283, 25) Global $Button3 = GUICtrlCreateButton($clip3, 16, 96, 283, 25) #EndRegion gui #Region loop ;; inputs data into clipboard according to button pressed, minimises to tray after pressing button/minimise and hides from taskbar Local $hDLL = DllOpen("user32.dll") Sleep(1000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $vdata = $clip1 _ClipBoard_SetData($vdata) $Show = Not $Show GUISetState($Show, $Form1) Case $Button2 $vdata = $clip2 _ClipBoard_SetData($vdata) $Show = Not $Show GUISetState($Show, $Form1) Case $Button3 $vdata = $clip3 _ClipBoard_SetData($vdata) $Show = Not $Show GUISetState($Show, $Form1) Case $GUI_EVENT_MINIMIZE $Show = Not $Show GUISetState($Show, $Form1) DllClose($hDLL) EndSwitch WEnd #EndRegion loop #Region Functions ;; Makes Insert key minimize to tray, while hiding from taskbar, and set Esc to close program Func ShowGUI() $Show = Not $Show GUISetState($Show, $Form1) EndFunc ;==>ShowGUI Func _Exit() Exit EndFunc ;==>_Exit #EndRegion Functions Link to comment Share on other sites More sharing options...
Developers Jos Posted August 8, 2019 Developers Share Posted August 8, 2019 Moved to the appropriate forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Nine Posted August 8, 2019 Share Posted August 8, 2019 Instead of using a bool $Show, use macro @SW_RESTORE and @SW_MINIMIZE DannyJ 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
DannyJ Posted August 9, 2019 Author Share Posted August 9, 2019 Thank you very much 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