Jump to content

Gui resizing issues


Recommended Posts

hello, i am in the process of making my own web browser just for fun and i have come across this problem: when i run the program the window is not all the way maximized (which is what i want) then when i hit the resize button to make it full screen it doesnt change the size of the child gui and i end up with a bunch of space in the parent gui. well

if someone could help me with making the child gui resize when the parent does it would be much apprecaited. heres the code but if you want to see and try it for yourself then then you can download the code and the dll at the bottom of this post.

#include <GuiConstants.au3>

;Creates the parent gui
$gui = GUICreate("MyGUI", 989, 601, (@DesktopWidth - 989) / 2, (@DesktopHeight - 601) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
    $Button_2 = GUICtrlCreateButton("Back", 20, 30, 50, 20)
    $Button_3 = GUICtrlCreateButton("Forward", 80, 30, 50, 20)
    $Button_4 = GUICtrlCreateButton("GO", 810, 30, 40, 20)
    $Combo_5 = GUICtrlCreateCombo("http://www.google.com", 150, 30, 640, 21)
    $Progress_6 = GUICtrlCreateProgress(840, 580, 70, 15)
    $Date_8 = GUICtrlCreateDate("Date7", 20, 580, 200, 20)
    $pic = GUICtrlCreatePic("C:\Documents and Settings\boy wonder\My Documents\My Pictures\intercurve3.GIF", 890, 5, 40, 53)
        GUISetState()

;creates the child gui that the dll will be held in.
$internetgui = GUICreate("", 970, 515, 10, 60, $WS_CHILD + $WS_BORDER, "", $gui)
    GUISetState()

;opens dll then calls it.
$dll = DllOpen("cwebpage.dll")
    DllCall($dll, "long", "EmbedBrowserObject", "hwnd", $internetgui)
    DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", "http://www.google.com")



While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE; states that if the close button is it hte script will exit
            ExitLoop
        Case $msg = $Button_4;gets the message of the button
            DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)); tells the dll to go to the web page thats in the combobox
    EndSelect
WEnd
Exit

good luck figuring it out!!

intercurve.zip

Edited by trickytroy

[quote]Randy:This is for what?! Arresting me for what?! I'm not allowed to stand up for myself?! I thought this was America! Huh? Isn't this America?! I'm sorry! I thought this was America![/quote]

Link to comment
Share on other sites

hello, i am in the process of making my own web browser just for fun and i have come across this problem: when i run the program the window is not all the way maximized (which is what i want) then when i hit the resize button to make it full screen it doesnt change the size of the child gui and i end up with a bunch of space in the parent gui. well

if someone could help me with making the child gui resize when the parent does it would be much apprecaited. heres the code but if you want to see and try it for yourself then then you can download the code and the dll at the bottom of this post.

#include <GuiConstants.au3>

;Creates the parent gui
$gui = GUICreate("MyGUI", 989, 601, (@DesktopWidth - 989) / 2, (@DesktopHeight - 601) / 2, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
    $Button_2 = GUICtrlCreateButton("Back", 20, 30, 50, 20)
    $Button_3 = GUICtrlCreateButton("Forward", 80, 30, 50, 20)
    $Button_4 = GUICtrlCreateButton("GO", 810, 30, 40, 20)
    $Combo_5 = GUICtrlCreateCombo("http://www.google.com", 150, 30, 640, 21)
    $Progress_6 = GUICtrlCreateProgress(840, 580, 70, 15)
    $Date_8 = GUICtrlCreateDate("Date7", 20, 580, 200, 20)
    $pic = GUICtrlCreatePic("C:\Documents and Settings\boy wonder\My Documents\My Pictures\intercurve3.GIF", 890, 5, 40, 53)
        GUISetState()

;creates the child gui that the dll will be held in.
$internetgui = GUICreate("", 970, 515, 10, 60, $WS_CHILD + $WS_BORDER, "", $gui)
    GUISetState()

;opens dll then calls it.
$dll = DllOpen("cwebpage.dll")
    DllCall($dll, "long", "EmbedBrowserObject", "hwnd", $internetgui)
    DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", "http://www.google.com")
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE; states that if the close button is it hte script will exit
            ExitLoop
        Case $msg = $Button_4;gets the message of the button
            DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)); tells the dll to go to the web page thats in the combobox
    EndSelect
WEnd
Exit

good luck figuring it out!!

<{POST_SNAPBACK}>

Pretty soon you will get the possibliity to receive $GUI_EVENT_RESIZED so you can do whatever you want AutoIt will not do anything. :)

Edit : $GUI_EVENT_RESIZE changed to $GUI_EVENT_RESIZED in >=3.1.1.16 not yet available

Edited by jpm
Link to comment
Share on other sites

Is there a way I could get the Function definitions or the source to that dll?

<{POST_SNAPBACK}>

ya here you go

[quote]Randy:This is for what?! Arresting me for what?! I'm not allowed to stand up for myself?! I thought this was America! Huh? Isn't this America?! I'm sorry! I thought this was America![/quote]

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...