找回密码
 加入
搜索
查看: 1614|回复: 4

求给GUI图片加个超级链接.

[复制链接]
发表于 2008-5-14 15:41:59 | 显示全部楼层 |阅读模式
#include <GuiConstantsEX.au3>
#include <GDIPlus.au3>
#include "resources.au3"
#include <GUIConstants.au3>
#include <WindowsConstants.au3>

Global $hGui, $iExt
Global $hPic, $hImage, $hGraphic

_GDIPlus_Startup()


$hGui = GUICreate("Form1", @DesktopWidth - 1000, @DesktopHeight - 700, -1, -1, $ws_popup)
$hPic = GUICtrlCreatePic("image2.bmp", 25, 25, 300, 200)
GUISetState()


While 1
        $msg = GUIGetMsg()
        Switch $msg
                $OpenFile = FileOpenDialog("Select image file", "", "image(*.png)")
                _GUICtrlStatic_SetPicture($OpenFile, $hPic)
                Case $GUI_EVENT_CLOSE
                        ExitLoop
        EndSwitch
WEnd

Func _GUICtrlStatic_SetPicture($File, $CtrlId)
        $hImage = _GDIPlus_ImageLoadFromFile($File)
        $hScrDC = _WinAPI_GetDC(0)
        $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
        $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage)
        GUICtrlSetImage($CtrlId, "")
        _SetBitmapToCtrl($CtrlId, $hBitmap)
EndFunc   ;==>_GUICtrlStatic_SetPicture




image2.bmp这个图倒是能显示出来了,现在想做这个选择点击一下图片,弹出另一个IE窗口.

大家多多指教

[ 本帖最后由 木纳 于 2008-5-15 16:02 编辑 ]
发表于 2008-5-14 22:22:59 | 显示全部楼层
加这么一句
Case $hPic
ShellExecute ( "iexplore.exe" , "http://www.autoitx.com"  )

评分

参与人数 1金钱 +2 收起 理由
木纳 + 2 感谢指点.

查看全部评分

发表于 2008-5-14 23:47:25 | 显示全部楼层
ShellExecute (  "http://www.autoitx.com"  )

这样就可以了

评分

参与人数 1金钱 +2 收起 理由
木纳 + 2 多谢

查看全部评分

发表于 2009-3-2 00:14:00 | 显示全部楼层
路过再支持一下了.
发表于 2009-8-27 00:10:16 | 显示全部楼层
进来学习下
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-8 00:06 , Processed in 0.084741 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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