Jump to content
Sign in to follow this  
GeekS

Dragging a GUI window without borders

Recommended Posts

GeekS

What i want to do, is to make this GUI window drag-able from mouseclicking(draging) the background/image.

GUICreate("Gnu's little helper", x1, y1, x2, y2, BitOR($WS_POPUP,$WS_BORDER))
GUICtrlCreatePic(@WorkingDir & "\Images\XY", 0, 0, x1, y1)

Adding $GUI_WS_EX_PARENTDRAG like this does not work:

GUICreate("Gnu's little helper", x1, y1, x2, y2, BitOR($WS_POPUP,$WS_BORDER))
GUICtrlCreatePic(@WorkingDir & "\Images\XY", 0, 0, x1, y1, "", $GUI_WS_EX_PARENTDRAG)

Thanks in advance, Gnu / GeekS.

Share this post


Link to post
Share on other sites
Dampe

GUICreate("Gnu's little helper", x1, y1, x2, y2, BitOR($WS_POPUP,$WS_BORDER))
GUICtrlCreatePic(@WorkingDir & "\Images\XY", 0, 0, x1, y1)
GUICtrlSetState (-1, $GUI_DISABLE)
GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")



    Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam)
        Local $iProc
   
        $iProc = DllCall("user32.dll", "int", "DefWindowProc", "hwnd", $hWnd, "int", $Msg, "wparam", $wParam, "lparam", $lParam)
        $iProc = $iProc[0]
   
        If $iProc = $HTCLIENT Then Return $HTCAPTION
   
        Return $GUI_RUNDEFMSG
    EndFunc


Share this post


Link to post
Share on other sites
martin

What i want to do, is to make this GUI window drag-able from mouseclicking(draging) the background/image.

GUICreate("Gnu's little helper", x1, y1, x2, y2, BitOR($WS_POPUP,$WS_BORDER))
GUICtrlCreatePic(@WorkingDir & "\Images\XY", 0, 0, x1, y1)

Adding $GUI_WS_EX_PARENTDRAG like this does not work:

GUICreate("Gnu's little helper", x1, y1, x2, y2, BitOR($WS_POPUP,$WS_BORDER))
GUICtrlCreatePic(@WorkingDir & "\Images\XY", 0, 0, x1, y1, "", $GUI_WS_EX_PARENTDRAG)

Thanks in advance, Gnu / GeekS.

This works for me

#include <GuiConstantsex.au3>
#include <windowsconstants.au3>
GUICreate("Gnu's little helper",200, 200, 200,200, BitOR($WS_POPUP,$WS_BORDER))
GUICtrlCreatePic(@Systemdir & "\oobe\images\mslogo.jpg", 0, 0, 200,200, -1, $GUI_WS_EX_PARENTDRAG)
GUISetState()
while 1
sleep(30)
WEnd

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.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.