我#NoTrayIcon
Local $Gif = @ScriptDir & '\MMqq.gif'
;MM图片文件过大,不上传了,下面这行可直接下载,不保证链接一直有效。下载完可删除下载这段。
If Not FileExists($Gif) Then
Tooltip('正在网上拉MM,请稍候…')
Local $Size = InetGet('http://m3.img.libdd.com/farm4/97/1E1EC4CD274C2ABFCF23D65E8397F161_275_450.GIF', $Gif, 1)
Tooltip('')
If $Size <> 2095058 Then Exit MsgBox(48, $Size & ':(', 'MM跟丢了…')
EndIf
HotKeySet('{esc}', '_Exit')
Local $Gui = GUICreate('无边框Gif动画界面,可拖动及右键菜单例子 By afan', 265, 430, -1, -1, 0x80000000, 0x00000008)
;$WS_POPUP = 0x80000000 $WS_EX_TOPMOST = 0x00000008
Local $iLb = GUICtrlCreateLabel('', 0, 0, 265, 430, -1, 0x00100000) ;$GUI_WS_EX_PARENTDRAG = 0x00100000
Local $oIE = ObjCreate('Shell.Explorer.2')
GUICtrlCreateObj($oIE, -15, -20, 300, 490)
$oIE.navigate($Gif)
GUISetState()
Local $DummyMenu, $ContextMenu, $hMenu, $ExitMenuItem, $CurInfo
$DummyMenu = GUICtrlCreateDummy()
$ContextMenu = GUICtrlCreateContextMenu($DummyMenu)
$hMenu = GUICtrlGetHandle(-1)
$ExitMenuItem = GUICtrlCreateMenuItem('退出', $ContextMenu)
While 1
$CurInfo = GUIGetCursorInfo($Gui)
If Not @Error And ($CurInfo[3] = 1 And $CurInfo[4] = $iLb) Then _ShowMenu($Gui, $hMenu)
Switch GUIGetMsg()
Case -3, $ExitMenuItem
_Exit()
EndSwitch
WEnd
Func _ShowMenu($hWnd, $hMenu)
Local $arPos = MouseGetPos()
Local $x = $arPos[0]
Local $y = $arPos[1]
DllCall('user32.dll', 'int', 'TrackPopupMenuEx', 'hwnd', $hMenu, 'int', 0, 'int', $x, 'int', $y, 'hwnd', $hWnd, 'ptr', 0)
EndFunc ;==>_ShowMenu
Func _Exit()
Exit
EndFunc ;==>_Exit |