Jump to content

Open GUI to taskbar, not up in screen?


Diana (Cda)
 Share

Recommended Posts

Is there any way to have a standard GUI we create open minimized to the taskbar rather than popping up as per usual in the screen? I'm in a very visual spot in the office and don't really need everyone passing by seeing my reminders, etc., that I control via AI GUIs. All searches I've done give results that deal with minimizing to the taskbar only.

Thanks.

Link to comment
Share on other sites

  • Moderators

Diana (Cda),

That was more difficult than I thought it should be. :graduated:

I am sure that someone else will come up with a better solution, They have see below!!

but until then this should keep your reminders secret until you want to see them: :)

#include <GUIConstantsEx.au3>
 
; Create the GUI off the screen
$hGUI = GUICreate("Test", 500, 500, @DesktopWidth, @DesktopHeight)
 
; It seems we need to show it before...
GUISetState(@SW_SHOW)
; ...we can minimize it to the taskbar
GUISetState(@SW_MINIMIZE)
 
While 1
 
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_RESTORE ; When the GUI is restored
            ; Check its position
            $aPos = WinGetPos($hGUI, "")
            ; If it is still off screen - i.e this is the first restore
            If $aPos[0] = @DesktopWidth And $aPos[1] = @DesktopHeight Then
                ; Then move it onto the screen at the position required
                WinMove($hGUI, "", 100, 100)
            EndIf
    EndSwitch
 
WEnd

As you can see I found that you needed to SHOW the GUI before you could MINIMIZE it to the taskbar - so I created it off-screen. This gives the impression that the taskbar button slides in from the right on my machine. Then when you restore it from the taskbar, the script moves it to where you require. If you move it again and reminimize, then it will restore at the new position.

All clear? ;)

M23

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

seems as good a time as any to bring this up.

you want @SW_SHOWMINIMIZED shown in _WinAPI_ShowWindow

GUISetState(@SW_SHOWMINIMIZED)

these macros should also be listed for GUISetState() in the help file

Edited by rover

I see fascists...

Link to comment
Share on other sites

  • Moderators

rover,

I knew there would be a better way! ;)

M23

Edit: I suggest you post this amendment in the sticky thread in Developer Chat. :graduated:

Edit: I see you have! :)

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...