Sign in to follow this  
Followers 0
Didonet

Popup window drag with mouse

3 posts in this topic

I'm having a popup gui without drag bar and I want to drag the gui using the mouse (to drag the gui with the mouse).

How?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Opt("GUICloseOnESC",1)
Opt("GUIOnEventMode",1)

$gui = GuiCreate("",300,200,-1,-1,BitOR($WS_POPUP,$WS_BORDER),BitOr($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW))
GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "Drag" )
GUISetOnEvent ($GUI_EVENT_Close, "Quit" )
GUISetState(@SW_SHOW)

While 1
    Sleep(100)
WEnd

Func Drag()
    dllcall("user32.dll","int","SendMessage","hWnd", $gui,"int",$WM_NCLBUTTONDOWN,"int", $HTCAPTION,"int", 0)
EndFunc

Func Quit()
    Exit
EndFunc

EDIT:

- corrected include list

- corrected Esc functionality

Edited by Zedna

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Use This:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

instead of:

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

@Zedna

I have been looking for this, thanx :)

Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

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