AutoIt dragging logo Re: New file uploaded to AutoItList

"valery_vi" <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <[email protected]>
It has the basic actions:

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

$hWnd = GuiCreate("Drag Popup",300,136,-1,-1,BitOR
($WS_POPUP,$WS_BORDER)) 
GUISetState(@SW_SHOW)
$Logo = GUICtrlCreatePic(@ScriptDir & "\AutoIt7.jpg", -1,-1, 300,136)

$ContextMenu  = GUICtrlCreateContextMenu($Logo)
$AutoIt = GUICtrlCreateMenuitem ("AutoIt3", $ContextMenu, 0)
$CommandLine = GUICtrlCreateMenuitem ("Run", $ContextMenu, 1)
$MenuSpace = GUICtrlCreateMenuitem ("", $ContextMenu, 2)
$Logoff = GUICtrlCreateMenuitem ("Logoff", $ContextMenu, 3)
$Shutdown = GUICtrlCreateMenuitem ("Shutdown", $ContextMenu, 4)
$Reboot = GUICtrlCreateMenuitem ("Reboot", $ContextMenu, 5)
$Lock = GUICtrlCreateMenuitem ("Lock ", $ContextMenu, 6)
$TaskManager = GUICtrlCreateMenuitem ("Task Manager", $ContextMenu, 7)
$MenuSpace = GUICtrlCreateMenuitem ("", $ContextMenu, 8)
$System = GUICtrlCreateMenuitem ("*System", $ContextMenu, 9)
$MenuQuit = GUICtrlCreateMenuitem ("Quit...", $ContextMenu, 10)

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $AutoIt
		Run('AutoIt3')
        Case $msg = $CommandLine
		Send('{LWINDOWN}r{LWINUP}')
        Case $msg = $Logoff
		Shutdown(0)
        Case $msg = $Shutdown
		Shutdown(1)
        Case $msg = $Reboot
		Shutdown(2)
        Case $msg = $Lock
		Send('{LWINDOWN}l{LWINUP}')
        Case $msg = $TaskManager
		Send('{CtrlDown}+{Esc}{CtrlUp}')
        Case $msg = $System
		;AutoIt hasn't {BREAK} key simulation!
		Send('{LWINDOWN}{BREAK}{LWINUP}')
        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 

BTW AutoIt hasn't {BREAK} key simulation, so I don't know how to show 
Computer Property Dialog. {WinKey}+{Break}

Valery

--- In [email protected], "valery_vi" <shehrer1@...> wrote:
>
> You can use it like this:
> 
> #include <GUIConstants.au3>
> Global $hWnd
> Const $HTCAPTION = 2
> Const $WM_NCLBUTTONDOWN = 0x00A1
> 
> $hWnd = GuiCreate("Drag Popup",300,136,-1,-1,BitOR
> ($WS_POPUP,$WS_BORDER)) 
> GUISetState(@SW_SHOW)
> $Logo = GUICtrlCreatePic(@ScriptDir & "\AutoIt7.jpg", -1,-1, 
300,136)
> $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 
> 
> It's good idea to add new context menu items and their handlers
> 
> Valery
> 
> --- In [email protected], [email protected] wrote:
> >
> > 
> > Hello,
> > 
> > This email message is a notification to let you know that
> > a file has been uploaded to the Files area of the AutoItList 
> > group.
> > 
> >   File        : /MISC/AutoIt7.jpg 
> >   Uploaded by : valery_vi <shehrer1@> 
> >   Description : AutoIt logo example 
> > 
> > You can access this file at the URL:
> > http://groups.yahoo.com/group/AutoItList/files/MISC/AutoIt7.jpg 
> > 
> > To learn more about file sharing for your group, please visit:
> > http://help.yahoo.com/help/us/groups/files
> > 
> > Regards,
> > 
> > valery_vi <shehrer1@>
> >
>
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.