Command to minimize the program window to the tray - Forum

Forum Navigation
You need to log in to create posts and topics.

Command to minimize the program window to the tray

Good day to you all!
I need to make a button to minimize the application to the tray, but not to use the regular minimize button.
What command should I use to do this?
Respectively, what command should I use to restore the program window?

fkapnist has reacted to this post.
fkapnist

@leopold

SetVar "[WindowState]" "Minimized"

.The display state of the publication window (Normal, Minimized or Maximized)

https://winhelp.visualneo.com/Actions.html

 

luishp and fkapnist have reacted to this post.
luishpfkapnist

In the App Properties (Size/Color/Type) You can make your Application Type a "System Tray Application (EXE)."

Open it in normal or maximized state from the startup. Then when it is minimized, it will go to the system tray.

 

To restore it, click on its icon in the system tray.

 

 

Colleagues, thank you!
SetVar "[WindowState]" "Minimized"
worked very well for the task

But why doesn't the state of the variable change in the debugger when minimizing and maximizing the window?
There are no events in the Variables tab at all, although the global variable changes its value when minimizing/restoring the window.

Quote from leopold on September 20, 2022, 8:19 pm

But why doesn't the state of the variable change in the debugger when minimizing and maximizing the window?
There are no events in the Variables tab at all, although the global variable changes its value when minimizing/restoring the window.

Just create a local (author defined) variable from the global one

SetVar "[MyWindowState]" "[WindowState]"

You will then see MyWindowState in your debugger variable list with either normal, minimized, maximized

...................................

 

Actually, you're right.

The windows state variable is always Normal in the debugger, no matter what. I don't know why

........

It does work

if you put

SetVar "[MyWindowState]" "[WindowState]"

in the "App Properties>Actions>Resized" tab