Jump to content

$WS_EX_MDICHILD bug


 Share

Go to solution Solved by Melba23,

Recommended Posts

Melba23,

its stays open for if you want to click it a second time.

did you maximize the child window and then restored it?

On my computer that seems to be a problem, i wish i could show you this is a more direct way..

here are some screenshots i made:

https://drive.google.com/file/d/0B6ErMbcSk-fWemJ2R1lnOHRUUUk/view?usp=sharing

https://drive.google.com/file/d/0B6ErMbcSk-fWYnlsaWJZNE5lRHc/view?usp=sharing

https://drive.google.com/file/d/0B6ErMbcSk-fWUGp1M25abTFvMWM/view?usp=sharing

https://drive.google.com/file/d/0B6ErMbcSk-fWNl9XMU5jZXBxY00/view?usp=sharing

TheAutomator

Link to comment
Share on other sites

  • Moderators

TheAutomator,

I see it. I do not use background images in my GUIs - they cause too many problems, as you are discovering. So I cannot really help any more - sorry. :(

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 5 years later...
On 2/2/2015 at 5:02 PM, Melba23 said:

TheAutomator,

I see it. I do not use background images in my GUIs - they cause too many problems, as you are discovering. So I cannot really help any more - sorry. :(

M23

Hi Melba23 & TheAutomator
I just read the long discussion between both of you in this old thread and resurrected it because a simple solution seems to work, it could be helpful for anyone facing the same situation.

Based on the last script posted by TheAutomator (at the very bottom of the precedent page), I added the $WS_EX_COMPOSITED extended style to the parent window and it seems to solve the issues described above by TheAutomator

Please remember to place a pic (named test.jpg) inside the same folder than the script, it will be the parent GUI background image.

#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinApi.au3>

$SCREEN = GUICreate('TEST FORM 1', 600, 400, -1, -1, -1, $WS_EX_COMPOSITED)
    GUISetBkColor(0x000000)

$IMAGE = GUICtrlCreatePic('test.jpg', 0, 0, 600, 370)
    GUICtrlSetState(-1, $GUI_DISABLE)

$NEW = GUICtrlCreateButton('NEW', 0, 370, 60, 30)
    GUICtrlSetCursor(-1, 0)

$LST = GUICtrlCreateList('NEW FORM', 0, 190, 120, 200, $WS_BORDER)
    GUICtrlSetData(-1, 'EXIT')
    GUICtrlSetFont(-1, 8, 400, 0, 'System')
    GUICtrlSetColor(-1, 0x00FF00)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetState(-1, $GUI_HIDE)

$INP = GUICtrlCreateInput('TESTING...', 460, 372, 100, 28, BitOR($ES_CENTER, $ES_UPPERCASE, $ES_READONLY))
    GUICtrlSetFont(-1, 12, 400, 0, 'MS Sans Serif')
    GUICtrlSetColor(-1, 0x00FF00)
    GUICtrlSetBkColor(-1, 0x000000)
    GUICtrlSetCursor (-1, 2)

GUISetState(@SW_SHOW)

While True
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

        Case $NEW
            If BitAND(GUICtrlGetState($LST), $GUI_HIDE) = $GUI_HIDE Then
                GUICtrlSetState($LST, $GUI_SHOW + $GUI_ONTOP)
            Else
                GUICtrlSetState($LST, $GUI_HIDE)
            EndIf

        Case $LST
            Switch GUICtrlRead($LST)
                Case 'EXIT'
                    Exit

                Case 'NEW FORM'
                    GUICtrlSetState($LST, $GUI_HIDE)
                    $hNew_Child = GUICreate("Child", 300, 300, 10, 0, $WS_OVERLAPPEDWINDOW, -1, $SCREEN)
                    GUICtrlCreateCheckbox('Filler 1', 10, 10, 120, 25)
                    _WinAPI_SetParent($hNew_Child, $screen)
                    GUISetState()
            EndSwitch

    EndSwitch
WEnd

Some additional changes :
* Clicking the "New" button displays the list on top (added ...+ $GUI_ONTOP)
* Clicking 'NEW FORM' in the list hides the list (leaving the New button always visible, as requested by OP)
* Child window style changed to $WS_OVERLAPPEDWINDOW, which contains all we need.

Edited by pixelsearch
description of additional changes
Link to comment
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
 Share

×
×
  • Create New...