supraspecies

Hiding the window as quick, as possible

9 posts in this topic

I am currently hiding a configuration interface of a program as I don't want to have users changing the settings I have pre-set. Launching the program with @sw_hide doesn't do the trick, so I have to hide the window after it appears. I know I can use WinSetState, but it flashes the window for a brief second before it hides it, which I don't like (yes, I'm picky).

I found another way of hiding a window, which works considerably faster. And that is:

WinMove('Configuration Utility v1.1.38.0', '', @DesktopWidth, 10)

However, my question is - how reliable is this? From what I gather, this moves the window 10 pixels away from the edge of the screen. Alright. But what if the user has multiple screens? Will configuration window pop up on the second screen? So if this code isn't very reliable, can someone correct it accordingly? Or maybe it's better to use @DesktopHeight?

 

Thank you.

Share this post


Link to post
Share on other sites



I am currently hiding a configuration interface of a program as I don't want to have users changing the settings I have pre-set. Launching the program with @sw_hide doesn't do the trick, so I have to hide the window after it appears. I know I can use WinSetState, but it flashes the window for a brief second before it hides it, which I don't like (yes, I'm picky).

I found another way of hiding a window, which works considerably faster. And that is:

WinMove('Configuration Utility v1.1.38.0', '', @DesktopWidth, 10)

However, my question is - how reliable is this? From what I gather, this moves the window 10 pixels away from the edge of the screen. Alright. But what if the user has multiple screens? Will configuration window pop up on the second screen? So if this code isn't very reliable, can someone correct it accordingly? Or maybe it's better to use @DesktopHeight?

 

Thank you.

You can change transparent value to zero then the window will hide

WinSetTrans("Configuration Utility v1.1.38.0", "", 0)

Share this post


Link to post
Share on other sites

TLM,

When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - we know what we wrote and it just pads the thread unnecessarily.

And I am not picking on you - just letting you know how the forum works. Nice to see you posting and helping - keep it up.

M23

 


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

<snip>

Thank you ! i am new for this.

Edited by Melba23
Quote removed - again!

Share this post


Link to post
Share on other sites

WinSetTrans seems to be a good way :)

To answer to the OP, you have to retrieve the desktop size and position, and the move the window out of these coords.

This can be done like this (for example) :

#include <WinAPI.au3>

Local $hDesktop = _WinAPI_GetDesktopWindow()
$aDesktopPos = WinGetPos($hDesktop)

WinMove('Configuration Utility v1.1.38.0', '', $aDesktopPos[0] + $aDesktopPos[2] + 20, $aDesktopPos[1] + $aDesktopPos[3] + 20)

 

Share this post


Link to post
Share on other sites

Another option could be to use egisterShellHookWindow to detect WINDOWCREATED event and if match with your window hide. So in all this cases there is always  a flicking.

 

Saludos


 

venezuela.png Would you like to say thank to Danyfirex using a warmy way?  offer me a cup of coffee... coffee.png

autoit_scripter_blue_userbar.png

       AutoIt...

 

 

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thank you for all the replies, I'm considering all options before marking the topic as solved. Found something interesting. Using this:

Opt('WinWaitDelay', 10)
<my code>
Opt('WinWaitDelay', 250)

makes window go away much faster. Now it is almost completely unnoticeable. For some reason it doesn't work with WinSetState though.

Edited by supraspecies

Share this post


Link to post
Share on other sites

Already corrected mistake in the code due to which it wasn't working. I was mostly looking for a way to hide the window faster for aesthetic reasons. Doesn't appear there is one (reducing WinWaitDelay isn't too reliable). Will have to settle for what I've got and just use traditional WinSetState.

Share this post


Link to post
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