Sign in to follow this  
Followers 0
s0urce

Hidden Windows in Windows 10

7 posts in this topic

Hello folks,

I try to set the window state of 3th party windows (win32 gui) to "@SW_HIDE". This seems not to work properly in windows 10. The window is hidden, but it is still visible in the windows bar. If I click on it, nothing happens. Thx for some infos.

Br, s0urce

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

What's the Windows bar, the Windows taskbar, the Titlebar from window?  What's the name from 3th paty app?

Thx for more infos.

 

 

Edited by AutoBert

Share this post


Link to post
Share on other sites

Yeah, the Windows taskbar. The app is an selfwritten one. Delphi compile to exe.

Share this post


Link to post
Share on other sites

You hided the wrong window. Delphi uses a Form for Project, and the hided one is the Child of this Project.

Share this post


Link to post
Share on other sites
3 hours ago, AutoBert said:

You hided the wrong window. Delphi uses a Form for Project, and the hided one is the Child of this Project.

Oh, good to know, thank you very much. Do you maybe have a solution to hide the parent "process"? I found this option "_WinAPI_GetParentProcess(WinGetProcess($title))" to get a parent process, but I found no way to hide a window with it's pid.

Share this post


Link to post
Share on other sites

_WinAPI_GetWindowLong($hWnd3thParty, $GWL_HWNDPARENT) should help. It returns the needed WindowHandle from Parentwindow. 

1 person likes this

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thank you AutoBert, this was the solution. Here is my ready function, maybe someone else looking for this:

#include <WinAPI.au3>

func _WinAndParentSetState($title,$state)
  $childHandle=WinGetHandle($title)
  $parentLong=_WinAPI_GetWindowLong($childHandle,$GWL_HWNDPARENT)
  $parentHandle=HWnd($parentLong)
  WinSetState($parentHandle,'',$state)
  WinSetState($childHandle,'',$state)
endfunc
Edited by s0urce

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
Sign in to follow this  
Followers 0

  • Similar Content

    • therks
      By therks
      As the title says, does anyone know of a way to open the Windows 10 action center using AutoIt. Maybe via rundll or some other applet?
      My intention is to just hide the normal icon, then have an AutoIt system tray icon that will open the action center on click. And I can't just send the Win+A hotkey because I have it disabled. 
      Thanks for reading.
    • TMelanson
      By TMelanson
      Hi folks,
      I'm hoping someone can help me out here.
      Background:
      I have the need to run a program with admin credentials (#RequireAdmin), and then get the SID of the locally logged in account. Not the admin account.
      If you look at the attached script, Line 16 uses the @UserName variable and returns the SID for the admin account I used to launch the app.
      I want to use line 17 which passes the result of the _GetUsername function which is a username using  ($UserName) to the WMIService.
      I'm getting " The requested action with this object has failed.:" error message.
      Any suggestions would be appreciated!
       
      test1.au3
    • onlineth
      By onlineth
      I’m wondering how to add a Windows Hello option to the additional PIN, Fingerprint, and Facial Recognition options? I'd like an interface that could be linked to the Windows Hello authentication system and AutoIt itself.
      I understand that this discussion did not meet the Forum Rules, I apologize about that. I'd like to point out that this post is asking for a way to attach into the Windows Hello service. I'd like to follow the same concept that YubiKey's interact with Windows Hello as seen here: https://www.yubico.com/2016/09/yubikey-works-windows-hello/.
    • afallenhope
      By afallenhope
      Hello all! 
      I am having a bit of trouble and was wondering if anyone may have a workaround for my issue. I made a script that would automatically install a piece of software each night on a Windows 7 Box. Now I have been instructed to do the same with a Windows 10 box since the application is now being tested on Windows 10. 
      The way I did the win7 installation was that I made a script and then made an executable that I call with a batch file along with the Installer. So the process is 
      AutoitMainFile calls batch file, batch file opens Installer, and the automatedinstaller.exe  The automatedinstlaller waits 10-20 seconds to make sure the Installer has been fully loaded.
      When I try to do the same both get loaded but the automatedinstallation.exe does not send commands to the installer. The code does work and nothing from the program we are wanting to install has changed as our Windows 7 runs every night no problem. 
       
      Do I need to make a new automatedinstall script for windows 10? 
      Any advice is appreciated 
      Thanks,
      Richard
    • Mbee
      By Mbee
      One of my GUI applications requires that a particular third-party application not only be running, but be present in the "sys tray" (aka Taskbar). When this 3p app is active but not in the systray/taskbar, it is not ready for proper use, and I must inform the user about this.
      Here is a code snippet that used to work fine under Windows 7:
      ; ; #FUNCTION# ========================================================================================================= ; Name...........: _Get_Systray_BtnIndex ; Description ...: Determines if an appllication with the specified title is running in the Systen Tray ; and if so, returns the relative index number of it's button on the tray. ; Syntax.........: _Get_Systray_BtnIndex($iTitleText) ; Parameters ....: $iTitleText -> The (tool-tip) title of the desired application ; Return values .: Success - Returns the index number of the desired appliction button, 1 being the first ; Failure - Returns 0 if desired application is not found in the System Tray ; Sets @error as follows: ; 0: Normal return ; -1: System Tray was empty (i.e., no appllications running the tray) ; -2: No System Tray was found ; Remarks .......; Setting any parameter to -1 leaves the current value unchanged ; Setting the $iStyle parameter to 'Default' resets ALL parameters to default values <<<<<<<<<<<<<<<<<<<<<<< ; Setting any other parameter to "Default" only resets that parameter ; Author ........: Poster "war59312", and code was found at URL: ; http://www.autoitscript.com/forum/topic/40550-check-if-program-is-running-under-system-tray/#entry902746 ; Modified by mjb on 26-June-2014 to return @extended error code rather than using MsgBox() to report errors. ; Func _Get_Systray_BtnIndex($sToolTipTitle) ; Find systray handle Local $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then Return SetError( -2, 0, 0 ) EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then Return SetError( -1, 0 , 0 ) EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) > 0 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Desired application is NOT running in the System Tray Else Return $iSystray_ButtonNumber ; Application was found in the SysTray EndIf EndFunc ;==> _Get_Systray_BtnIndex ;  
      But what's happening under Windows 10 is that the "_GUICtrlToolbar_ButtonCount()" always returns 1, even though there are 10-14 items visible in the Task Bar.  Unsurprisingly, the single item returned has nothing to do with the 3'rd party application in question.
      As you probably know, Microsoft made significant changes to the systray/taskbar since Windows 7 (or at least by Windows 10). I spent quite a while searching MSDN for some other way to accomplish what I need, but I must be too stupid to figure it out.
      Please help.   Thanks!