Modify

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#184 closed Bug (No Bug)

Child window must use GUICtrlSetTip() if the parent uses it too

Reported by: MsCreatoR <mscreator@…> Owned by:
Milestone: Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: child GUICtrlSetTip Cc:

Description

Forum link...

When the parent window have GUICtrlSetTip() for at least one control, then the child window must have it as well, otherwise when we reactivate the app, we can see only the child window.


Reproduction:

Run example bellow, activate some other window (not the desktop), and activate the GUI back (by clicking on the button on tasks panel), you will see only the child window.

#include <GuiConstants.au3>

$GUI = GUICreate("Test Script", 300, 200)
GUICtrlCreateButton("Button", 20, 40, 60, 20)
GUICtrlSetTip(-1, "TipText")
GUISetState(@SW_SHOW, $GUI)


GUISetState(@SW_DISABLE, $GUI)
$Child_GUI = GUICreate("Child", 200, 120, -1, -1, -1, -1, $GUI)
;GUICtrlCreateLabel("Label", -99, -99)
;GUICtrlSetTip(-1, "Child TipText")
GUISetState(@SW_SHOW, $Child_GUI)

While 1
    $nMsg = GUIGetMsg(1)
    Switch $nMsg[0]
        Case $GUI_EVENT_CLOSE
            If $nMsg[1] = $GUI Then Exit
            
            GUISetState(@SW_ENABLE, $GUI)
            GUIDelete($Child_GUI)
    EndSwitch
WEnd

If you uncomment two lines in the code, this "effect" is gone...


Tested with AutoIt v3.2.8.1/3.2.10.0.

Thanks.

Attachments (0)

Change History (5)

comment:1 by J-Paul Mesnage, 18 years ago

For be when you reactivated the 2 windows reappear at least under Vista/Sp1.
Back to your problem the tip is associated to a control/window so that normal if the window is not activated the tip cannot appear

comment:2 by J-Paul Mesnage, 18 years ago

Resolution: No Bug
Status: newclosed

comment:3 by MsCreatoR <mscreator@…>, 18 years ago

I use Win XP SP2.
But the problem is not only with GUI child window (where i can use a workaround as i shown in the example), if i use system MsgBox as a child (via DllCall with Hwnd parameter), i have no other way to "fix" this behaviour :( I can not set tip for that child window... or can i?

comment:4 by J-Paul Mesnage, 18 years ago

Are you saying that the commented lines does not work on the child window.

in reply to:  4 comment:5 by MsCreatoR <mscreator@…>, 18 years ago

Replying to Jpm:

Are you saying that the commented lines does not work on the child window.

They work with custom created GUI child window, what i am saying, is that this method will not work with MsgBox, because i can not set tips for his controls.

Here is an example of what i mean:

#include <GuiConstants.au3>

$GUI = GUICreate("Test Script", 300, 200)
GUICtrlCreateButton("Button", 20, 40, 60, 20)
GUICtrlSetTip(-1, "TipText") ;Comment this line, and the problem is gone... but i need to set tips :'(

GUISetState(@SW_SHOW, $GUI)

_MsgBox(64, "", _
	"Now activate some other window (not a desktop), and activate this app again." & @LF & _
	"You will see only this message box...", $GUI)

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

;~ System Message Box Dialog.
Func _MsgBox($MsgBoxType, $MsgBoxTitle, $MsgBoxText, $Main_GUI=0)
	Local $aRet = DllCall("user32.dll", "int", "MessageBox", _
			"hwnd", $Main_GUI, _
			"str", $MsgBoxText, _
			"str", $MsgBoxTitle, _
			"int", $MsgBoxType)
	
	Return $aRet[0]
EndFunc

And still, this behaviour seems to me a little(?) unexpected :(

Modify Ticket

Action
as closed The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.