Jump to content

Child GUI appear before Parent GUI after maximize or minimize the Parent GUI

Recommended Posts



While i am maximize or minimize the parent GUI, the child GUI appeared before the parent GUI (0.5 seconds before).

I think it's related to the following line:

$ChildHotFolder = GUICreate("Hot Folder",480, 120, 0, -1,$WS_POPUP,$WS_EX_MDICHILD,$MainHotFolder)

Please help me here :)

this is the code:

#include <AutoItConstants.au3>
#include <MsgBoxConstants.au3>
#include <FileConstants.au3>
#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#Include "UDF\CompareImagesUDF.au3"
#Include "UDF\LogUDF.au3"
#Include "UDF\InitializationUDF.au3"
#Include "UDF\LoadingUDF.au3"
#include <File.au3>
#include <Array.au3>

Global $Reset = 0; Last GUI state
Global $MainHotFolder ;Main GUI
Global $ChildHotFolder ;Child GUI
Global $vBasic ;Basic hot folder menu
Global $vNaming ;Naming convention menu
Global $vOpen ;vBasic menu item
Global $vClose ;vBasic menu item
Global $SelectFolder ;Select hot folder button
Global $SelectFiles ;Select files button
Global $Verification ;Verification button
Global $Input1 ;Hot folder state old\new
Global $Input2 ;Files state old\new
Global $Input3 ;Verification passed\failed
Global $Input4 ;Hot folder directory
Global $HotFolder = "" ;This variable holds hot folder directory - Display HotFolder.
Global $HotFolderFiles ;This variable holds hot folder files - HotFolder Verification.
DriveMapAdd ("x:", "\\srv2k8\kornit") ;Enable the option to add network based hot folder.


Func Menu()

   Opt("GUIOnEventMode", 1)
   $MainHotFolder = GUICreate("Main Hot Folder", 500, 500, -1, -1,-1)
   GUISetOnEvent($GUI_EVENT_CLOSE, "Stop")
   $vBasic = GUICtrlCreateMenu("BasicHotFolder")
   $vNaming = GUICtrlCreateMenu("NamingConvention")
   $vOpen = GUICtrlCreateMenuItem("OpenMenu",$vBasic)
   $vClose = GUICtrlCreateMenuItem("CloseMenu",$vBasic)
   GUICtrlSetState ( $vClose, $GUI_DISABLE)
   GUISetState(@SW_SHOW, $MainHotFolder)

   While 1


Func OpenBasicGUI()

   GUICtrlSetState ( $vOpen, $GUI_DISABLE) ;Basic GUI opened so grade-out this option.
   if $Reset = 0 then

      Opt("GUIOnEventMode", 1)
      $ChildHotFolder = GUICreate("Hot Folder",480, 120, 0, -1,$WS_POPUP,$WS_EX_MDICHILD,$MainHotFolder)
      GUISetOnEvent($GUI_EVENT_CLOSE, "Stop")
      $SelectFolder = GUICtrlCreateButton("Select Hot Folder - MC",0, 26, 120, 25) ;Select hot folder and update machine config.
      GUICtrlSetOnEvent($SelectFolder, "Folder")
      $SelectFiles = GUICtrlCreateButton("Load Files", 120, 26, 120, 25) ;Select files for hot folder.
      GUICtrlSetOnEvent($SelectFiles, "SelectFiles")
      $Verification = GUICtrlCreateButton("Verificaion", 240, 26, 120, 25) ;Verify a full matching between hot folder directory and hot folder working files.
      GUICtrlSetOnEvent($Verification, "Verification")
      $NoKSF = GUICtrlCreateButton("No KSF Test",0, 73, 120, 25) ;Verify a proper message appear for no KSF scenario.
      GUICtrlSetOnEvent($NoKSF, "")
      $Input1 = GUICtrlCreateInput("", 1, 52, 118, 20,0x0001)
      $Input2 = GUICtrlCreateInput("", 121, 52, 118, 20,0x0001)
      $Input3 = GUICtrlCreateInput("", 241, 52, 118, 20,0x0001)
      $Input4 = GUICtrlCreateInput("Current HotFolder = Unknown", 1, 3, 358, 22,0x0001)
      $Input5 = GUICtrlCreateInput("", 1, 99, 118, 20,0x0001)
      GUICtrlSetState ( $Input1, $GUI_DISABLE)
      GUICtrlSetState ( $Input2, $GUI_DISABLE)
      GUICtrlSetState ( $Input3, $GUI_DISABLE)
      GUICtrlSetState ( $Input4, $GUI_DISABLE)
      GUICtrlSetState ( $Input5, $GUI_DISABLE)
      $HotFolder = "" ;This variable holds hot folder directory - Display HotFolder.
      $HotFolderFiles ;This variable holds hot folder files - HotFolder Verification.
      GUISetState(@SW_SHOW, $ChildHotFolder)
      GUICtrlSetState ( $vClose, $GUI_Enable)


      GUISetState(@SW_SHOW, $ChildHotFolder)
      GUICtrlSetState ( $vClose, $GUI_Enable)


   $Reset = 1;



Edited by JLogan3o13
Added Code Tags

Share this post

Link to post
Share on other sites

@Amichai welcome to the forum. In the future, please use code tags (the <> icon in your task bar) when posting code. Makes it much easier to read :)

√-1 2^3 ∑ π, and it was delicious!

Share this post

Link to post
Share on other sites

@Amichai, in the future try to post a runnable reproducer - your script contains references to external UDF's and ommitted functions, so it is not easy for us to help you - and it's not our job either.

for your issue - you may want to consider WinSetTrans(). use it to set the transparency of the child GUI to 0 (=invisible) before maximize/minimize/restore, and once that operation is complete, set it to 255 (=solid). i use this method successfully whenever the Windows minimize animation gets on my nerves... ;)

  • Like 1

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


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.