Sign in to follow this  
Followers 0
vanowm

How to make GUI without caption dragable?

6 posts in this topic

Hello!

Is there away drag a GUI window without caption by grabbing it anywhere?

Thank you.

Share this post


Link to post
Share on other sites



Yes, look at _IsPressed and WinMove() or take a look at the code used in my iPod GDI+ (Signature)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Maybe...

; Author - Ms Creator

#include <GuiConstants.au3>

Global Const $WM_LBUTTONDOWN = 0x0201
;Global Const $WM_SYSCOMMAND = 0x0112

$Gui = GuiCreate("Test", 200, 100, -1, -1, $WS_POPUP, $WS_EX_DLGMODALFRAME)
GuiRegisterMsg($WM_LBUTTONDOWN, "_WinMove")

GUISetState()


While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case -3
            Exit
    EndSwitch
WEnd

Func _WinMove($HWnd, $Command, $wParam, $lParam)
    If BitAND(WinGetState($HWnd), 32) Then Return $GUI_RUNDEFMSG
    DllCall("user32.dll", "long", "SendMessage", "hwnd", $HWnd, "int", $WM_SYSCOMMAND, "int", 0xF009, "int", 0)
EndFunc

There are more here in Autoit Wrappers with "OnEvent mode" etc....

http://www.autoitscript.com/forum/index.ph...st&p=420070

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Wow! This was fast!

Thank you both.

@Valuater:

your code worked perfectly as I wanted it. Just needed add

#include <WindowsConstants.au3>

Thanks again.

Share this post


Link to post
Share on other sites

You can drag the windows using a label too.

(fancy included) :)

#include <GuiConstants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>

$Gui = GuiCreate("Test", 200, 100, -1, -1, $WS_POPUP)
GUISetBkColor(0xffffff)
$close= GUICtrlCreateLabel('x', 180,0, 20, 20 )
GUICtrlSetBkColor(-1, 0xDDDDDD)
GUICtrlSetColor(-1, 0xffffff)
GUICtrlSetFont(-1, 14, 5, -1, "Wingdings")
GUICtrlCreateLabel('', 180,0, 20, 200, $WS_CLIPSIBLINGS, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0xDDDDDD)

GUISetState()
While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case -3, $close
            Exit
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

More examples! :)

1.

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

$hGui = GUICreate("Test", 300, 200, -1, -1, $WS_POPUP)

GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST")

GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

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
EndFuncoÝ÷ Ù½¿m«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑÍà¹ÔÌÐì(¥¹±Õ±Ðí]¥¹½ÝÍ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí5¹Õ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí]¥¹A$¹ÔÌÐì((ÀÌØíU$ôU%
ÉÑ ÌäíÌäì°´Ä°´Ä°´Ä°´Ä± ¥Ñ=H ÀÌØí]M}A=AUA]%9=°ÀÌØí]M}Q!%
-I5¤° ¥Ñ=H ÀÌØí]M}a}
1%9Q°ÀÌØí]M}a}Q==1]%9=¤¤()U%
Ñɱ
ÉÑ1° ÅÕ½Ðí1°ÅÕ½Ðì°ÄÀ°ÄÀ°ÄÀÀ°ÈÀÀ¤)U%
ÑɱMÑ   ­
½±½È ´Ä°Áàääääää¤()U%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½Ðí   ѸÅÕ½Ðì°ÄÀ°ÈÈÀ°ÔÀ°ÈÔ¤()U%MÑMÑÑ ¤()]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤(M±Ð(
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M(á¥Ð(
ÍÀÌØíµÍôÀÌØíU%}Y9Q}AI%5Ie=]8(}5ÍÍ ÀÌØíU$°ÀÌØí]5}MeM
=559°  ¥Ñ=H ÀÌØíM
}5=Y°ÀÌØí!Q
AQ%=8¤°À¤(¹M±Ð)]¹oÝ÷ Ù½ÿm«­¢+Ø¥¹±Õ±ÐíU%
½¹ÍѹÑÍà¹ÔÌÐì(¥¹±Õ±Ðí]¥¹½ÝÍ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí5¹Õ
½¹ÍѹÑ̹ÔÌÐì(¥¹±Õ±Ðí]¥¹A$¹ÔÌÐì((ÀÌØíU$ôU%
ÉÑ ÌäíÌäì°´Ä°´Ä°´Ä°´Ä± ¥Ñ=H ÀÌØí]M}A=AUA]%9=°ÀÌØí]M}Q!%
-I5¤° ¥Ñ=H ÀÌØí]M}a}
1%9Q°ÀÌØí]M}a}Q==1]%9=¤¤)U%
Ñɱ
ÉÑ1° ÅÕ½Ðí1°ÅÕ½Ðì°ÄÀ°ÄÀ°ÄÀÀ°ÈÀÀ¤)U%
ÑɱMÑ   ­
½±½È ´Ä°Áàääääää¤)U%
Ñɱ
ÉÑ    ÕÑѽ¸ ÅÕ½Ðí   ѸÅÕ½Ðì°ÄÀ°ÈÈÀ°ÔÀ°ÈÔ¤)U%MÑMÑÑ ¤()]¡¥±Ä(ÀÌØíµÍôU%Ñ5Í ¤(M±Ð(
ÍÀÌØíµÍôÀÌØíU%}Y9Q}
1=M(á¥Ð(
ÍÀÌØíµÍôÀÌØíU%}Y9Q}AI%5Ie=]8(}É ¤(¹M±Ð)]¹()Õ¹}É ¤(%±±
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÅÕ½ÐíM¹5ÍÍÅÕ½Ðì°ÅÕ½Ðí¡]¹ÅÕ½Ðì°ÀÌØíU$°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí]5}9
1   UQQ=9=]8°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°ÀÌØí!Q
AQ%=8°ÅÕ½Ðí¥¹ÐÅÕ½Ðì°À¤)¹Õ¹ìôôÐí}É

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