找回密码  加入

AUTOIT CN

搜索
查看: 55443|回复: 284

[原创] 公司用的客户端软件(参考360/金山 安全卫士)-释放Icons.au3

[复制链接]
发表于 2013-12-22 14:59:28 | 显示全部楼层 |阅读模式
本帖最后由 joyran 于 2015-6-23 07:37 编辑

这个我新版的设计,同时我开放Icons.au3文件。

目的:实现用户自助服务,适合于IT部门使用。

功能如下:
1、启动画面实现
2、主界面采用图片图标及Tab菜单(头部的”首页“ 是可扩展的)
3、配置ini及png图片来实现链接的打开,如网站、文件共享等
4、可内嵌公司的网站,便于用户使用
5、关闭按钮实现最小化到托盘,如关闭程序需托盘右键退出
6、实现在线检测并自动更新的功能
7、按版本目前在Windows XP 32位/ Windows 7 32位测试可正常使用

至此,本人学习Autoit已三个月多了,非常感谢论坛及各位高手如seniors,3mile等的奉献。







游客,如果您要查看本帖隐藏内容请回复

本帖子中包含更多资源

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

x

评分

5

查看全部评分

发表于 2013-12-22 17:39:46 | 显示全部楼层
做得不错,支持一下楼主.
发表于 2013-12-22 18:21:09 | 显示全部楼层
好强大啊,学习了。。。
发表于 2013-12-22 20:47:10 | 显示全部楼层
发表于 2013-12-22 20:47:17 | 显示全部楼层
界面做的很养眼,楼主进步神速啊~
发表于 2013-12-22 20:49:35 | 显示全部楼层
圖看起來不錯!

不過應該PO個EXE檔之類的吧?

『 作品展览 』
发表于 2013-12-22 21:36:38 | 显示全部楼层
界面很不错,功能也很多,希望可以看到GUI部分源码来学习一下!
发表于 2013-12-23 09:22:49 | 显示全部楼层
界面挺好看的哈,程序呢?
发表于 2013-12-23 10:20:28 | 显示全部楼层
真的很好啊,何时可以学习一下?
发表于 2013-12-23 11:43:50 | 显示全部楼层
好像没有上载呀!展示吗?
 楼主| 发表于 2013-12-23 12:54:35 | 显示全部楼层
  1. #region ;**** 参数创建于 ACNWrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=ico/Run.ico
  3. #AutoIt3Wrapper_UseX64=n
  4. #endregion ;**** 参数创建于 ACNWrapper_GUI ****
  5. #include <Constants.au3>
  6. #include <WindowsConstants.au3>
  7. #include <FontConstants.au3>
  8. #include <StaticConstants.au3>
  9. #include <ButtonConstants.au3>
  10. #include <TabConstants.au3>
  11. #include <WinAPI.au3>
  12. #include <WinAPIEx.au3>
  13. #include <GUIConstantsEx.au3>
  14. #include <GuiTab.au3>
  15. #include <GuiButton.au3>
  16. #include <GuiImageList.au3>
  17. #include <GuiToolbar.au3>
  18. #include <GuiStatusBar.au3>
  19. #include <GDIPlus.au3>
  20. #include <IE.au3>
  21. #include <Misc.au3>
  22. #include <array.au3>
  23. #include <icons.au3>
复制代码
 楼主| 发表于 2013-12-23 12:56:04 | 显示全部楼层
号召大家的要求,我开发源码。谢谢大家!

  1. #region ;**** 参数创建于 ACNWrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=ico/Run.ico
  3. #AutoIt3Wrapper_UseX64=n
  4. #endregion ;**** 参数创建于 ACNWrapper_GUI ****
  5. #include <Constants.au3>
  6. #include <WindowsConstants.au3>
  7. #include <FontConstants.au3>
  8. #include <StaticConstants.au3>
  9. #include <ButtonConstants.au3>
  10. #include <TabConstants.au3>
  11. #include <WinAPI.au3>
  12. #include <WinAPIEx.au3>
  13. #include <GUIConstantsEx.au3>
  14. #include <GuiTab.au3>
  15. #include <GuiButton.au3>
  16. #include <GuiImageList.au3>
  17. #include <GuiToolbar.au3>
  18. #include <GuiStatusBar.au3>
  19. #include <GDIPlus.au3>
  20. #include <IE.au3>
  21. #include <Misc.au3>
  22. #include <array.au3>
  23. #include <icons.au3>

  24. _Singleton("Service Desk Helper") ;防止程序重复运行

  25. TraySetClick(16)
  26. Opt("TrayMenuMode", 3)
  27. Opt("trayOnEventMode", 1)
  28. TraySetOnEvent($TRAY_EVENT_PRIMARYDOWN, "_showwin")
  29. Local $aboutitem = TrayCreateItem("关于")
  30. TrayItemSetOnEvent($aboutitem, "TrayMsg")
  31. TrayCreateItem("")
  32. Local $websiteitem = TrayCreateItem("网站")
  33. TrayItemSetOnEvent($websiteitem, "TrayMsg")
  34. TrayCreateItem("")
  35. Local $exititem = TrayCreateItem("退出")
  36. TrayItemSetOnEvent($exititem, "TrayMsg")

  37. Local $week[7] = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]

  38. Global $hGUI, $GUIMsg

  39. Global $TabHover = False, $TABActiveID = 0, $TabHoverID = -1, $Count = 0
  40. Global $WinWidth = 971, $WinHeight = 651, $TabWidth = 100, $TabHeight = 30, $Tabcount = 4
  41. Global $bannerHeight = 104

  42. Global $hTABCallback = DllCallbackRegister("My_TABProc", "int", "hWnd;uint;wparam;lparam")
  43. Global $tTABCallback = DllCallbackGetPtr($hTABCallback)

  44. $hGUI = GUICreate("Service Desk Helper", $WinWidth, $WinHeight, -1, -1, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_POPUP, $WS_GROUP, $WS_CLIPSIBLINGS))
  45. ;--------------------------------------------------------------------------------
  46. Local $version_srv = IniRead(@ScriptDir & "\ini\svrconf.ini", "Config", "Version", "")
  47. Local $download_url = IniRead(@ScriptDir & "\ini\svrconf.ini", "Config", "download_url", "")
  48. Local $download_suffix = IniRead(@ScriptDir & "\ini\svrconf.ini", "Config", "download_suffix", "")
  49. Local $download_action = IniRead(@ScriptDir & "\ini\svrconf.ini", "Config", "download_action", "")
  50. $hStatus = _GUICtrlStatusBar_Create($hGUI)
  51. $pBG = GUICtrlCreatePic(@ScriptDir & "\images\bg_content.jpg", 0, $bannerHeight + $TabHeight, $WinWidth - 1, $WinHeight - ($bannerHeight + $TabHeight) - 1)
  52. GUICtrlSetState(-1, $GUI_DISABLE)
  53. GUICtrlCreateLabel("主程序版本:" & $version_srv, 10, 628, 180, 24)
  54. GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
  55. GUICtrlCreateLabel("制作者:冉松", 200, 628, 280, 24)
  56. GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
  57. Local $size = InetGetSize($download_url & "svrconf.ini")
  58. If $size > 0 Then
  59.         GUICtrlCreateIcon(@ScriptDir & "\images\con_ok.ico", -1, 680, 628, 18, 16)
  60.         GUICtrlCreateLabel("网络连接成功", 702, 630, 80, 16)
  61.         GUICtrlSetFont(-1, 10, 400, '宋体')
  62.         GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
  63.         Local $hDownload = InetGet($download_url & "svrconf.ini", @ScriptDir & "\ini\svrconf.ini", 1, 1)
  64.         Do
  65.                 Sleep(250)
  66.         Until InetGetInfo($hDownload, 2)
  67.         InetClose($hDownload)
  68.         $version_srv = IniRead(@ScriptDir & "\ini\svrconf.ini", "Config", "Version", "")
  69.         $version_loc = IniRead(@ScriptDir & "\ini\locconf.ini", "Config", "Version", "")
  70.         If $version_srv <> $version_loc Then
  71.                 If FileExists(@ScriptDir & "" & "uAutoitDownload.exe") Then ShellExecute(@ScriptDir & "" & "uAutoitDownload.exe")
  72.         EndIf
  73. Else
  74.         GUICtrlCreateIcon(@ScriptDir & "\images\con_bad.ico", -1, 680, 628, 18, 16)
  75.         GUICtrlCreateLabel("网络连接异常", 702, 630, 80, 16)
  76.         GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
  77. EndIf
  78. ;--------------------------------------------------------------------------------
  79. $BG_banner = GUICtrlCreatePic(@ScriptDir & "\images\bg_banner.jpg", 0, 0, $WinWidth - 1, $bannerHeight)
  80. GUICtrlSetState(-1, $GUI_DISABLE)
  81. $BG_logo = GUICtrlCreatePic(@ScriptDir & "\images\bg_logo.jpg", 5, 2, 23, 22)
  82. GUICtrlSetState(-1, $GUI_DISABLE)
  83. GUICtrlCreateLabel("服务台助手1.0 Beta", 28, 6, 200, 22)
  84. GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
  85. GUICtrlSetFont(-1, 10, 600, '宋体')
  86. GUICtrlSetColor(-1, 0xFFFFFF)
  87. ;----------------------------------------------------------------------------------------------------------
  88. Global $btn_system[3], $jishu[3]
  89. $btn_system[0] = GUICtrlCreatePic(@ScriptDir & "\images\btn\0.jpg", 396 + 470, 1, 31, 19)
  90. GUICtrlSetCursor(-1, 0)
  91. $btn_system[1] = GUICtrlCreatePic(@ScriptDir & "\images\btn\1.jpg", 427 + 470, 1, 31, 19)
  92. GUICtrlSetCursor(-1, 0)
  93. $btn_system[2] = GUICtrlCreatePic(@ScriptDir & "\images\btn\2.jpg", 458 + 470, 1, 40, 19)
  94. GUICtrlSetCursor(-1, 0)
  95. ;---------------------------------------------------------------------------------------------------------
  96. $BG_sl = GUICtrlCreatePic(@ScriptDir & "\images\bg_sl.jpg", 0, $bannerHeight, 2, $TabHeight)
  97. GUICtrlSetState(-1, $GUI_DISABLE)
  98. $BG_sr = GUICtrlCreatePic(@ScriptDir & "\images\bg_sr.jpg", $WinWidth - 3, $bannerHeight, 2, $TabHeight)
  99. GUICtrlSetState(-1, $GUI_DISABLE)

  100. ;Local $ico[5], $bj[5], $flag[5], $ID[1]
  101. Local $ico[1], $bj[1], $flag[1]
  102. Local $ID[1]
  103. For $i = 0 To UBound($ico) - 1
  104.         $ico[$i] = GUICtrlCreateIcon(@ScriptDir & "\images\app" & $i & ".ico", -1, 5 + (89 * $i), 25, 73, 74)
  105.         GUICtrlSetCursor(-1, 0)
  106. Next
  107. GUICtrlSetImage($ico[0], @ScriptDir & "\images\app\0h.ico")
  108. ;--------------------------------------------------------------------------------
  109. $tab = GUICtrlCreateTab(2, $bannerHeight, $WinWidth - 4, $WinHeight, BitOR($TCS_FIXEDWIDTH, $TCS_OWNERDRAWFIXED))
  110. $tabHwnd = GUICtrlGetHandle(-1)
  111. _GUICtrlTab_SetItemSize($tab, $TabWidth, $TabHeight)
  112. GUICtrlSetCursor(-1, 0)
  113. ;----------------------------------------------------------------------------------------------
  114. GUICtrlCreateTabItem("首页")
  115. Local $k = 0
  116. Dim $link[1], $link_bg[1], $link_tooltips[1], $link_ExePath[1]
  117. $link_ini_file = @ScriptDir & "\ini\link.ini"
  118. $link_type = IniReadSection($link_ini_file, "type")
  119. GUICtrlCreateLabel("你最常用的功能将会出现在这里", 120, 160, 400, 24)
  120. GUICtrlSetFont(-1, 11, 400, '宋体')
  121. GUICtrlSetColor(-1, 0x868686)
  122. For $i = 1 To $link_type[0][0]
  123.         GUICtrlCreateLabel($link_type[$i][1], 45, 160 + (140 * ($i - 1)), 80, 24)
  124.         GUICtrlSetFont(-1, 11, 600, '宋体')
  125.         GUICtrlSetColor(-1, 0x047ecb)
  126.         $link_sub = IniReadSection($link_ini_file, $link_type[$i][1] & ".list") ;读取分类数量
  127.         For $x = 1 To $link_sub[0][0] ;循环
  128.                 $link_info1 = IniReadSection($link_ini_file, $link_sub[$x][1]) ;读取分类字段名
  129.                 ReDim $link[$k + 1]
  130.                 ReDim $link_bg[$k + 1]
  131.                 ReDim $link_tooltips[$k + 1]
  132.                 ReDim $link_ExePath[$k + 1]
  133.                 $link_ExePath[$k] = $link_info1[3][1]
  134.                 $link_tooltips[$k] = $link_info1[4][1]
  135.                 ;$link[$k] = GUICtrlCreateButton('', 5 + (90 * $x), 200 + (140 * ($i - 1)), 56, 56, BitOR($BS_MULTILINE, $BS_BOTTOM))
  136.                 ;_GUICtrlButton_SetImageList(-1, _GetImageListHandle(@ScriptDir & $link_info1[2][1], 125 + $x, True), 5)
  137.                 ;$link_hover[$k]=GUICtrlCreatePic("out.gif",5 + (110 * $x), 200 + (140 * ($i - 1)),152,85)
  138.                 $link_bg[$k] = GUICtrlCreatePic("",5 - 8 + (110 * $x), 200 - 8 + (140 * ($i - 1)),80,80)
  139.                 GUICtrlSetCursor(-1, 0)
  140.                 $link[$k] =GUICtrlCreatePic("",5 + (110 * $x), 200 + (140 * ($i - 1)), 64, 64)
  141.                 GUICtrlSetCursor(-1, 0)
  142.                 _SetImage(-1,@ScriptDir & $link_info1[2][1])
  143.                 GUICtrlCreateLabel($link_info1[1][1], 5 + (110 * $x) - 10, 275 + (140 * ($i - 1)), 86, 24, $SS_CENTER)
  144.                 GUICtrlSetFont(-1, 10, 400, '宋体')
  145.                 $k += 1
  146.         Next
  147. Next
  148. Local $Link_Flag[UBound($link)]

  149. ;-----------------------------------------------------------------------------------------------
  150. GUICtrlCreateTabItem("信息查询")
  151. $url = "http://10.43.8.44/jquery-easyui-1.3.2/demo/flat/index.php"
  152. _oIE($url)

  153. ;-----------------------------------------------------------------------------------------------
  154. GUICtrlCreateTabItem("文件服务器")
  155. Local $k = 0, $yy = 0
  156. Dim $file_srv[1], $file_srv_bg[1], $file_srv_tooltips[1], $file_srv_ExePath[1]
  157. $file_srv_ini_file = @ScriptDir & "\ini\file_srv.ini"
  158. $file_srv_type = IniReadSection($file_srv_ini_file, "type")
  159. GUICtrlCreateLabel("所有文件服务器在这里", 110, 155, 400, 24)
  160. GUICtrlSetFont(-1, 11, 400, '宋体')
  161. GUICtrlSetColor(-1, 0x868686)
  162. For $i = 1 To $file_srv_type[0][0]
  163.         If $i>1 Then
  164.                 GUICtrlCreateLabel('', 105, 155 + (100 * ($i - 1))+ $yy + 6, 820, 1, $SS_ETCHEDHORZ)
  165.         EndIf
  166.         GUICtrlCreateLabel($file_srv_type[$i][1], 5, 155 + (100 * ($i - 1))+ $yy, 100, 24, $SS_RIGHT)
  167.         GUICtrlSetFont(-1, 11, 600, '宋体')
  168.         GUICtrlSetColor(-1, 0x047ecb)
  169.         $file_srv_sub = IniReadSection($file_srv_ini_file, $file_srv_type[$i][1] & ".list") ;读取分类数量
  170.         For $x = 1 To $file_srv_sub[0][0] ;循环
  171.                 $file_srv_info1 = IniReadSection($file_srv_ini_file, $file_srv_sub[$x][1]) ;读取分类字段名
  172.                 ReDim $file_srv[$k + 1]
  173.                 ReDim $file_srv_bg[$k + 1]
  174.                 ReDim $file_srv_tooltips[$k + 1]
  175.                 ReDim $file_srv_ExePath[$k + 1]
  176.                 $file_srv_ExePath[$k] = $file_srv_info1[3][1]
  177.                 $file_srv_tooltips[$k] = $file_srv_info1[4][1]
  178.                 If $x<6 Then
  179.                         ;$file_srv[$k] = GUICtrlCreateButton('', 50 + (180 * ($x - 1)), 170 + (100 * ($i - 1)) + $yy, 48, 48, BitOR($BS_MULTILINE, $BS_BOTTOM))
  180.                         ;_GUICtrlButton_SetImageList(-1, _GetImageListHandle(@ScriptDir & $file_srv_info1[2][1], 125 + $x, True), 5)
  181.                         ;GUICtrlSetCursor(-1, 0)
  182.                         $file_srv_bg[$k] = GUICtrlCreatePic("",20 -4 + (180 * ($x - 1)), 180 - 4 + (100 * ($i - 1)) + $yy + 10, 178, 56)
  183.                         GUICtrlSetCursor(-1, 0)
  184.                         $file_srv[$k] =GUICtrlCreatePic("",20 + (180 * ($x - 1)), 180 + (100 * ($i - 1)) + $yy + 10, 48, 48)
  185.                         GUICtrlSetCursor(-1, 0)
  186.                         _SetImage(-1,@ScriptDir & $file_srv_info1[2][1])
  187.                         GUICtrlCreateLabel($file_srv_info1[1][1], 18 + 65 + (180 * ($x - 1)) - 10, 180 + (100 * ($i - 1)) + $yy + 10 + 10, 96, 28)
  188.                         GUICtrlSetFont(-1, 10, 400, '宋体')
  189.                 ElseIf 5<$x<12 Then
  190.                         $xx = $x - 5
  191.                         ;$file_srv[$k] = GUICtrlCreateButton('', 50 + (180 * ($xx - 1)), 170 + (100 * ($i)) - 30, 48, 48, BitOR($BS_MULTILINE, $BS_BOTTOM))
  192.                         ;_GUICtrlButton_SetImageList(-1, _GetImageListHandle(@ScriptDir & $file_srv_info1[2][1], 125 + $x, True), 5)
  193.                         ;GUICtrlSetCursor(-1, 0)
  194.                         $file_srv_bg[$k] = GUICtrlCreatePic("",20 - 4 + (180 * ($xx - 1)), 180 - 4 + (100 * ($i)) - 30, 178, 56)
  195.                         GUICtrlSetCursor(-1, 0)
  196.                         $file_srv[$k] =GUICtrlCreatePic("",20 + (180 * ($xx - 1)), 180 + (100 * ($i)) - 30, 48, 48)
  197.                         GUICtrlSetCursor(-1, 0)
  198.                         _SetImage(-1,@ScriptDir & $file_srv_info1[2][1])
  199.                         GUICtrlCreateLabel($file_srv_info1[1][1], 18 + 65 + (180 * ($xx - 1)) - 10, 180 + (100 * ($i)) - 30 + 10, 96, 28)
  200.                         GUICtrlSetFont(-1, 10, 400, '宋体')
  201.                         $yy = 100 - 30
  202.                 Else
  203.                         MsgBox(0,0,"请联系系统管理员!")
  204.                 EndIf
  205.                 $k += 1
  206.         Next
  207. Next
  208. Local $file_srv_Flag[UBound($file_srv)]

  209. ;-----------------------------------------------------------------------------------------------
  210. GUICtrlCreateTabItem("关于软件")
  211. Local $startHeight = 150, $offsetHeight = 30
  212. GUICtrlCreateLabel("服务台助手", 20, $startHeight, 800, 20)
  213. GUICtrlSetFont(-1, 14, 600, '宋体')
  214. $str = "软件大小:2.19M 更新日期:2013-11-28 最新版本:" & $version_srv
  215. GUICtrlCreateLabel($str, 40, $startHeight + $offsetHeight, 800, 20)
  216. GUICtrlSetFont(-1, 11, 400, '宋体')
  217. GUICtrlCreateLabel("软件位数:32位 支持系统:winxp/win7", 40, $startHeight + $offsetHeight * 2, 800, 20)
  218. GUICtrlSetFont(-1, 11, 400, '宋体')
  219. GUICtrlCreateLabel("软件简介", 20, $startHeight + $offsetHeight * 3, 800, 20)
  220. GUICtrlSetFont(-1, 12, 600, '宋体')
  221. GUICtrlCreateLabel("服务台助手是一款由Joy Ran开发的基于用户界面设计的自助服务办公软件。", 40, $startHeight + $offsetHeight * 4, 800, 20)
  222. GUICtrlSetFont(-1, 11, 400, '宋体')
  223. GUICtrlCreateLabel("制作者:冉松", 40, $startHeight + $offsetHeight * 5, 800, 20)
  224. GUICtrlSetFont(-1, 11, 400, '宋体')
  225. GUICtrlCreateLabel("软件网站:http://10.43.8.44", 40, $startHeight + $offsetHeight * 6, 800, 20)
  226. GUICtrlSetFont(-1, 11, 400, '宋体')
  227. GUICtrlSetColor(-1, 0x0000FF)
  228. GUICtrlCreateLabel("版本特征", 20, $startHeight + $offsetHeight * 7, 800, 20)
  229. GUICtrlSetFont(-1, 12, 600, '宋体')
  230. GUICtrlCreateLabel("1.友好的用户界面设计,便于用户快速上手", 40, $startHeight + $offsetHeight * 8, 800, 20)
  231. GUICtrlSetFont(-1, 12, 400, '宋体')
  232. GUICtrlCreateLabel("2.方便用户访问公司资源。如网站、文件服务器、应用系统、软件下载", 40, $startHeight + $offsetHeight * 9, 800, 20)
  233. GUICtrlSetFont(-1, 12, 400, '宋体')
  234. GUICtrlCreateLabel("3.基于Windows系统组件开发,稳定并易于扩展", 40, $startHeight + $offsetHeight * 10, 800, 20)
  235. GUICtrlSetFont(-1, 12, 400, '宋体')
  236. GUICtrlCreateLabel("4.软件版本自动检测升级", 40, $startHeight + $offsetHeight * 11, 800, 20)
  237. GUICtrlSetFont(-1, 12, 400, '宋体')

  238. GUICtrlCreateTabItem("")

  239. $hdisplayDC = _WinAPI_CreateDC()
  240. ;初始化选项卡图像DC
  241. $MyhImage = _WinAPI_LoadImage(0, @ScriptDir & "\images\officeh.bmp", $IMAGE_BITMAP, 0, 0, $LR_LOADFROMFILE)
  242. $hBmpDC = _WinAPI_CreateCompatibleDC($hdisplayDC)
  243. $hBmpSv = _WinAPI_SelectObject($hBmpDC, $MyhImage)
  244. _WinAPI_DeleteObject($MyhImage)
  245. ;初始化临时DC,也就是二次缓冲,防止闪烁
  246. $hTempDC = _WinAPI_CreateCompatibleDC($hdisplayDC)
  247. $hTempImage = _WinAPI_CreateCompatibleBitmap($hdisplayDC, $TabWidth * $Tabcount, $TabHeight)
  248. $hTempSv = _WinAPI_SelectObject($hTempDC, $hTempImage)
  249. _WinAPI_DeleteObject($hTempImage)
  250. _WinAPI_DeleteDC($hdisplayDC)

  251. Global $TABCallProc = _WinAPI_SetWindowLong(GUICtrlGetHandle($tab), -4, $tTABCallback)
  252. ;-------------------------------------------------------------------------------------
  253. Global $mzwidth = 29, $mzheight = 17
  254. Global $mytupian = @ScriptDir & "\images\arrow.png"
  255. Global $mao_gui = GUICreate("", $mzwidth, $mzheight, 764, -$mzheight + 4, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD, $WS_EX_TRANSPARENT), $hGUI)
  256. _maozi()
  257. _GUIRoundCorners($hGUI, 0, 0, 4, 4)
  258. GUISetState(@SW_SHOW, $mao_gui)
  259. GUISetState(@SW_SHOW, $hGUI)

  260. While 1
  261.         $GUIMsg = GUIGetMsg()
  262.         ;-------------------------------------------------------------------------------------
  263.         $i = 1
  264.         If $jishu[$i] = 0 Then
  265.                 If _Hover($hGUI, 427 + 470, 1, 31, 19) = 1 Then
  266.                         GUICtrlSetImage($btn_system[$i], @ScriptDir & "\images\btn" & $i & "h.jpg")
  267.                         $jishu[$i] = 1
  268.                 EndIf
  269.         Else
  270.                 If _Hover($hGUI, 427 + 470, 1, 31, 19) = 0 Then
  271.                         GUICtrlSetImage($btn_system[$i], @ScriptDir & "\images\btn" & $i & ".jpg")
  272.                         $jishu[$i] = 0
  273.                 EndIf
  274.         EndIf
  275.         $i = 2
  276.         If $jishu[$i] = 0 Then
  277.                 If _Hover($hGUI, 458 + 470, 1, 40, 19) = 1 Then
  278.                         GUICtrlSetImage($btn_system[$i], @ScriptDir & "\images\btn" & $i & "h.jpg")
  279.                         $jishu[$i] = 1
  280.                 EndIf
  281.         Else
  282.                 If _Hover($hGUI, 458 + 470, 1, 40, 19) = 0 Then
  283.                         GUICtrlSetImage($btn_system[$i], @ScriptDir & "\images\btn" & $i & ".jpg")
  284.                         $jishu[$i] = 0
  285.                 EndIf
  286.         EndIf
  287.         ;-------------------------------------------------------------------------------------
  288.         $ID = GUIGetCursorInfo($hGUI)
  289.         For $k = 0 To UBound($ico) - 1
  290.                 If $ID[4] = $ico[$k] And $bj[$k] = 0 Then
  291.                         GUICtrlSetImage($ico[$k], @ScriptDir & "\images\app" & $k & "h.ico")
  292.                         $bj[$k] = 1
  293.                 ElseIf $ID[4] <> $ico[$k] And $bj[$k] = 1 And $flag[$k] <> 1 Then
  294.                         GUICtrlSetImage($ico[$k], @ScriptDir & "\images\app" & $k & ".ico")
  295.                         $bj[$k] = 0
  296.                 EndIf
  297.         Next
  298.         For $i = 0 To UBound($ico) - 1
  299.                 If $GUIMsg = $ico[$i] Then
  300.                         If $i <> 0 Then
  301.                                 GUICtrlSetImage($ico[0], @ScriptDir & "\images\app\0.ico")
  302.                         EndIf
  303.                         $flag[$i] = 1
  304.                         For $j = 0 To UBound($ico) - 1
  305.                                 If $i <> $j Then
  306.                                         $flag[$j] = 0
  307.                                 EndIf
  308.                         Next
  309.                 EndIf
  310.         Next
  311.         ;--------------------------------------Links-------------------------------------------------
  312.         For $k = 0 To UBound($link) - 1
  313.                 $pos = ""
  314.                 If $ID[4] = $link[$k] And $Link_Flag[$k] = 0 Then
  315.                         GUICtrlSetImage($link_bg[$k],@ScriptDir & "\images\link\over.gif")
  316.                         ToolTip($link_tooltips[$k])
  317.                         #cs
  318.                         $pos = ControlGetPos("","",$link_bg[$k])
  319.                         If Not @error Then
  320.                                 ToolTip($link_tooltips[$k],$pos[0]+65,$pos[1]+99,"",0,3)
  321.                         EndIf
  322.                         #ce
  323.                         $Link_Flag[$k] = 1
  324.                         Sleep(200)
  325.                 ElseIf $ID[4] <> $link[$k] And $Link_Flag[$k] = 1 Then
  326.                         GUICtrlSetImage($link_bg[$k],"")
  327.                         ToolTip("")
  328.                         $Link_Flag[$k] = 0
  329.                         Sleep(200)
  330.                 EndIf
  331.         Next
  332.         For $i = 0 To UBound($link) - 1
  333.                 If $GUIMsg = $link_bg[$i] Then
  334.                         $result = StringLeft($link_ExePath[$i], 3)
  335.                         If $result = "IE:" Then
  336.                                 $url = StringMid($link_ExePath[$i], 4, StringLen($link_ExePath[$i]) - 3)
  337.                                 ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe", $url)
  338.                         Else
  339.                                 ShellExecute($link_ExePath[$i])
  340.                         EndIf
  341.                 EndIf
  342.         Next
  343.         ;--------------------------------------File_Srv-------------------------------------------------
  344.         For $k = 0 To UBound($file_srv) - 1
  345.                 If $ID[4] = $file_srv[$k] And $file_srv_Flag[$k] = 0 Then
  346.                         ;ToolTip($file_srv_tooltips[$k])
  347.                         ;$file_srv_Flag[$k] = 1
  348.                         GUICtrlSetImage($file_srv_bg[$k],@ScriptDir & "\images\file_srv\over.gif")
  349.                         #cs
  350.                         $pos = ControlGetPos("","",$file_srv_bg[$k])
  351.                         If Not @error Then
  352.                                 ToolTip($file_srv_tooltips[$k],$pos[0]+65,$pos[1]+99,"",0,3)
  353.                         EndIf
  354.                         #ce
  355.                         $file_srv_Flag[$k] = 1
  356.                         Sleep(200)
  357.                 ElseIf $ID[4] <> $file_srv[$k] And $file_srv_Flag[$k] = 1 Then
  358.                         ;ToolTip("")
  359.                         ;$file_srv_Flag[$k] = 0
  360.                         GUICtrlSetImage($file_srv_bg[$k],"")
  361.                         ;ToolTip("")
  362.                         $file_srv_Flag[$k] = 0
  363.                         Sleep(200)
  364.                 EndIf
  365.         Next
  366.         For $i = 0 To UBound($file_srv) - 1
  367.                 If $GUIMsg = $file_srv_bg[$i] Then
  368.                         $result = StringLeft($file_srv_ExePath[$i], 3)
  369.                         If $result = "IE:" Then
  370.                                 $url = StringMid($file_srv_ExePath[$i], 4, StringLen($file_srv_ExePath[$i]) - 3)
  371.                                 ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe", $url)
  372.                         Else
  373.                                 ShellExecute($file_srv_ExePath[$i])
  374.                         EndIf
  375.                 EndIf
  376.         Next
  377.         ;---------------------------------------------------------------------------------------
  378.         Switch $GUIMsg
  379.                 Case $btn_system[0]
  380.                         $url = "http://10.43.8.44/jquery-easyui-1.3.2/demo/flat/index.php"
  381.                         ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe", $url)
  382.                 Case $btn_system[1]
  383.                         GUISetState(@SW_MINIMIZE, $hGUI)
  384.                 Case $btn_system[2]
  385.                         GUISetState(@SW_HIDE, $hGUI)
  386.                         GUISetState(@SW_HIDE, $mao_gui)
  387.                 Case $GUI_EVENT_CLOSE
  388.                         _myexitfunc()
  389.                 Case $GUI_EVENT_PRIMARYDOWN
  390.                         mouseCHK()
  391.         EndSwitch
  392. WEnd
  393. ;托盘函数事件
  394. Func TrayMsg() ;系统托盘
  395.         Switch @TRAY_ID
  396.                 Case $aboutitem
  397.                         MsgBox(64, "关于软件", "服务台助手1.0正式版 | 制作者:冉松")
  398.                 Case $websiteitem
  399.                         $url = "http://10.43.8.44/jquery-easyui-1.3.2/demo/flat/index.php"
  400.                         ShellExecute("C:\Program Files\Internet Explorer\iexplore.exe", $url)
  401.                 Case $exititem
  402.                         _myexitfunc()
  403.         EndSwitch
  404. EndFunc   ;==>TrayMsg
  405. Func _showwin()
  406.         GUISetState(@SW_SHOW, $hGUI)
  407.         GUISetState(@SW_SHOW, $mao_gui)
  408.         Return
  409. EndFunc   ;==>_showwin

  410. ;退出函数,退出前要改回TAB原来的处理函数,不然退出要报错
  411. Func _myexitfunc()
  412.         _WinAPI_SetWindowLong(GUICtrlGetHandle($tab), -4, $TABCallProc)
  413.         DllCallbackFree($hTABCallback)
  414.         ;删除DC
  415.         _WinAPI_SelectObject($hBmpDC, $hBmpSv)
  416.         _WinAPI_DeleteDC($hBmpDC)
  417.         _WinAPI_SelectObject($hTempDC, $hTempSv)
  418.         _WinAPI_DeleteDC($hTempDC)
  419.         Exit
  420. EndFunc   ;==>_myexitfunc
  421. Func My_TABProc($hWnd, $msg, $wParam, $lParam)
  422.         Switch $msg
  423.                 Case $WM_MOUSEMOVE
  424.                         If Not $TabHover Then;
  425.                                 $TabHover = True
  426.                                 _WinAPI_TrackMouseEvent($hWnd, 0x00000002)
  427.                         EndIf
  428.                         $mx = _WinAPI_LoWord($lParam)
  429.                         $my = _WinAPI_HiWord($lParam)
  430.                         onMouseMove($hWnd, $mx, $my)
  431.                         Return 0
  432.                 Case 0x2A3;WM_MOUSELEAVE
  433.                         $TabHover = False
  434.                         $TabHoverID = -1
  435.                         RedrawAllTAB()
  436.                         Return 0
  437.                 Case $WM_ERASEBKGND
  438.                         _JiuGongDraw($wParam, 0, 0, $WinWidth, $WinHeight, $hBmpDC, 19, 25, 1, 2, 0, 0, 0, 0)
  439.                         _JiuGongDraw($wParam, 0, 0, $WinWidth, $TabHeight, $hBmpDC, 0, 0, 1, 27, 0, 0, 0, 1)
  440.                         Return 0
  441.                 Case $WM_LBUTTONDOWN
  442.                         $mx = _WinAPI_LoWord($lParam)
  443.                         $my = _WinAPI_HiWord($lParam)
  444.                         onMouseDown($hWnd, $mx, $my)
  445.                         Return _WinAPI_CallWindowProc($TABCallProc, $hWnd, $msg, $wParam, $lParam)
  446.                 Case $WM_PAINT
  447.                         If $Count = 0 Then
  448.                                 Local $tPAINTSTRUCT, $hDC
  449.                                 $Count += 1
  450.                                 $hDC = _WinAPI_BeginPaint($hWnd, $tPAINTSTRUCT)
  451.                                 RedrawAllTAB()
  452.                                 _WinAPI_EndPaint($hWnd, $tPAINTSTRUCT)
  453.                                 $Count -= 1
  454.                                 Return 0
  455.                         EndIf
  456.         EndSwitch
  457.         Return _WinAPI_CallWindowProc($TABCallProc, $hWnd, $msg, $wParam, $lParam)
  458. EndFunc   ;==>My_TABProc

  459. Func onMouseMove($hWnd, $mx, $my)
  460.         If $my <= $TabHeight Then
  461.                 $Idx = Int($mx / $TabWidth)
  462.                 If $Idx >= 0 And $Idx <= $Tabcount - 1 Then
  463.                         If $Idx <> $TabHoverID Then
  464.                                 $TabHoverID = $Idx
  465.                                 RedrawAllTAB()
  466.                         EndIf
  467.                 Else
  468.                         If $TabHoverID <> -1 Then
  469.                                 $TabHoverID = -1
  470.                                 RedrawAllTAB()
  471.                         EndIf
  472.                 EndIf
  473.         Else
  474.                 If $TabHoverID >= 0 Then
  475.                         $TabHoverID = -1
  476.                         RedrawAllTAB()
  477.                 EndIf
  478.         EndIf
  479. EndFunc   ;==>onMouseMove

  480. Func onMouseDown($hWnd, $mx, $my)
  481.         If $my <= $TabHeight Then
  482.                 $Idx = Int($mx / $TabWidth)
  483.                 If $Idx >= 0 And $Idx <= $Tabcount - 1 Then
  484.                         $TABActiveID = $Idx
  485.                 EndIf
  486.         EndIf
  487. EndFunc   ;==>onMouseDown

  488. Func RedrawAllTAB()
  489.         For $i = 0 To $Tabcount - 1
  490.                 If $i = $TabHoverID Then
  491.                         $stata = 1
  492.                 Else
  493.                         $stata = 0
  494.                 EndIf
  495.                 DrawTAB($hTempDC, $i, $stata, $i * $TabWidth, 0, $TabWidth, $TabHeight)
  496.         Next
  497.         $hDC = _WinAPI_GetDC($tabHwnd)
  498.         _WinAPI_BitBlt($hDC, 0, 0, $TabWidth * $Tabcount, $TabHeight, $hTempDC, 0, 0, $SRCCOPY)
  499.         _WinAPI_ReleaseDC($tabHwnd, $hDC)
  500. EndFunc   ;==>RedrawAllTAB

  501. Func DrawTAB($hDC, $nTabID, $TabState, $nLeft, $nTop, $nRight, $nBottom)
  502.         ;这里的数字是由于图像文件决定的
  503.         If $nTabID = $TABActiveID Then;相等就是当前选项卡
  504.                 _JiuGongDraw($hDC, $nLeft, $nTop, $nRight, $nBottom, $hBmpDC, 13 + $TabState * 13, 0, 13, 27, 6, 5, 6, 2);$TabState是Hover标志
  505.         Else
  506.                 If $TabState = 0 Then
  507.                         _JiuGongDraw($hDC, $nLeft, $nTop, $nRight, $nBottom, $hBmpDC, 0, 0, 1, 27, 0, 0, 0, 1)
  508.                 Else
  509.                         _JiuGongDraw($hDC, $nLeft, $nTop, $nRight, $nBottom, $hBmpDC, 0, 0, 13, 27, 6, 5, 6, 2)
  510.                 EndIf
  511.         EndIf
  512.         ;绘制选项卡文字
  513.         $tRECT = DllStructCreate($tagRect)
  514.         DllStructSetData($tRECT, "Left", $nLeft)
  515.         DllStructSetData($tRECT, "Top", $nTop)
  516.         DllStructSetData($tRECT, "Right", $nRight + $nLeft)
  517.         DllStructSetData($tRECT, "Bottom", $nBottom)
  518.         _WinAPI_SetBkMode($hDC, $TRANSPARENT)
  519.         $hFont = _WinAPI_CreateFont(14, 0, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, _
  520.                         $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Arial')
  521.         $hOldFont = _WinAPI_SelectObject($hDC, $hFont)
  522.         _WinAPI_DrawText($hDC, _GUICtrlTab_GetItemText($tab, $nTabID), $tRECT, BitOR($DT_CENTER, $DT_VCENTER, $DT_SINGLELINE))
  523.         _WinAPI_SelectObject($hDC, $hOldFont)
  524.         _WinAPI_DeleteObject($hFont)
  525.         Return 1
  526. EndFunc   ;==>DrawTAB

  527. ;九宫格绘图,参数依次为:目标DC,左,上,长,高,图像DC,左,上,长,高,左上角的长,左上角的高,右下角的长,右下角的高
  528. Func _JiuGongDraw($hDC, $dstX, $dstY, $dstWidth, $dstHeight, $hSrcDC, $SrcX, $SrcY, $srcWidth, $srcHeight, $gX1 = 0, $gY1 = 0, $gX2 = 0, $gY2 = 0)
  529.         If $dstWidth = 0 Or $dstHeight = 0 Or $srcWidth = 0 Or $srcHeight = 0 Then Return
  530.         Local $hmenDC = _WinAPI_CreateCompatibleDC($hDC)
  531.         Local $hSource = _WinAPI_CreateCompatibleBitmap($hDC, $dstWidth, $dstHeight)
  532.         Local $hSv = _WinAPI_SelectObject($hmenDC, $hSource)
  533.         If $gX1 <= 0 And $gX2 <= 0 And $gY1 <= 0 And $gY2 <= 0 Then
  534.                 _WinApi_StretchBlt($hmenDC, 0, 0, $dstWidth, $dstHeight, $hSrcDC, $SrcX + $gX1, $SrcY + $gY1, $srcWidth - $gX2, $srcHeight - $gY2, $SRCCOPY)
  535.         Else
  536.                 If $gX1 > 0 And $gY1 > 0 Then ;左上角
  537.                         _WinAPI_BitBlt($hmenDC, 0, 0, $gX1, $gY1, $hSrcDC, $SrcX, $SrcY, $SRCCOPY)
  538.                 EndIf
  539.                 If $gX2 > 0 And $gY1 > 0 Then ;右上角
  540.                         _WinAPI_BitBlt($hmenDC, $dstWidth - $gX2, 0, $gX2, $gY1, $hSrcDC, $SrcX + $srcWidth - $gX2, $SrcY, $SRCCOPY)
  541.                 EndIf
  542.                 If $gX1 > 0 And $gY2 > 0 Then ;左下角
  543.                         _WinAPI_BitBlt($hmenDC, 0, $dstHeight - $gY2, $gX1, $gY2, $hSrcDC, $SrcX, $SrcY + $srcHeight - $gY2, $SRCCOPY)
  544.                 EndIf
  545.                 If $gX2 > 0 And $gY2 > 0 Then ;右下角
  546.                         _WinAPI_BitBlt($hmenDC, $dstWidth - $gX2, $dstHeight - $gY2, $gX2, $gY2, $hSrcDC, $SrcX + $srcWidth - $gX2, $SrcY + $srcHeight - $gY2, $SRCCOPY)
  547.                 EndIf
  548.                 If $gX1 > 0 Then ;左边框
  549.                         _WinApi_StretchBlt($hmenDC, 0, $gY1, $gX1, $dstHeight - $gY1 - $gY2, $hSrcDC, $SrcX, $SrcY + $gY1, $gX1, $srcHeight - $gY1 - $gY2, $SRCCOPY)
  550.                 EndIf
  551.                 If $gX2 > 0 Then ;右边框
  552.                         _WinApi_StretchBlt($hmenDC, $dstWidth - $gX2, $gY1, $gX2, $dstHeight - $gY1 - $gY2, $hSrcDC, $SrcX + $srcWidth - $gX2, $SrcY + $gY1, $gX2, $srcHeight - $gY1 - $gY2, $SRCCOPY)
  553.                 EndIf
  554.                 If $gY1 > 0 Then ;上边框
  555.                         _WinApi_StretchBlt($hmenDC, $gX1, 0, $dstWidth - $gX1 - $gX2, $gY1, $hSrcDC, $SrcX + $gX1, $SrcY, $srcWidth - $gX1 - $gX2, $gY1, $SRCCOPY)
  556.                 EndIf
  557.                 If $gY2 > 0 Then ;下边框
  558.                         _WinApi_StretchBlt($hmenDC, $gX1, $dstHeight - $gY2, $dstWidth - $gX1 - $gX2, $gY2, $hSrcDC, $SrcX + $gX1, $SrcY + $srcHeight - $gY2, $srcWidth - $gX1 - $gX2, $gY2, $SRCCOPY)
  559.                 EndIf
  560.                 ;中间的伸展部分
  561.                 _WinApi_StretchBlt($hmenDC, $gX1, $gY1, $dstWidth - $gX1 - $gX2, $dstHeight - $gY1 - $gY2, $hSrcDC, $SrcX + $gX1, $SrcY + $gY1, $srcWidth - $gX1 - $gX2, $srcHeight - $gY1 - $gY2, $SRCCOPY)
  562.         EndIf
  563.         _WinAPI_BitBlt($hDC, $dstX, $dstY, $dstWidth, $dstHeight, $hmenDC, 0, 0, $SRCCOPY)
  564.         _WinAPI_SelectObject($hmenDC, $hSv)
  565.         _WinAPI_DeleteObject($hSource)
  566.         _WinAPI_DeleteDC($hmenDC)
  567. EndFunc   ;==>_JiuGongDraw

  568. Func _WinAPI_CreateDC()
  569.         Local $aResult = DllCall("gdi32.dll", "handle", "CreateDC", "str", "DISPLAY", "str", "", "str", "", "ptr", 0)
  570.         If @error Then Return SetError(@error, @extended, 0)
  571.         Return $aResult[0]
  572. EndFunc   ;==>_WinAPI_CreateDC
  573. ;--------------------------------------------------------------------------------------------------------
  574. Func _API_SetLayeredWindowAttributes($hWnd, $i_transcolor, $Transparency = 255, $isColorRef = True)

  575.         Local Const $AC_SRC_ALPHA = 1
  576.         Local Const $ULW_ALPHA = 2
  577.         Local Const $LWA_ALPHA = 0x2
  578.         Local Const $LWA_COLORKEY = 0x1
  579.         If Not $isColorRef Then
  580.                 $i_transcolor = Hex(String($i_transcolor), 6)
  581.                 $i_transcolor = Execute('0x00' & StringMid($i_transcolor, 5, 2) & StringMid($i_transcolor, 3, 2) & StringMid($i_transcolor, 1, 2))
  582.         EndIf
  583.         Local $Ret = DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hWnd, "long", $i_transcolor, "byte", $Transparency, "long", $LWA_COLORKEY + $LWA_ALPHA)
  584.         Select
  585.                 Case @error
  586.                         Return SetError(@error, 0, 0)
  587.                 Case $Ret[0] = 0
  588.                         Return SetError(4, 0, 0)
  589.                 Case Else
  590.                         Return 1
  591.         EndSelect
  592. EndFunc   ;==>_API_SetLayeredWindowAttributes
  593. ;-----------------------------------------------------------------------------------
  594. Func _oIE($url)
  595.         $oIE = ObjCreate("Shell.Explorer.2")
  596.         $GUIActiveX = GUICtrlCreateObj($oIE, 0, $bannerHeight + $TabHeight, $WinWidth, $WinHeight - $bannerHeight - $TabHeight - 26)
  597.         $oIE.document.body.scroll = "no"
  598.         $oIE.navigate($url)
  599.         Sleep(1000)
  600. EndFunc   ;==>_oIE
  601. ;------------------------------------------------------------------------------------
  602. ; using image list to set 1 image and have text on button
  603. Func _GetImageListHandle($sFile, $nIconID = 0, $fLarge = False)
  604.         Local $iSize = 48
  605.         Local $hImage = _GUIImageList_Create($iSize, $iSize, 5, 3)
  606.         _GUIImageList_AddIcon($hImage, $sFile, 0, $fLarge)
  607.         ;_GUIImageList_AddBitmap($hImage, $sFile)
  608.         Return $hImage
  609. EndFunc   ;==>_GetImageListHandle
  610. ;------------------------------------------------------------------------------------
  611. Func _GUIRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
  612.         Local $XS_pos, $XS_ret, $XS_ret2
  613.         $XS_pos = WinGetPos($h_win)
  614.         $XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3)
  615.         If $XS_ret[0] Then
  616.                 $XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1)
  617.         EndIf
  618. EndFunc   ;==>_GUIRoundCorners
  619. ;------------------------------------------------------------------------------------
  620. Func _Hover($cH_hWin = "", $Pos_X = 0, $Pos_Y = 0, $Pos_W = 0, $Pos_H = 0)
  621.         $cH_Data = GUIGetCursorInfo($cH_hWin)
  622.         If Not IsArray($cH_Data) Then Return SetError(10086)
  623.         If $cH_Data[0] > $Pos_X And $cH_Data[0] < $Pos_X + $Pos_W And $cH_Data[1] > $Pos_Y And $cH_Data[1] < $Pos_Y + $Pos_H Then
  624.                 Return 1
  625.         Else
  626.                 Return 0
  627.         EndIf
  628. EndFunc   ;==>_Hover
  629. ;------------------------------------------------------------------------------------
  630. Func mouseCHK()
  631.         $MS = GUIGetCursorInfo($hGUI)
  632.         If $MS[4] = $BG_banner Then move()
  633. EndFunc   ;==>mouseCHK
  634. Func move()
  635.         Local $PosDiff[2], $MousePos, $WinPos
  636.         $MousePos = MouseGetPos()
  637.         $WinPos = WinGetPos($hGUI, "")
  638.         $PosDiff[0] = $WinPos[0] - $MousePos[0]
  639.         $PosDiff[1] = $WinPos[1] - $MousePos[1]
  640.         While _IsPressed("01", DllOpen("user32.dll"))
  641.                 $MousePos = MouseGetPos()
  642.                 WinMove($hGUI, "", $MousePos[0] + $PosDiff[0], $MousePos[1] + $PosDiff[1])
  643.                 Sleep(10)
  644.         WEnd
  645. EndFunc   ;==>move
  646. ;------------------------------------------------------------------------------------
  647. Func _maozi()
  648.         _GDIPlus_Startup()
  649.         Local $hHBITMAP = _WinAPI_CreateBitmap($mzwidth, $mzheight, 1, 32)
  650.         Local $hCDC = _WinAPI_CreateCompatibleDC(0)
  651.         Local $hOld = _WinAPI_SelectObject($hCDC, $hHBITMAP)
  652.         Local $hGraphic = _GDIPlus_GraphicsCreateFromHDC($hCDC)
  653.         Local $kzImage = _GDIPlus_ImageLoadFromFile($mytupian)
  654.         _GDIPlus_GraphicsDrawImageRectRect($hGraphic, $kzImage, 0, 0, _GDIPlus_ImageGetWidth($kzImage), _GDIPlus_ImageGetHeight($kzImage), 0, 0, $mzwidth, $mzheight)
  655.         _GDIPlus_ImageDispose($kzImage)
  656.         _GDIPlus_GraphicsDispose($hGraphic)
  657.         _WinAPI_SelectObject($hCDC, $hOld)
  658.         _WinAPI_DeleteDC($hCDC)
  659.         _GDIPlus_Shutdown()
  660.         _WinAPI_UpdateLayeredWindowEx($mao_gui, -1, -1, $hHBITMAP, 255, 1)
  661. EndFunc   ;==>_maozi
复制代码
发表于 2013-12-23 13:54:11 | 显示全部楼层
---------------------------
AutoIt 错误
---------------------------
Line 130  (File "C:\Users\zjl\Desktop\新建 AutoIt v3 脚本.au3"):

For $i = 1 To $link_type[0][0]
For $i = 1 To $link_type^ ERROR

Error: 子脚本使用了非数组变量.
---------------------------
确定   
---------------------------
好像是部分源码
发表于 2013-12-23 13:55:16 | 显示全部楼层
lz能做大众软件出来?
发表于 2013-12-24 13:22:26 | 显示全部楼层
不错,希望楼主开放全部源码,方便大家互相学习及提升。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2018-10-16 19:08 , Processed in 0.112731 second(s), 17 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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