找回密码
 加入
搜索
查看: 5720|回复: 11

[AU3基础] au3的状态栏的文字上怎样加链接?有没有谁知道? 已解决

 火.. [复制链接]
发表于 2010-3-11 09:48:08 | 显示全部楼层 |阅读模式
本帖最后由 yeqing880 于 2010-3-12 09:56 编辑





如图示..我想在上面加一个链接..应该怎么做呢?



问题已解决,解决办法在三楼...谢谢大大的帮助!

本帖子中包含更多资源

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

×

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-3-11 10:01:45 | 显示全部楼层
上代码吧!
发表于 2010-3-11 13:11:25 | 显示全部楼层
#include <GUIStatusBar.au3>
#include <GUIConstants.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Test", 400, 300)

GUICtrlCreateLabel("www.google.cn", 4, 4, 200, 20)
GUICtrlSetFont(-1, 9, 400, 4, "Verdana")

$hFont = _SendMessage(GUICtrlGetHandle(-1), $WM_GETFONT, 0, 0)
Local $aText[2] = ["www.google.cn", ""], $aPart[2] = [400 / 1.5, -1]

$hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aPart, $aText)
_SendMessage($hStatusBar, $WM_SETFONT, $hFont, 1, 0, "wparam", "int")
GUICtrlSetState(-1, $GUI_HIDE)

$hLibrary = _WinAPI_LoadLibrary("Shell32.dll")
$hCursor = _LoadCursor($hLibrary, 1002)
_WinAPI_FreeLibrary($hLibrary)

$hSTC = DllCallbackRegister("_StatusBarProcedure", "int", "hWnd;uint;wparam;lparam")
$hOSTC = _WinAPI_SetWindowLong($hStatusBar, -4, DllCallbackGetPtr($hSTC))

Func _StatusBarProcedure($hWnd, $iMsg, $iwParam, $ilParam)
        Local $iX, $iY

        If (($iMsg = $WM_MOUSEMOVE) Or ($iMsg = $WM_LBUTTONDOWN) Or _
                ($iMsg = $WM_LBUTTONUP) Or ($iMsg = $WM_LBUTTONDBLCLK)) Then
                $iX = bitAnd($ilParam, 0xFFFF)
                $iY = bitShift($ilParam, 0x10)

                If ($iX > 0 And $iX < 100) And ($iY > 0 And $iY < 21) Then
                        _SetCursor($hCursor)
                        If ($iMsg = $WM_LBUTTONDBLCLK) Then
                                ShellExecute("www.google.cn")
                        EndIf
                EndIf
        EndIf
        Return _WinAPI_CallWindowProc($hOSTC, $hWnd, $iMsg, $iwParam, $ilParam)
EndFunc        ;==>_StatusBarProcedure

GUISetState()

Do
Until GUIGetMsg() = -3

Opt("TrayIconHide", 1)
ProcessClose(@AutoItPid)

Func _LoadCursor($hInstance, $iCursorId)
        Local $iResult
        $iResult = DllCall("User32.dll", "hWnd", "LoadCursor", "hWnd", $hInstance, "int", $iCursorId)
        Return $iResult[0]
EndFunc        ;==>_LoadCursor

Func _SetCursor($hCursor)
        Local $iResult = DllCall("User32.dll", "int", "SetCursor", "hWnd", $hCursor)
        Return $iResult[0]
EndFunc        ;==>_SetCursor
双击打开GOOGLE。
如果只是想截取双击这个通知以打开指定网站,用GUIRegisterMsg注册WM_NOTIFY消息也可以,WM_NOTIFY的lParam参数指向NMHEADER结构,此结构在StructureConstants.au3有定义。
然而,如果在以上基础上还要设置鼠标形状,就必须要用SetWindowLong函数改变StatusBar控件的消息接收地址,以截取所有消息。

评分

参与人数 2金钱 +40 贡献 +5 收起 理由
itljl + 10
afan + 30 + 5 学习了

查看全部评分

发表于 2010-3-11 13:29:25 | 显示全部楼层
我顶P大!!太强悍了!
发表于 2010-3-11 13:33:13 | 显示全部楼层
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("测试", 242, 135, 298, 213)
$Label1 = GUICtrlCreateLabel("文字连接", 88, 40, 52, 17)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetCursor(-1, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Label1
                        ShellExecute("http://5300597.qzone.qq.com")
        EndSwitch
WEnd
发表于 2010-3-11 13:34:07 | 显示全部楼层
抱歉,没看清题目。状态栏。。。。。。
发表于 2010-3-11 17:38:18 | 显示全部楼层
呵呵,学习一下。。
 楼主| 发表于 2010-3-12 09:55:12 | 显示全部楼层
回复 3# pusofalse


    谢谢提供..问题已解决~~
发表于 2011-4-13 23:07:51 | 显示全部楼层
非常感谢,我正需要
发表于 2011-8-6 14:52:26 | 显示全部楼层
学习一下。。
发表于 2012-5-17 00:09:47 | 显示全部楼层
我来学习了了。这个不错。
发表于 2012-5-17 00:14:43 | 显示全部楼层
收藏先,,用得着的时候再用
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-30 11:34 , Processed in 0.096542 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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