Jump to content

Recommended Posts

Posted
13 hours ago, mLipok said:

Could somebody show example when Test 1 result is different from Test 2 ?

 

; Local $hWnd_2 = GUICreate("Window 2", Default, Default, -1, -1, -1, -1, $hWnd_0) ; owned window
Local $hWnd_2 = GUICreate("Window 2", Default, Default, -1, -1, $WS_CHILD, -1, $hWnd_0) ; child window

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted (edited)

For the record, I found a possible issue with the extended style $WS_EX_MDICHILD
Though the window is created with this extended style, its value doesn't appear with AutoIt Window Info Tool or with _WinAPI_GetWindowLong etc...
To make it appear, I need to force it, after the window creation, with _WinAPI_SetWindowLong
Don't know if it's only on my computer or if it can be reproduced on other computers.

Here is an example, just look at the Console after you close the MsgBox :
* First  line indicates 0x00000100 (the forced Exstyle $WS_EX_WINDOWEDGE)
* Second line indicates 0x00000140 ($WS_EX_WINDOWEDGE + $WS_EX_MDICHILD which is 0x00000040)

If you think it is a bug, then I'll create a Trac Ticket with a simpler script than the following :

#include <MsgBoxConstants.au3>
#include <WinAPISysWin.au3>
#include <WindowsConstants.au3>

Opt("MustDeclareVars", 1)

Example()

Func Example()
    Local $hGUI, $hMdiChild

    $hGUI = GUICreate("")
    WinSetTitle($hGUI, "", "GUI  " & $hGUI)
    GuiCtrlCreateLabel("Label in GUI", 200, 0, 90, 20)
    GUICtrlSetBkColor(-1, 0xFFFF00)

    $hMdiChild = GUICreate("", 300, 200, 0, 0, -1, $WS_EX_MDICHILD, $hGUI)
    WinSetTitle($hMdiChild, "", "MdiChild  " & $hMdiChild)
    GuiCtrlCreateLabel("Label in MdiChild", 200, 0, 90, 20)
    GUICtrlSetBkColor(-1, 0x00FFFF)

    GUISetState(@SW_SHOW, $hGUI)
    GUISetState(@SW_SHOW, $hMdiChild)

    MsgBox($MB_TOPMOST, "Parent/Ancestors of MdiChild window "  & $hMdiChild , _
        "Reminder : $hGUI = " & $hGUI & @crlf & _
        "Reminder : $hMdiChild = " & $hMdiChild & @crlf & @crlf & _
        "_WinAPI_GetParent = " & _WinAPI_GetParent($hMdiChild) & " (owner, not parent +++)" & @crlf & @crlf & _
        "_WinAPI_GetAncestor (Parent)   = " & _WinAPI_GetAncestor($hMdiChild, $GA_PARENT) & " (desktop)" & @crlf & _
        "_WinAPI_GetAncestor (Root)     = " & _WinAPI_GetAncestor($hMdiChild, $GA_ROOT) & " (itself)" & @crlf & _
        "_WinAPI_GetAncestor (Owner)  = "   & _WinAPI_GetAncestor($hMdiChild, $GA_ROOTOWNER) & " (gui)")

    ConsoleWrite("1 - ExStyles of $hMdiChild : 0x" & Hex(_WinAPI_GetWindowLong($hMdiChild, $GWL_EXSTYLE), 8) & @crlf)

    _WinAPI_SetWindowLong($hMdiChild, $GWL_EXSTYLE, $WS_EX_MDICHILD)
    ConsoleWrite("2 - ExStyles of $hMdiChild : 0x" & Hex(_WinAPI_GetWindowLong($hMdiChild, $GWL_EXSTYLE), 8) & @crlf)

    Do
    Until GUIGetMsg() = -3

    GuiDelete($hMdiChild)
    GuiDelete($hGUI)
EndFunc   ;==>Example

 

Edited by pixelsearch
typo

"I think you are searching a bug where there is no bug... don't listen to bad advice."

Posted
5 hours ago, jpm said:

Many Thanks I have committed something similar based on wikipedia x11

Looks good @jpm, Thanks very much!

Best regards,

Donny

LibreOffice UDF  

Scite4AutoIt Spell-Checker Using LibreOffice

WPS Office adapter — Use MS Word UDFs with WPS Office!

LibreOffice API Inspector tools

Spoiler

"Life is chiefly made up, not of great sacrifices and wonderful achievements, but of little things. It is oftenest through the little things which seem so unworthy of notice that great good or evil is brought into our lives. It is through our failure to endure the tests that come to us in little things, that the habits are molded, the character misshaped; and when the greater tests come, they find us unready. Only by acting upon principle in the tests of daily life can we acquire power to stand firm and faithful in the most dangerous and most difficult positions."

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
×
×
  • Create New...