Jump to content
Sign in to follow this  
Valuater

Not able to have a child window over a picture?

Recommended Posts

in the script below, the main window has a picture... the child window does not show, however if you comment out the pic .... the child window will show

#include <GUIConstants.au3>


$XSkinGui = GUICreate( "My GUI", 400, 450)

; comment out this line and the child window will show
GUICtrlCreatePic(@SystemDir & "\setup.bmp", 0,0, 400, 450)
GUICtrlSetState( -1, $GUI_DISABLE)

GUISetState()

$XClose = XSkinCloseButton($XSkinGui,1)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $XClose Then Exit
    
    
    Sleep(10)
WEnd

Func XSkinCloseButton($XS_hWin,$XS_cH = 1)
    If $XS_hWin = "" Then Return
    Local $XS_Choice, $XS_win, $XS_Pos = 20, $XSPos 
    $XSPos = WinGetPos($XS_hWin)
    $XS_Choice = StringSplit("215,324,221,217,112", ",")
    If $XS_cH > $XS_Choice[0] Then Return
    $XS_winA = GUICreate("", $XS_Pos, $XS_Pos, $XSPos[2] - $XS_Pos * 3, $XS_Pos * 3, $WS_CHILD, $WS_EX_TOPMOST , $XS_hWin) 
    $XS_winB = GUICtrlCreateButton("", 0, 0, $XS_Pos, $XS_Pos, $BS_ICON, $WS_EX_TOPMOST )
    GUICtrlSetImage (-1, "shell32.dll", $XS_Choice[$XS_cH])
    GUISetState()
    Return $XS_winB

EndFunc

is this a bug,,, or normal

thx

8)

Share this post


Link to post
Share on other sites

I tried adding in $WS_POPUP didn't work, this is the only way I've been able to get all to show.

#include <GUIConstants.au3>

$XSkinGui = GUICreate("My GUI", 400, 450)

$BUTTON = GUICtrlCreateButton('TEST', 10, 10, 90, 20)

GUISetState()

$XClose = XSkinCloseButton($XSkinGui, 1)

GUISwitch($XSkinGui)
GUICtrlCreatePic(@SystemDir & "\setup.bmp", 0, 0, 400, 450)
; comment out this line and the child window will show
;~ GUICtrlSetState( -1, $GUI_DISABLE)


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $XClose Or $msg = -3
            Exit
        Case $msg = $BUTTON
            ConsoleWrite("BUTTON TEST" & @LF)
    EndSelect
WEnd

Func XSkinCloseButton($XS_hWin, $XS_cH = 1)
    If $XS_hWin = "" Then Return
    Local $XS_Choice, $XS_win, $XS_Pos = 20, $XSPos
    $XSPos = WinGetPos($XS_hWin)
    $XS_Choice = StringSplit("215,324,221,217,112", ",")
    If $XS_cH > $XS_Choice[0] Then Return
    $XS_winA = GUICreate("", $XS_Pos, $XS_Pos, $XSPos[2] - $XS_Pos * 3, $XS_Pos * 3, $WS_CHILD, $WS_EX_TOPMOST, $XS_hWin)
    $XS_winB = GUICtrlCreateButton("", 0, 0, $XS_Pos, $XS_Pos, $BS_ICON, $WS_EX_TOPMOST)
    GUICtrlSetImage(-1, "shell32.dll", $XS_Choice[$XS_cH])
    GUISetState()
    Return $XS_winB

EndFunc   ;==>XSkinCloseButton
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

add $WS_POPUP to your functions GUICreate()

LAr.

I seen your other post too

#include <GUIConstants.au3>

#include <WindowsConstants.au3>

$win1 = GUICreate("test",400,400,-1,-1,BitOR($WS_SIZEBOX,$WS_POPUP))
GUICtrlCreateLabel("",0,0,400,24)

GUICtrlSetBkColor(-1,0x0000FF)
GUISetState()
$XClose = XSkinCloseButton($win1,1)
Sleep(3000)

;Exit

$XSkinGui = GUICreate( "My GUI", 400, 450, -1,-1,BitOR($WS_SIZEBOX,$WS_POPUP))

; comment out this line and the child window will show
GUICtrlCreatePic(@SystemDir & "\setup.bmp", 0,0, 400, 450)
GUICtrlSetState( -1, $GUI_DISABLE)

GUISetState()

$XClose = XSkinCloseButton($XSkinGui,1)

While 1
    $msg = GUIGetMsg()
    
    If $msg = $XClose Then Exit
    
    
    Sleep(10)
WEnd

Func XSkinCloseButton($XS_hWin,$XS_cH = 1)
    If $XS_hWin = "" Then Return
    Local $XS_Choice, $XS_win, $XS_Pos = 20, $XSPos 
    $XSPos = WinGetPos($XS_hWin)
    $XS_Choice = StringSplit("215,324,221,217,112", ",")
    If $XS_cH > $XS_Choice[0] Then Return
    $XS_winA = GUICreate("", $XS_Pos, $XS_Pos, $XSPos[2] - $XS_Pos,10, $WS_CHILD, $WS_EX_TOPMOST , $XS_hWin) 
    $XS_winB = GUICtrlCreateButton("", 0, 0, $XS_Pos, $XS_Pos, $BS_ICON, $WS_EX_TOPMOST )
    GUICtrlSetImage (-1, "shell32.dll", $XS_Choice[$XS_cH])
    GUISetState()
    Return $XS_winB

EndFunc

I tried every way i could think of...

for the child with and without BitOr( child, popup ) and main with and withoutBitOr( sizebox, popup )

????

8)

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
Sign in to follow this  

×
×
  • Create New...