Jump to content

Popup window drag with mouse


Didonet
 Share

Recommended Posts

#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
Link to comment
Share on other sites

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]
Link to comment
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
 Share

  • Recently Browsing   0 members

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