Sign in to follow this  
Followers 0
eMac

Odd action in GUI

6 posts in this topic

I have a simple window GUI. It contains the GuiCreate, and a GuiCtrlCreateEdit box with predefined text in it.

When my program first opens, I get the title bar in a light grey, as if my window is not selected, or the parent window, yet, when I click on the title bar, it turns darker like it's active finally. When I click in the Edit section, the title bar goes grey again.

Also noticing that when I first open the program up, ALL the predefined text in the GuiCtrlCreateEdit is HIGHLIGHTED automatically.

Is there a way to make my program (the single window) active on program startup and the text NOT highlight? Making it active when if I click in the edit area?


Codename: Source ProgrammerWhat Is Codename: Source? A community designed operating system based off of the Windows OS. Source brings the ideas of the community to life as each user brings his or her own ideas into the development of this project.

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

#include <GuiConstants.au3>


$Main_GUI = GuiCreate("Changelog (Admin Control Panel)", 400, 350); Width, Height
GuiCtrlCreatePic("logo.gif",0,0,0,0)



_GuiCtrlCreateSeperator(0, 2, 310, 3, 396)
$Exit_Button = GUICtrlCreateButton("Exit", 325, 320, 60)
$version = GuiCtrlCreateLabel("Changelog v1.0.1550", 10, 325, 300, 60)

; CREATE GUI ****************************************************************************
$ChildGui_1 = GuiCreate("Child window 3", 400, 300, 5, 5, $WS_POPUP)
$LabelGui1 = GUICtrlCreateEdit("Version 2.3" & @CRLF & @CRLF & "- Added ""Client Information"" section." _
                                & @CRLF & "- Added Blogs, Classifieds, Forums to ""Manage"" section." _
                                & @CRLF & "- Added top updates section + date + logout feature." _
                                & @CRLF & "- Added version display." _
                                & @CRLF & "- Added cell_bg.gif image to top cell of sections." _
                                & @CRLF & "- Enchanced ""Mystic Blue"" theme." _
                                & @CRLF & "- Fixed moderator console broken images" _
                                & @CRLF & "----------------------------------" _
                                , 0, 100, 390, 290, $SS_SUNKEN, $WS_EX_STATICEDGE+$WS_EX_CLIENTEDGE)

DllCall("user32.dll", "int", "SetParent", "hwnd", $ChildGui_1, "hwnd", $Main_GUI)


GUISetState(@SW_SHOW, $Main_GUI)
GUISetState(@SW_SHOW, $ChildGui_1)

While 1
    $Msg = GUIGetMsg(1)
    Switch $Msg[0]

        Case $GUI_EVENT_CLOSE, $Exit_Button
            If $Msg[0] = $Exit_Button Or _WinIsVisible($ChildGui_1) Then
                $Ask = _MsgBox(256+52, "Attention", "Are you sure you want to exit the changelog now?", $Msg[1])
                If $Ask <> 6 Then ContinueLoop
            EndIf
            
            If $Msg[1] = $Main_GUI Then Exit

            WinActivate($Main_GUI)
    EndSwitch
WEnd


Func _GuiCtrlCreateSeperator($Direction, $Left, $Top, $Width=3, $Lenght=25)
    Switch $Direction
        Case 0
            GUICtrlCreateLabel("", $Left, $Top, $Lenght, $Width, $SS_SUNKEN)
        Case 1
            GUICtrlCreateLabel("", $Left, $Top, $Width, $Lenght, $SS_SUNKEN)
    EndSwitch
EndFunc

Func _MsgBox($MsgBoxType, $MsgBoxTitle, $MsgBoxText, $MainGUI=0)
    Local $iRet = DllCall ("user32.dll", "int", "MessageBox", _
            "hwnd", $MainGUI, _
            "str", $MsgBoxText , _
            "str", $MsgBoxTitle, _
            "int", $MsgBoxType)
    Return $iRet[0]
EndFunc

Func _WinIsVisible($hWnd)
    Return BitAND(WinGetState($hWnd), 2)
EndFunc

Edited by eMac

Codename: Source ProgrammerWhat Is Codename: Source? A community designed operating system based off of the Windows OS. Source brings the ideas of the community to life as each user brings his or her own ideas into the development of this project.

Share this post


Link to post
Share on other sites

Sorry, i don`t understand why need to create two GUI? Just create one GUI with Edit control.

Share this post


Link to post
Share on other sites

because when I am done, it is going to have several more boxes that you will click over on, hiding one gui to show another (like a wizard)

Sorry, i don`t understand why need to create two GUI? Just create one GUI with Edit control.


Codename: Source ProgrammerWhat Is Codename: Source? A community designed operating system based off of the Windows OS. Source brings the ideas of the community to life as each user brings his or her own ideas into the development of this project.

Share this post


Link to post
Share on other sites

because when I am done, it is going to have several more boxes that you will click over on, hiding one gui to show another (like a wizard)

Just disable and hide the uneeded controls... Much easier IMO.

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  
Followers 0