#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GuiMenu.au3>
#include "_plusCtrl.au3"
#include <ScreenCapture.au3>; 捕获窗口
;#include 'GUICtrlOnHover.au3'
Opt("GUIOnEventMode", 1)
Global $iWidtha = @DesktopWidth
Global $iHeighta = @DesktopHeight
Global $Form1, $aRect, $tPropertyData, $iLength, $jish, $jishb, $jishc, $jishd, $jishe, $jishf, $Label1
Global $Labela, $Labelb, $Labelc, $Labeld, $Labele, $Labelf
Global $Pic1, $Pic2, $Pic3, $Pic4, $Pic5, $Pic6, $Pica1, $Pica2, $Pica3, $Pica4, $Pica5, $Pica6
Local Const $sFilePath = "Tup.ini"
Local $sReadA = IniRead($sFilePath, "设置", "A", "")
Local $sReadA1 = IniRead($sFilePath, "设置", "1", "")
Local $sReadA2 = IniRead($sFilePath, "设置", "2", "")
Local $sReadA3 = IniRead($sFilePath, "设置", "3", "")
Local $sReadA4 = IniRead($sFilePath, "设置", "4", "")
Local $sReadB = IniRead($sFilePath, "设置b", "B", "")
Local $sReadB1 = IniRead($sFilePath, "设置b", "1", "")
Local $sReadB2 = IniRead($sFilePath, "设置b", "2", "")
Local $sReadB3 = IniRead($sFilePath, "设置b", "3", "")
Local $sReadB4 = IniRead($sFilePath, "设置b", "4", "")
Local $sReadC = IniRead($sFilePath, "设置C", "C", "")
Local $sReadC1 = IniRead($sFilePath, "设置C", "1", "")
Local $sReadC2 = IniRead($sFilePath, "设置C", "2", "")
Local $sReadC3 = IniRead($sFilePath, "设置C", "3", "")
Local $sReadC4 = IniRead($sFilePath, "设置C", "4", "")
Local $sReadD = IniRead($sFilePath, "设置D", "D", "")
Local $sReadD1 = IniRead($sFilePath, "设置D", "1", "")
Local $sReadD2 = IniRead($sFilePath, "设置D", "2", "")
Local $sReadD3 = IniRead($sFilePath, "设置D", "3", "")
Local $sReadD4 = IniRead($sFilePath, "设置D", "4", "")
Local $sReadE = IniRead($sFilePath, "设置E", "E", "")
Local $sReadE1 = IniRead($sFilePath, "设置E", "1", "")
Local $sReadE2 = IniRead($sFilePath, "设置E", "2", "")
Local $sReadE3 = IniRead($sFilePath, "设置E", "3", "")
Local $sReadE4 = IniRead($sFilePath, "设置E", "4", "")
Local $sReadF = IniRead($sFilePath, "设置F", "F", "")
Local $sReadF1 = IniRead($sFilePath, "设置F", "1", "")
Local $sReadF2 = IniRead($sFilePath, "设置F", "2", "")
Local $sReadF3 = IniRead($sFilePath, "设置F", "3", "")
Local $sReadF4 = IniRead($sFilePath, "设置F", "4", "")
GUIForm1()
While 1
Sleep(1000)
WEnd
Func _Message()
;无边框窗口拖动
_SendMessage($Form1, $WM_SYSCOMMAND, $SC_MOVE + $HTCAPTION, 0)
EndFunc ;==>_Message
Func GUIForm1()
$Form1 = GUICreate("PNG图片与JPG图片合成", $iWidtha - 400, $iHeighta - 163, -1, -1, BitOR($WS_POPUP, $WS_CLIPSIBLINGS))
GUISetBkColor(0xC0E0FF)
GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_Message");无边框窗口拖动
Local $sReadCc = IniRead($sFilePath, "设置页面", "C", "")
$hplusForm = plusCreatePic(@ScriptDir & "" & $sReadCc, 0, 30, $iWidtha - 400, $iHeighta - 233);使用PNG图片创建异形窗口。必须先设置背景,再创建控件
GUICtrlSetState(-1, $GUI_DISABLE)
; 创建背景图片
Local $sString = StringRight($sReadA, 4)
Local $iFileExists = FileExists($sReadA)
If $iFileExists Then
;MsgBox(0, $sReadA, "文件存在." & @CRLF & $sReadA)
Else
MsgBox(0, $sReadA, "文件不存在." & @CRLF & "FileExist 返回: " & $iFileExists)
FileDelete($sFilePath)
EndIf
$Pic1 = plusCreatePic(@ScriptDir & "" & $sReadA, $sReadA1, $sReadA2, $sReadA3, $sReadA4)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent(-1, "_click1")
$Pic2 = plusCreatePic(@ScriptDir & "" & $sReadB, $sReadB1, $sReadB2, $sReadB3, $sReadB4)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent(-1, "_click2")
$Pic3 = plusCreatePic(@ScriptDir & "" & $sReadC, $sReadC1, $sReadC2, $sReadC3, $sReadC4)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent(-1, "_click3")
$Pic4 = plusCreatePic(@ScriptDir & "" & $sReadD, $sReadD1, $sReadD2, $sReadD3, $sReadD4)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent(-1, "_click4")
$Pic5 = plusCreatePic(@ScriptDir & "" & $sReadE, $sReadE1, $sReadE2, $sReadE3, $sReadE4)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent(-1, "_click5")
$Pic6 = plusCreatePic(@ScriptDir & "" & $sReadF, $sReadF1, $sReadF2, $sReadF3, $sReadF4)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetOnEvent(-1, "_click6")
GUICtrlCreateLabel("PNG图片与JPEG图片合成", 10, 6, 227, 32, $SS_CENTER)
GUICtrlSetColor(-1, 0x804040)
GUICtrlSetFont(-1, 13, 800, 0, "微软雅黑")
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
$btnMin = GUICtrlCreateLabel("━", $iWidtha - 450, 8, 27, 22, $SS_CENTER)
GUICtrlSetBkColor(-1, 0x677780)
GUICtrlSetColor(-1, 0x804040);0xfbfcfd)
GUICtrlSetFont(-1, 11, 800, 0, "微软雅黑")
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "btnMin")
$btnClose = GUICtrlCreateLabel("X", $iWidtha - 425, 2, 25, 22, $SS_CENTER);╋
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetFont(-1, 14, 600, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetCursor(-1, 0)
GUICtrlSetOnEvent(-1, "btnClose")
$Label1 = GUICtrlCreateLabel("鼠标位置---安装", $iWidtha - 900, $iHeighta - 193, 300, 17)
GUICtrlSetColor(-1, 0x0000FF)
GUICtrlSetFont(-1, 12, 600, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, -2)
GUICtrlSetCursor(-1, 0)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
;$IDButton2 = GUICtrlCreateButton("设置图片", $iWidtha - 600, $iHeighta - 203, 75, 22, 0)
;GUICtrlSetOnEvent($IDButton2, "_Form2")
$IDButton2 = GUICtrlCreateButton("显示图片", $iWidtha - 500, $iHeighta - 203, 75, 22, 0)
GUICtrlSetOnEvent($IDButton2, "IDExample")
GUISetState(@SW_SHOW, $Form1)
_Pica()
EndFunc ;==>GUIForm1
Func _click1()
;Case $GUI_EVENT_MOUSEMOVE
Local $A = GUIGetCursorInfo($Form1)
If Not @error Then
If $A[0] > -1 And $A[0] < 1600 And $A[1] > -1 And $A[1] < 570 Then
GUICtrlSetData($Label1, "(鼠标位置: " & Int($A[0]) & "," & Int($A[1]) & ") --- 安装A")
MsgBox(0, ' 安装1', ' 安装A', 2)
EndIf
EndIf
EndFunc ;==>_click1
Func _click2()
Local $A = GUIGetCursorInfo($Form1)
If Not @error Then
If $A[0] > -1 And $A[0] < 1600 And $A[1] > -1 And $A[1] < 570 Then
GUICtrlSetData($Label1, "(鼠标位置: " & Int($A[0]) & "," & Int($A[1]) & ") --- 安装B")
;MsgBox(0, ' 安装2', ' 安装B', 2)
EndIf
EndIf
EndFunc ;==>_click2
Func _click3()
Local $A = GUIGetCursorInfo($Form1)
If Not @error Then
If $A[0] > -1 And $A[0] < 1600 And $A[1] > -1 And $A[1] < 570 Then
GUICtrlSetData($Label1, "(鼠标位置: " & Int($A[0]) & "," & Int($A[1]) & ") --- 安装C")
;MsgBox(0, ' 安装3', ' 安装C', 2)
EndIf
EndIf
EndFunc ;==>_click3
Func _click4()
Local $A = GUIGetCursorInfo($Form1)
If Not @error Then
If $A[0] > -1 And $A[0] < 1600 And $A[1] > -1 And $A[1] < 570 Then
GUICtrlSetData($Label1, "(鼠标位置: " & Int($A[0]) & "," & Int($A[1]) & ") --- 安装D")
;MsgBox(0, ' 安装4', ' 安装D', 2)
EndIf
EndIf
EndFunc ;==>_click4
Func _click5()
Local $A = GUIGetCursorInfo($Form1)
If Not @error Then
If $A[0] > -1 And $A[0] < 1600 And $A[1] > -1 And $A[1] < 570 Then
GUICtrlSetData($Label1, "(鼠标位置: " & Int($A[0]) & "," & Int($A[1]) & ") --- 安装E")
;MsgBox(0, ' 安装5', ' 安装E', 2)
EndIf
EndIf
EndFunc ;==>_click5
Func _click6()
Local $A = GUIGetCursorInfo($Form1)
If Not @error Then
If $A[0] > -1 And $A[0] < 1600 And $A[1] > -1 And $A[1] < 570 Then
GUICtrlSetData($Label1, "(鼠标位置: " & Int($A[0]) & "," & Int($A[1]) & ") --- 安装F")
;MsgBox(0, ' 安装6', ' 安装F', 2)
EndIf
EndIf
EndFunc ;==>_click6
Func IDExample()
FileDelete(@ScriptDir & "\GDIPlus_Image.jpg")
FileDelete(@ScriptDir & "\GDIPlus_Image.png")
; 捕获窗口
_ScreenCapture_CaptureWnd(@ScriptDir & "\GDIPlus_Image.png", $Form1, 0, 28, $iWidtha - 400, $iHeighta - 203)
_ScreenCapture_CaptureWnd(@ScriptDir & "\GDIPlus_Image.jpg", $Form1, 0, 0, $iWidtha - 400, $iHeighta - 203)
ShellExecute(@ScriptDir & "\GDIPlus_Image.png")
EndFunc ;==>IDExample
Func btnClose()
GUIDelete()
Exit
EndFunc ;==>btnClose
Func btnMin()
WinSetState($Form1, "", @SW_MINIMIZE)
EndFunc ;==>btnMin
#include "_Pica.au3"