Sign in to follow this  
Followers 0
Gee

I need example Parent GUI and Child GUI

6 posts in this topic

hi , all :P

I need GUI example : Child GUI insize Parent GUI and Child gui can not move out parent gui

thank !

Share this post


Link to post
Share on other sites



hi , all :P

I need GUI example : Child GUI insize Parent GUI and Child gui can not move out parent gui

thank !

#include <GUIConstants.au3>
#include <Constants.au3>

$PARENT = GUICreate("PARENT",500,500,10,10,0x16C00000)
GUISetState (@SW_SHOW,$PARENT)
GUIRegisterMsg(0xF,"WM_PAINT")

$CHILD = GUICreate("CHILD",200,200,100,100)
DllCall("user32.dll", "hwnd", "SetParent", "hwnd",$CHILD, "hwnd",$PARENT)
WinMove("CHILD", '', -4, -30, 485, 206)
GUISetState(@SW_SHOW,$CHILD)

While 1
    $MSG = GUIGetMsg()
    If $MSG = -3 Then
        Exit
    EndIf
    Sleep(20)
WEnd

Func WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    Sleep(100)
    DllCall("user32.dll", "int", "InvalidateRect", "hwnd", $hWnd, "ptr", 0, "int", 0)
EndFunc ;==>WM_PAINT

When the words fail... music speaks

Share this post


Link to post
Share on other sites

Andreik

Good example, but why need the GUIRegisterMsg(0xF, "WM_PAINT")? Seem work fine without OnPaint message registration :P

Share this post


Link to post
Share on other sites

Thank Andreik :P very good Example

Share this post


Link to post
Share on other sites

Andreik

Good example, but why need the GUIRegisterMsg(0xF, "WM_PAINT")? Seem work fine without OnPaint message registration :P

Now notice that can run without OnPaint.


When the words fail... music speaks

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

well,it does not need the includes either ! :mellow::(

btw: never use sleep in a messageloop. :)

edit2 : what is this good for:

WinMove("CHILD", '', -4, -30, 485, 206)

works fine without

Edited by jennico

Spoiler

I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.OixB7.jpgDon't forget this IP: 213.251.145.96

 

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