找回密码
 加入
搜索
查看: 7176|回复: 16

[AU3基础] 顽固不化修改的悬浮窗,请能帮加个提示呀(鼠标移动到时悬浮窗有提示)!

 火.. [复制链接]
发表于 2010-3-28 12:13:26 | 显示全部楼层 |阅读模式
本帖最后由 fyhwaijxnt78 于 2010-3-28 19:28 编辑

这是顽固不化修改的悬浮窗
http://dvedit.5d6d.com/thread-8802-1-1.html

请能帮加个提示呀(鼠标移动到时悬浮窗有提示)!

还有就可以打开多个工具! 每次运行一个软件,想打开第二个软件,非要等第一个软件运行完或者关闭才可以!
谁能帮改成打开个工具的!


#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#NoTrayIcon
Global $start
Global $n = 0
Global $pos
Global $clickspeed = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed")
$title2 = "双击了"
$AForm1 = GUICreate("", 38, 38, 600, 60, BitOR($WS_SYSMENU, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER), $WS_EX_TOOLWINDOW)
GUISetBkColor(0xBFDBFF)

$icon = GUICtrlCreateIcon(@ScriptDir & "\Canon.ani", -1, 3, 3)
GUICtrlSetState(-1, $GUI_DISABLE)

$ContextMenu = GUICtrlCreateContextMenu()
Dim $JiaNMC, $i
$JiaNMC = IniReadSection(@ScriptDir & "\Canon.ini", "Name")
Dim $RunProAr[$JiaNMC[0][0] + 1]
For $i = 1 To $JiaNMC[0][0]
        $RunProAr[$i] = GUICtrlCreateMenuItem($JiaNMC[$i][0], $ContextMenu)
Next
GUICtrlCreateMenuItem("", $ContextMenu)
$Help = GUICtrlCreateMenuItem("关于", $ContextMenu)
GUICtrlCreateMenuItem("", $ContextMenu)
$exit = GUICtrlCreateMenuItem("退出", $ContextMenu)

$AForm2 = GUICreate($title2, 200, 50, -1, -1)
$Label1 = GUICtrlCreateLabel("这是个双击后的进程...", 0, 18, 200, 13, $SS_CENTER)
GUISetState(@SW_SHOW, $AForm1)
WinSetOnTop($AForm1, "", 1)
WinSetTrans($AForm1, "", 200)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $RunProAr[1] To $RunProAr[$JiaNMC[0][0]]
                        _RunPro()
                Case $GUI_EVENT_PRIMARYDOWN
                        _PRIMARYdown()
                Case $Help
                        about()
                Case $GUI_EVENT_CLOSE
                        GUISetState(@SW_HIDE, $AForm2)
                Case $exit
                        Exit
        EndSwitch
WEnd

Func about()
        MsgBox(262144, "关于:", "这是一个关于悬浮窗的演示程序。" & @CRLF & @CRLF _
                         & "            By Pcbar 2007.09.21" & @CRLF & "    Modify By 顽固不化 2009.11.3")
EndFunc   ;==>about

Func _RunPro()
        For $i = 1 To $JiaNMC[0][0]
                If $RunProAr[$i] = $nMsg Then
                        ShellExecuteWait($JiaNMC[$i][1])
                        ExitLoop
                EndIf
        Next
EndFunc   ;==>_RunPro

Func Move()
        Dim $PosDiff[2], $MousePos, $WinPos
        $MousePos = MouseGetPos()
        $WinPos = WinGetPos($AForm1)
        $PosDiff[0] = $WinPos[0] - $MousePos[0]
        $PosDiff[1] = $WinPos[1] - $MousePos[1]
        While _IsPressed("01", DllOpen("user32.dll"))
                $MousePos = MouseGetPos()
                WinMove($AForm1, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
                Sleep(10)
        WEnd
EndFunc   ;==>Move
Func _PRIMARYdown()
        Move()
        $pos = MouseGetPos()
        $guiPos = WinGetPos($AForm1, '')
        If ($pos[0] >= $guiPos[0] And $pos[0] <= $guiPos[0] + $guiPos[2]) And _
                        ($pos[1] >= $guiPos[1] And $pos[1] <= $guiPos[1] + $guiPos[3]) Then
                $n += 1
                If $n = 2 And (TimerDiff($start) < $clickspeed) Then
                        $n = 0
                        ShowHidemain()
                Else
                        $start = TimerInit()
                        $n = 1
                EndIf
        EndIf
EndFunc   ;==>_PRIMARYdown
Func ShowHidemain()
        If _WinIsVisible($AForm2) Then
                If BitAND(WinGetState($title2, ""), 16) Then WinSetState($title2, "", @SW_RESTORE)
                WinActivate($AForm2)
                Return
        Else
                GUISetState(@SW_SHOW, $AForm2)
        EndIf
EndFunc   ;==>ShowHidemain
Func _WinIsVisible($hWnd, $Text = "")
        Return BitAND(WinGetState($hWnd, $Text), 2)
EndFunc   ;==>_WinIsVisible

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2010-3-28 12:17:36 | 显示全部楼层
GUICtrlSetTip
发表于 2010-3-28 13:05:39 | 显示全部楼层
学习了  呵呵
发表于 2010-3-28 13:35:22 | 显示全部楼层
谢谢分享!顶一个!!
发表于 2010-3-28 14:21:35 | 显示全部楼层
呵呵。老问题啦
发表于 2010-3-28 16:59:28 | 显示全部楼层

评分

参与人数 1金钱 -10 收起 理由
afan -10 警告,禁止纯表情!

查看全部评分

发表于 2010-3-28 18:15:17 | 显示全部楼层
谢谢了 到时候部署工具时可以用用
发表于 2010-3-29 14:47:04 | 显示全部楼层
虽然我不能给你帮助
但是支持你
发表于 2010-3-29 18:44:56 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <GUIConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#NoTrayIcon
Global $start
Global $n = 0
Global $pos
Global $clickspeed = RegRead("HKEY_CURRENT_USER\Control Panel\Mouse", "DoubleClickSpeed")
$title2 = "双击了"
$AForm1 = GUICreate("", 38, 38, 600, 60, BitOR($WS_SYSMENU, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER), $WS_EX_TOOLWINDOW)
GUISetBkColor(0xBFDBFF)
$icon = GUICtrlCreateIcon(@ScriptDir & "\Canon.ani", -1, 3, 3)
GUICtrlSetTip($icon,"asdfaa fdadsfafasdf addfdafdasdf");改动
;GUICtrlSetState(-1, $GUI_DISABLE);改动
$ContextMenu = GUICtrlCreateContextMenu($icon);改动
Dim $JiaNMC, $i
$JiaNMC = IniReadSection(@ScriptDir & "\Canon.ini", "Name")
Dim $RunProAr[$JiaNMC[0][0] + 1]
For $i = 1 To $JiaNMC[0][0]
        $RunProAr[$i] = GUICtrlCreateMenuItem($JiaNMC[$i][0], $ContextMenu)
Next
GUICtrlCreateMenuItem("", $ContextMenu)
$Help = GUICtrlCreateMenuItem("关于", $ContextMenu)
GUICtrlCreateMenuItem("", $ContextMenu)
$exit = GUICtrlCreateMenuItem("退出", $ContextMenu)

$AForm2 = GUICreate($title2, 200, 50, -1, -1)
$Label1 = GUICtrlCreateLabel("这是个双击后的进程...", 0, 18, 200, 13, $SS_CENTER)

GUISetState(@SW_SHOW, $AForm1)
WinSetOnTop($AForm1, "", 1)
WinSetTrans($AForm1, "", 200)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $RunProAr[1] To $RunProAr[$JiaNMC[0][0]]
                        _RunPro()
                Case $GUI_EVENT_PRIMARYDOWN
                        _PRIMARYdown()
                Case $Help
                        about()
                Case $GUI_EVENT_CLOSE
                        GUISetState(@SW_HIDE, $AForm2)
                Case $exit
                        Exit
        EndSwitch
WEnd

Func about()
        MsgBox(262144, "关于:", "这是一个关于悬浮窗的演示程序。" & @CRLF & @CRLF _
                         & "            By Pcbar 2007.09.21" & @CRLF & "    Modify By 顽固不化 2009.11.3")
EndFunc   ;==>about

Func _RunPro()
        For $i = 1 To $JiaNMC[0][0]
                If $RunProAr[$i] = $nMsg Then
                        ShellExecute($JiaNMC[$i][1]);这里改了
                        ExitLoop
                EndIf
        Next
EndFunc   ;==>_RunPro

Func Move()
        Dim $PosDiff[2], $MousePos, $WinPos
        $MousePos = MouseGetPos()
        $WinPos = WinGetPos($AForm1)
        $PosDiff[0] = $WinPos[0] - $MousePos[0]
        $PosDiff[1] = $WinPos[1] - $MousePos[1]
        While _IsPressed("01", DllOpen("user32.dll"))
                $MousePos = MouseGetPos()
                WinMove($AForm1, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
                Sleep(10)
        WEnd
EndFunc   ;==>Move
Func _PRIMARYdown()
        Move()
        $pos = MouseGetPos()
        $guiPos = WinGetPos($AForm1, '')
        If ($pos[0] >= $guiPos[0] And $pos[0] <= $guiPos[0] + $guiPos[2]) And _
                        ($pos[1] >= $guiPos[1] And $pos[1] <= $guiPos[1] + $guiPos[3]) Then
                $n += 1
                If $n = 2 And (TimerDiff($start) < $clickspeed) Then
                        $n = 0
                        ShowHidemain()
                Else
                        $start = TimerInit()
                        $n = 1
                EndIf
        EndIf
EndFunc   ;==>_PRIMARYdown
Func ShowHidemain()
        If _WinIsVisible($AForm2) Then
                If BitAND(WinGetState($title2, ""), 16) Then WinSetState($title2, "", @SW_RESTORE)
                WinActivate($AForm2)
                Return
        Else
                GUISetState(@SW_SHOW, $AForm2)
        EndIf
EndFunc   ;==>ShowHidemain
Func _WinIsVisible($hWnd, $Text = "")
        Return BitAND(WinGetState($hWnd, $Text), 2)
EndFunc   ;==>_WinIsVisible

评分

参与人数 1金钱 +10 收起 理由
fyhwaijxnt78 + 10 很好,谢谢!

查看全部评分

发表于 2010-3-29 22:03:04 | 显示全部楼层
谢谢分享!!
发表于 2010-4-3 17:55:30 | 显示全部楼层
天天向上好好学习
!!!
发表于 2010-4-11 17:19:18 | 显示全部楼层
太好了。。 学习了。。
发表于 2010-4-27 05:22:52 | 显示全部楼层
发表于 2010-5-9 18:29:08 | 显示全部楼层
太好了
以后可能用得上,谢谢!
发表于 2011-3-4 08:19:55 | 显示全部楼层
不错啊,谢谢楼主分享!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-9-30 09:24 , Processed in 0.097435 second(s), 25 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表