supraspecies Posted September 26, 2015 Share Posted September 26, 2015 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. Link to comment Share on other sites More sharing options...
TLM Posted September 26, 2015 Share Posted September 26, 2015 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 hideWinSetTrans("Configuration Utility v1.1.38.0", "", 0) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 26, 2015 Moderators Share Posted September 26, 2015 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 Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
TLM Posted September 26, 2015 Share Posted September 26, 2015 (edited) <snip>Thank you ! i am new for this. Edited September 26, 2015 by Melba23 Quote removed - again! Link to comment Share on other sites More sharing options...
jguinch Posted September 26, 2015 Share Posted September 26, 2015 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) Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Danyfirex Posted September 26, 2015 Share Posted September 26, 2015 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 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
supraspecies Posted September 26, 2015 Author Share Posted September 26, 2015 (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 September 26, 2015 by supraspecies Link to comment Share on other sites More sharing options...
jguinch Posted September 26, 2015 Share Posted September 26, 2015 (edited) It should work with WinSetState. Can you show your code ? Edited September 26, 2015 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
supraspecies Posted September 27, 2015 Author Share Posted September 27, 2015 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. 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