Jump to content

gui windows


brawl
 Share

Recommended Posts

i made a gui that has a gui inside it. and whenever i move the gui i want the one inside it to stay where it is (not move). the small gui inside my bigger gui is the child gui.

im new and dont know much so if you could please help me i'd appreciate it.

Link to comment
Share on other sites

If you remove the title bar, how do you move the window?

#include <GuiConstants.au3>

$MainGUI = GUICreate("Main GUI", 300, 200)
GUISetState()

$ChildGUI = GUICreate("Child GUI", 200, 100, -1, -1, $WS_BORDER+$WS_POPUP, -1, $MainGUI)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Link to comment
Share on other sites

If you remove the title bar, how do you move the window?

Various ways, here's one

#include <GuiConstants.au3>

$MainGUI = GUICreate("Main GUI", 300, 200)
GUISetState()

$ChildGUI = GUICreate("Child GUI", 200, 100, -1, -1, $WS_BORDER + $WS_POPUP, -1, $MainGUI)
GUISetState()
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func WM_NCHITTEST($hWnd, $iMsg, $iwParam, $ilParam)
    If $hWnd = $ChildGUI And $iMsg = $WM_NCHITTEST Then
        $id = _API_DefWindowProc($hWnd, $iMsg, $iwParam, $ilParam)
        $mi = GUIGetCursorInfo($ChildGUI)
        If $id = 1 Then;if it is the client handle
            Return 2;return the title handle
        Else
            Return $id;return the real handle
        EndIf
    EndIf

EndFunc  ;==>WM_NCHITTEST


Func _API_DefWindowProc($hWnd, $iMsg, $iwParam, $ilParam)
    Local $aResult

    $aResult = DllCall("User32.dll", "int", "DefWindowProc", "hwnd", $hWnd, "int", $iMsg, "int", $iwParam, "int", $ilParam)
    Return $aResult[0]
EndFunc  ;==>_API_DefWindowProc
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

  • Moderators

This user has been banned repeatedly... (aka Firelord and others).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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