Jump to content

child gui minimized to tray


Go to solution Solved by KaFu,

Recommended Posts

Hi,

I have a gui with a child gui, when I minimize the gui to tray and go with the mouse over the icon only the main gui is visible.
Is there a way to see the Main and Child gui?

 

image.png.f50b6c51facdc1d95a5eb7f5840080e3.png

 

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>


$hGUI = GUICreate("Test", 500, 500, -1, -1)
GUISetState()

; Create child GUI
$hChild = GUICreate("", 400, 200, 50, 150, $WS_POPUP, $WS_EX_MDICHILD, $hGUI)
GUISetBkColor(0xff0000, $hChild)
GUICtrlCreateLabel("CHILD", 0, 0, 400, 220, BitOR($SS_CENTER, $SS_CENTERIMAGE))
GUICtrlSetFont(-1, 50)
GUISetState()


While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd
Edited by bladem2003
Link to comment
Share on other sites

  • Solution

You can do that with labels too.

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WinAPISysWin.au3>


Run("notepad.exe","",@SW_HIDE)
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

$hGUI = GUICreate("Test", 500, 500, -1, -1)

$c_Label = GUICtrlCreateLabel("CHILD", 50, 150, 400, 220, $WS_CLIPCHILDREN)
_WinAPI_SetParent($hWnd, GUICtrlGetHandle($c_Label))
WinMove($hWnd,"",0,0,400,220)
GUISetState()
WinSetState($hWnd,"",@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

 

Link to comment
Share on other sites

1 hour ago, KaFu said:

You can do that with labels too.

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WinAPISysWin.au3>


Run("notepad.exe","",@SW_HIDE)
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

$hGUI = GUICreate("Test", 500, 500, -1, -1)

$c_Label = GUICtrlCreateLabel("CHILD", 50, 150, 400, 220, $WS_CLIPCHILDREN)
_WinAPI_SetParent($hWnd, GUICtrlGetHandle($c_Label))
WinMove($hWnd,"",0,0,400,220)
GUISetState()
WinSetState($hWnd,"",@SW_SHOW)


While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

 

👍

thanks for the solution.

 

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...