Dragging logo

"valery_vi" <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <[email protected]>
Hi,

It can quit by right click, too.

;Draging Logo
#include <GUIConstants.au3>
Global $hWnd
Const $HTCAPTION = 2
Const $WM_NCLBUTTONDOWN = 0x00A1

$hWnd = GuiCreate("Drag Popup",255,40,-1,-1,BitOR
($WS_POPUP,$WS_BORDER)) 
GUISetState(@SW_SHOW)
$Logo = GUICtrlCreatePic(@SystemDir & "\oobe\images\mslogo.jpg", -1,-
1, 255,40)
$ContextMenu  = GUICtrlCreateContextMenu($Logo)
$MenuQuit = GUICtrlCreateMenuitem ("Exit...", $ContextMenu, 0)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $MenuQuit
		Exit
        Case $msg = $GUI_EVENT_PRIMARYDOWN
            DragWin()
    EndSelect
WEnd

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

Valery
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.