Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 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 Changed 12 years ago by Jpm

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 Changed 12 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

comment:3 Changed 12 years ago by MsCreatoR <mscreator@…>

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 follow-up: Changed 12 years ago by Jpm

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

comment:5 in reply to: ↑ 4 Changed 12 years ago by MsCreatoR <mscreator@…>

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 :(

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.