Hallo Leute,
ich wollte mir einige Funktionen zusammenbasteln, um Markierungen auf allen möglichen Fenstern anzuzeigen. Als Alternative zu Videotutorials, soll das Anlernen neuer Arbeitsvorgänge an einem konkret vorliegendem Fall möglich sein. Markierungen und Text-/Audioanleitungen sollen dabei unterstützen.
Erst wollte ich es ganz ohne GDI+ machen, weil ich davon keine Ahnung habe. Mit GDI+ könnte ich aber auch Pfeile nutzen oder die Boxen variieren. Allerdings krampfe mir da einen ab. Kennt jemand hier vielleicht ein schon bestehendes Projekt, das ich nutzen kann?
Bei meinem ersten Versuch blenden die Boxen schön aus (_WinAPI_AnimateWindow($aDeleteHandles[$i], BitOR($AW_BLEND, $AW_HIDE), 500) Zeile 221).
Wie kann man das mit GDI+ machen?
Zur Veranschaulichung mal meine beiden Versuche. Es gibt mehrere Beispiele (auskommentiert).
Ohne GDI+
Spoiler anzeigen
; Zu den Funktionen __HintBoxes_GuiHole und __HintBoxes_AddCtrlRegion siehe Hilfe etwa zu _WinAPI_CreateRoundRectRgn
#include-once
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <WinAPISys.au3>
#include <Array.au3>
;~ Example1()
;~ Example2()
;~ Example3()
Example4()
Func Example1()
MsgBox(0, "Beispiel 1", "Zwei Markierungen werden um angegebene Positionen mit einem Timeout von 2 Sekunden angezeigt.")
Local $aCoords[2][5] = [[50, 50, 100, 200, 0xFFE9A2], [500, 500, 300, 500, 0x616161]]
Local $hBox = _HintBoxes_By_Pos($aCoords, 15, 1000)
EndFunc ;==>Example1
Func Example2()
MsgBox(0, "Beispiel 2", "Der Editor wird geöffnet und ein Markierung darum mit einem Timeout von 1 Sekunde angezeigt.")
Run("notepad.exe")
WinWait("[CLASS:Notepad]", "", 10)
Local $hWnd = WinGetHandle("[CLASS:Notepad]")
_HintBoxes_By_Handle($hWnd, "", 10, 1000)
WinClose("[CLASS:Notepad]")
EndFunc ;==>Example2
Func Example3()
MsgBox(0, "Beispiel 3", "Eine GUI wird eingeblendet und zwei Markierungen in unterschiedlichen Farben mit einem Timeout von 2 Sekunden angezeigt.")
Local $hGui = GUICreate("Test", 350, 210)
Local $id_Input = GUICtrlCreateInput("", 20, 30, 200, 25)
Local $id_Input2 = GUICtrlCreateInput("", 20, 60, 200, 25)
GUISetState(@SW_SHOW)
Local $aControlIDs[2] = [$id_Input, $id_Input2]
Local $aColors[2] = [0xFFE9A2, 0x616161]
_HintBoxes_By_Handle($hGui, $aControlIDs, 5, 2000, $aColors)
GUIDelete($hGui)
EndFunc ;==>Example3
Func Example4()
Local $hGui = GUICreate("Test", 350, 210)
Local $id_Input = GUICtrlCreateInput("", 20, 30, 200, 25)
Local $id_Button_Show = GUICtrlCreateButton("1. Marker einblenden", 25, 170, 120, 25)
Local $id_Button_Hide = GUICtrlCreateButton("Alle Marker ausblenden", 180, 170, 140, 25)
GUISetState(@SW_SHOW)
Local $hBox1, $hBox2, $iCounter = 1
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $id_Button_Show
If $iCounter = 1 Then
$hBox1 = _HintBoxes_By_Handle($hGui, $id_Input, 5, 0, 0xFFE9A2)
GUICtrlSetData($id_Button_Show, "2. Marker einblenden")
$iCounter += 1
ElseIf $iCounter = 2 Then
$hBox2 = _HintBoxes_By_Handle($hGui, "", 5, 0, 0x616161)
GUICtrlSetData($id_Button_Show, "2. Marker löschen")
$iCounter += 1
Else
_Delete_HintBoxes($hBox2)
GUICtrlSetData($id_Button_Show, "2. Marker einblenden")
$iCounter -= 1
EndIf
Case $id_Button_Hide
_Delete_HintBoxes()
GUICtrlSetData($id_Button_Show, "1. Marker einblenden")
$iCounter = 1
EndSwitch
WEnd
GUIDelete($hGui)
EndFunc ;==>Example4
Func _HintBoxes_By_Handle($hWnd, $vControls = "", $iStrength = 5, $iDuration = 2000, $vColor = 0xB10000)
Local $aPos = WinGetPos($hWnd)
; get height of window title and width of window frame - may be different when XP theme is ON/OFF
Local $g_iHtit = _WinAPI_GetSystemMetrics($SM_CYCAPTION)
Local $g_iFrame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME)
Local $hGui = GUICreate("", $aPos[2] + $iStrength * 4, $aPos[3] + $iStrength * 4, $aPos[0] - $iStrength * 2, $aPos[1] - $iStrength * 2, -1, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
__HintBoxes_HandlesArray($hGui)
If IsArray($vControls) Then
If Not IsArray($vColor) Then Return 0
If UBound($vControls) <> UBound($vColor) Then Return 0
Local $aControls[UBound($vControls)], $aColor[UBound($vColor)]
For $i = 0 To UBound($vControls) - 1
$aControls[$i] = $vControls[$i]
$aColor[$i] = $vColor[$i]
Next
Local $ah_LabelIDs[UBound($vControls) * 4]
Else
Local $ah_LabelIDs[4]
Local $aControls[1], $aColor[1]
$aControls[0] = $vControls
$aColor[0] = $vColor
If $vControls = "" Then
WinMove($hGui, "", $aPos[0] - $iStrength * 2, $aPos[1] - $iStrength * 2 - $g_iHtit - $g_iFrame)
$aPos[0] = 0
$aPos[1] = 0
$aPos[3] = $aPos[3]
EndIf
EndIf
For $i = 0 To UBound($aControls) - 1
If $vControls <> "" Then
$aPos = ControlGetPos($hWnd, "", $aControls[$i])
EndIf
$ah_LabelIDs[$i * 4] = GUICtrlCreateLabel("", $aPos[0] + $iStrength, $aPos[1] + $iStrength, $iStrength, $aPos[3] + $iStrength) ; Left
GUICtrlSetBkColor(-1, $aColor[$i])
$ah_LabelIDs[$i * 4 + 1] = GUICtrlCreateLabel("", $aPos[0] + $iStrength, $aPos[1] + $iStrength, $aPos[2] + $iStrength, $iStrength) ; Top
GUICtrlSetBkColor(-1, $aColor[$i])
$ah_LabelIDs[$i * 4 + 2] = GUICtrlCreateLabel("", $aPos[0] + $aPos[2] + $iStrength, $aPos[1] + $iStrength, $iStrength, $aPos[3] + $iStrength) ; Right
GUICtrlSetBkColor(-1, $aColor[$i])
$ah_LabelIDs[$i * 4 + 3] = GUICtrlCreateLabel("", $aPos[0] + $iStrength, $aPos[1] + $aPos[3] + $iStrength, $aPos[2] + $iStrength, $iStrength) ; Bottom
GUICtrlSetBkColor(-1, $aColor[$i])
Next
__HintBoxes_GuiHole($hGui, 0, 0, $aPos[2], $aPos[3], $ah_LabelIDs, $g_iHtit, $g_iFrame)
WinActivate($hWnd)
GUISetState(@SW_SHOWNA)
If $iDuration = 0 Then Return $hGui
Sleep($iDuration)
_Delete_HintBoxes($hGui)
EndFunc ;==>_HintBoxes_By_Handle
Func _HintBoxes_By_Pos($aAreas, $iStrength = 5, $iDuration = 2000)
If Not IsArray($aAreas) Then Return 0
Local $iCols = UBound($aAreas, $UBOUND_COLUMNS)
If $iCols < 4 Then Return 0
Local $hexColorDefault = 0xB10000, $hexColor, $bColors = False
If $iCols = 5 Then $bColors = True
Local $iWidth = @DesktopWidth
Local $iHeight = @DesktopHeight
Local $hGui = GUICreate("", $iWidth, $iHeight, 0, 0, -1, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
__HintBoxes_HandlesArray($hGui)
Local $g_iHtit = _WinAPI_GetSystemMetrics($SM_CYCAPTION)
Local $g_iFrame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME)
Local $ah_LabelIDs[UBound($aAreas) * 4]
For $i = 0 To UBound($aAreas) - 1
If $bColors Then
If $aAreas[$i][4] <> "" Then
$hexColor = $aAreas[$i][4]
Else
$hexColor = $hexColorDefault
EndIf
Else
$hexColor = $hexColorDefault
EndIf
$ah_LabelIDs[$i * 4] = GUICtrlCreateLabel("", $aAreas[$i][0] - $iStrength * 2 + $iStrength * 2, $aAreas[$i][1] - $iStrength * 2 + $iStrength * 2, $iStrength, $aAreas[$i][3] + $iStrength * 4) ; Left
GUICtrlSetBkColor(-1, $hexColor)
$ah_LabelIDs[$i * 4 + 1] = GUICtrlCreateLabel("", $aAreas[$i][0] - $iStrength + $iStrength * 2, $aAreas[$i][1] - $iStrength * 2 + $iStrength * 2, $aAreas[$i][2] + $iStrength * 2, $iStrength) ; Top
GUICtrlSetBkColor(-1, $hexColor)
$ah_LabelIDs[$i * 4 + 2] = GUICtrlCreateLabel("", $aAreas[$i][0] + $aAreas[$i][2] + $iStrength + $iStrength * 2, $aAreas[$i][1] - $iStrength * 2 + $iStrength * 2, $iStrength, $aAreas[$i][3] + $iStrength * 4) ; Right
GUICtrlSetBkColor(-1, $hexColor)
$ah_LabelIDs[$i * 4 + 3] = GUICtrlCreateLabel("", $aAreas[$i][0] - $iStrength + $iStrength * 2, $aAreas[$i][1] + $aAreas[$i][3] + $iStrength + $iStrength * 2, $aAreas[$i][2] + $iStrength * 2, $iStrength) ; Bottom
GUICtrlSetBkColor(-1, $hexColor)
Next
__HintBoxes_GuiHole($hGui, 0, 0, $iWidth, $iHeight, $ah_LabelIDs, $g_iHtit, $g_iFrame)
GUISetState(@SW_SHOWNA)
If $iDuration = 0 Then Return $hGui
Sleep($iDuration)
_Delete_HintBoxes($hGui)
EndFunc ;==>_HintBoxes_By_Pos
Func _Delete_HintBoxes($hGui = "")
If $hGui = "" Then
Local $aDeleteHandles = __HintBoxes_HandlesArray("", False)
Else
Local $aDeleteHandles = __HintBoxes_HandlesArray($hGui, False)
EndIf
If Not @error Then
For $i = 0 To UBound($aDeleteHandles) - 1
_WinAPI_AnimateWindow($aDeleteHandles[$i], BitOR($AW_BLEND, $AW_HIDE), 500)
Next
EndIf
EndFunc ;==>_Delete_HintBoxes
Func __HintBoxes_GuiHole($hWin, $iX, $iY, $iSizeW, $iSizeH, $ah_LabelIDs, $g_iHtit = 0, $g_iFrame = 0)
Local $hOuter_rgn, $hInner_rgn, $hCombined_rgn
$hOuter_rgn = _WinAPI_CreateRectRgn(0, 0, $iSizeW, $iSizeH)
$hInner_rgn = _WinAPI_CreateRectRgn($iX, $iY, $iX + $iSizeW, $iY + $iSizeH)
$hCombined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0)
_WinAPI_CombineRgn($hCombined_rgn, $hOuter_rgn, $hInner_rgn, $RGN_DIFF)
_WinAPI_DeleteObject($hOuter_rgn)
_WinAPI_DeleteObject($hInner_rgn)
For $i = 0 To UBound($ah_LabelIDs) - 1
__HintBoxes_AddCtrlRegion($hCombined_rgn, $ah_LabelIDs[$i], $hWin, $g_iHtit, $g_iFrame)
Next
_WinAPI_SetWindowRgn($hWin, $hCombined_rgn)
EndFunc ;==>__HintBoxes_GuiHole
Func __HintBoxes_AddCtrlRegion($hFull_rgn, $idCtrl, $hWin, $g_iHtit, $g_iFrame)
Local $aCtrl_pos, $hCtrl_rgn
$aCtrl_pos = ControlGetPos($hWin, "", $idCtrl)
$hCtrl_rgn = _WinAPI_CreateRectRgn($aCtrl_pos[0] + $g_iFrame, $aCtrl_pos[1] + $g_iHtit + $g_iFrame, _
$aCtrl_pos[0] + $aCtrl_pos[2] + $g_iFrame, $aCtrl_pos[1] + $aCtrl_pos[3] + $g_iHtit + $g_iFrame)
_WinAPI_CombineRgn($hFull_rgn, $hFull_rgn, $hCtrl_rgn, $RGN_OR)
_WinAPI_DeleteObject($hCtrl_rgn)
EndFunc ;==>__HintBoxes_AddCtrlRegion
Func __HintBoxes_HandlesArray($hGui = "", $bAdd = True)
Local Static $aHandles[0]
If $bAdd Then
_ArrayAdd($aHandles, $hGui)
Else
If $hGui = "" Then
Local $aDeleteHandles = $aHandles
ReDim $aHandles[0]
Return $aDeleteHandles
Else
$iIndex = _ArraySearch($aHandles, $hGui)
If Not @error Then
Local $aDeleteHandles[1] = [$aHandles[$iIndex]]
_ArrayDelete($aHandles, $iIndex)
Return $aDeleteHandles
Else
Return SetError(1)
EndIf
EndIf
EndIf
EndFunc ;==>__HintBoxes_HandlesArray
Alles anzeigen
Mit GDI+
Spoiler anzeigen
_GDIPlus_Startup()
;~ Example1()
;~ Example2()
;~ Example3()
Example4()
Func Example1()
MsgBox(0, "Beispiel 1", "Zwei Markierungen werden um angegebene Positionen mit einem Timeout von 2 Sekunden angezeigt.")
Local $aCoords[2][5] = [[50, 50, 100, 200, 0xFFFF0000], [500, 500, 300, 500, 0xFF000000]]
Local $hBox = _HintBoxes_By_Pos($aCoords, 15, 1000)
EndFunc ;==>Example1
Func Example2()
MsgBox(0, "Beispiel 2", "Der Editor wird geöffnet und ein Markierung darum mit einem Timeout von 1 Sekunde angezeigt.")
Run("notepad.exe")
WinWait("[CLASS:Notepad]", "", 10)
Local $hWnd = WinGetHandle("[CLASS:Notepad]")
_HintBoxes_By_Handle($hWnd, "", 10, 1000)
WinClose("[CLASS:Notepad]")
EndFunc ;==>Example2
Func Example3()
MsgBox(0, "Beispiel 3", "Eine GUI wird eingeblendet und zwei Markierungen in unterschiedlichen Farben mit einem Timeout von 2 Sekunden angezeigt.")
Local $hGui = GUICreate("Test", 350, 210)
Local $id_Input = GUICtrlCreateInput("", 20, 30, 200, 25)
Local $id_Input2 = GUICtrlCreateInput("", 20, 60, 200, 25)
GUISetState(@SW_SHOW)
Local $aControlIDs[2] = [$id_Input, $id_Input2]
Local $aColors[2] = [0xFF8080FF, 0xFFFF0000]
_HintBoxes_By_Handle($hGui, $aControlIDs, 5, 2000, $aColors)
GUIDelete($hGui)
EndFunc ;==>Example3
Func Example4()
Local $hGui = GUICreate("Test", 350, 210)
Local $id_Input = GUICtrlCreateInput("", 20, 30, 200, 25)
Local $id_Button_Show = GUICtrlCreateButton("1. Marker einblenden", 25, 170, 120, 25)
Local $id_Button_Hide = GUICtrlCreateButton("Alle Marker ausblenden", 180, 170, 140, 25)
GUISetState(@SW_SHOW)
Local $hBox1, $hBox2, $iCounter = 1
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $id_Button_Show
If $iCounter = 1 Then
$hBox1 = _HintBoxes_By_Handle($hGui, $id_Input, 5, 0, 0xFF8080FF)
GUICtrlSetData($id_Button_Show, "2. Marker einblenden")
$iCounter += 1
ElseIf $iCounter = 2 Then
$hBox2 = _HintBoxes_By_Handle($hGui, "", 5, 0, 0xFF000000)
GUICtrlSetData($id_Button_Show, "2. Marker löschen")
$iCounter += 1
Else
_Delete_HintBoxes($hBox2)
GUICtrlSetData($id_Button_Show, "2. Marker einblenden")
$iCounter -= 1
EndIf
Case $id_Button_Hide
_Delete_HintBoxes()
GUICtrlSetData($id_Button_Show, "1. Marker einblenden")
$iCounter = 1
EndSwitch
WEnd
GUIDelete($hGui)
EndFunc ;==>Example4
Func _HintBoxes_By_Handle($hWnd, $vControls = "", $iStrength = 5, $iDuration = 2000, $vColor = 0xFFFF0000)
Local $aPos = WinGetPos($hWnd)
; get height of window title and width of window frame - may be different when XP theme is ON/OFF -- siehe Hilfe etwa zu _WinAPI_CreateRoundRectRgn
Local $g_iHtit = _WinAPI_GetSystemMetrics($SM_CYCAPTION)
Local $g_iFrame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME)
Local $hGui = GUICreate("", $aPos[2] + $iStrength * 4, $aPos[3] + $iStrength * 4, $aPos[0] - $iStrength * 2, $aPos[1] - $iStrength * 2, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TRANSPARENT), $hWnd)
GUISetBkColor(0xABCDEF, $hGui)
_WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
GUISetState(@SW_SHOWNA)
__HintBoxes_HandlesArray($hGui)
If IsArray($vControls) Then
If Not IsArray($vColor) Then Return 0
If UBound($vControls) <> UBound($vColor) Then Return 0
Local $aControls[UBound($vControls)], $aColor[UBound($vColor)]
For $i = 0 To UBound($vControls) - 1
$aControls[$i] = $vControls[$i]
$aColor[$i] = $vColor[$i]
Next
Local $ah_LabelIDs[UBound($vControls) * 4]
Else
Local $ah_LabelIDs[4]
Local $aControls[1], $aColor[1]
$aControls[0] = $vControls
$aColor[0] = $vColor
If $vControls = "" Then
WinMove($hGui, "", $aPos[0] - $iStrength, $aPos[1] - $iStrength - $g_iHtit - $g_iFrame, $aPos[2] + $iStrength * 4, $aPos[3] + $iStrength * 4 + $g_iHtit + $g_iFrame)
$aPos[0] = 0
$aPos[1] = 0
$aPos[2] = $aPos[2] - $iStrength
$aPos[3] = $aPos[3] - $iStrength
EndIf
EndIf
Local $hPen, $hGraphics, $nX, $nY, $nWidth, $nHeight
For $i = 0 To UBound($aControls) - 1
If $vControls <> "" Then
$aPos = ControlGetPos($hWnd, "", $aControls[$i])
EndIf
$hPen = _GDIPlus_PenCreate($aColor[$i], $iStrength)
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
$nX = $aPos[0] + $iStrength + $g_iFrame
$nY = $aPos[1] + $iStrength + $g_iHtit + $g_iFrame
$nWidth = $aPos[2] + $iStrength - $g_iFrame
$nHeight = $aPos[3] + $iStrength - $g_iFrame
_GDIPlus_GraphicsDrawRect($hGraphics, $nX, $nY, $nWidth, $nHeight, $hPen)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_PenDispose($hPen)
Next
WinActivate($hWnd)
If $iDuration = 0 Then Return $hGui
Sleep($iDuration)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_PenDispose($hPen)
_Delete_HintBoxes($hGui)
EndFunc ;==>_HintBoxes_By_Handle
Func _HintBoxes_By_Pos($aAreas, $iStrength = 5, $iDuration = 2000)
If Not IsArray($aAreas) Then Return 0
Local $iCols = UBound($aAreas, $UBOUND_COLUMNS)
If $iCols < 4 Then Return 0
Local $hexColorDefault = 0xB10000, $hexColor, $bColors = False
If $iCols = 5 Then $bColors = True
Local $iWidth = @DesktopWidth
Local $iHeight = @DesktopHeight
; get height of window title and width of window frame - may be different when XP theme is ON/OFF -- siehe Hilfe etwa zu _WinAPI_CreateRoundRectRgn
Local $g_iHtit = _WinAPI_GetSystemMetrics($SM_CYCAPTION)
Local $g_iFrame = _WinAPI_GetSystemMetrics($SM_CXDLGFRAME)
Local $hGui = GUICreate("", $iWidth, $iHeight, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TRANSPARENT, $WS_EX_TOOLWINDOW))
GUISetBkColor(0xABCDEF, $hGui)
_WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF, 255)
GUISetState(@SW_SHOWNA)
__HintBoxes_HandlesArray($hGui)
Local $ah_LabelIDs[UBound($aAreas) * 4]
For $i = 0 To UBound($aAreas) - 1
If $bColors Then
If $aAreas[$i][4] <> "" Then
$hexColor = $aAreas[$i][4]
Else
$hexColor = $hexColorDefault
EndIf
Else
$hexColor = $hexColorDefault
EndIf
Local $hPen = _GDIPlus_PenCreate($hexColor, $iStrength)
Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
Local $nX = $aAreas[$i][0] + $iStrength + $g_iFrame
Local $nY = $aAreas[$i][1] + $iStrength + $g_iHtit + $g_iFrame
Local $nWidth = $aAreas[$i][2] + $iStrength + $g_iFrame
Local $nHeight = $aAreas[$i][3] + $iStrength + $g_iFrame
_GDIPlus_GraphicsDrawRect($hGraphics, $nX, $nY, $nWidth, $nHeight, $hPen)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_PenDispose($hPen)
Next
GUISetState(@SW_SHOWNA)
If $iDuration = 0 Then Return $hGui
Sleep($iDuration)
_Delete_HintBoxes($hGui)
EndFunc ;==>_HintBoxes_By_Pos
Func _Delete_HintBoxes($hGui = "")
If $hGui = "" Then
Local $aDeleteHandles = __HintBoxes_HandlesArray("", False)
Else
Local $aDeleteHandles = __HintBoxes_HandlesArray($hGui, False)
EndIf
If Not @error Then
For $i = 0 To UBound($aDeleteHandles) - 1
;~ _WinAPI_AnimateWindow($aDeleteHandles[$i], BitOR($AW_BLEND, $AW_HIDE), 500) ; funktioniert nicht.
GUIDelete($aDeleteHandles[$i])
Next
EndIf
EndFunc ;==>_Delete_HintBoxes
Func __HintBoxes_GuiHole($hWin, $iX, $iY, $iSizeW, $iSizeH, $ah_LabelIDs, $g_iHtit = 0, $g_iFrame = 0)
Local $hOuter_rgn, $hInner_rgn, $hCombined_rgn
$hOuter_rgn = _WinAPI_CreateRectRgn(0, 0, $iSizeW, $iSizeH)
$hInner_rgn = _WinAPI_CreateRectRgn($iX, $iY, $iX + $iSizeW, $iY + $iSizeH)
$hCombined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0)
_WinAPI_CombineRgn($hCombined_rgn, $hOuter_rgn, $hInner_rgn, $RGN_DIFF)
_WinAPI_DeleteObject($hOuter_rgn)
_WinAPI_DeleteObject($hInner_rgn)
For $i = 0 To UBound($ah_LabelIDs) - 1
__HintBoxes_AddCtrlRegion($hCombined_rgn, $ah_LabelIDs[$i], $hWin, $g_iHtit, $g_iFrame)
Next
_WinAPI_SetWindowRgn($hWin, $hCombined_rgn)
EndFunc ;==>__HintBoxes_GuiHole
Func __HintBoxes_AddCtrlRegion($hFull_rgn, $idCtrl, $hWin, $g_iHtit, $g_iFrame)
Local $aCtrl_pos, $hCtrl_rgn
$aCtrl_pos = ControlGetPos($hWin, "", $idCtrl)
$hCtrl_rgn = _WinAPI_CreateRectRgn($aCtrl_pos[0] + $g_iFrame, $aCtrl_pos[1] + $g_iHtit + $g_iFrame, _
$aCtrl_pos[0] + $aCtrl_pos[2] + $g_iFrame, $aCtrl_pos[1] + $aCtrl_pos[3] + $g_iHtit + $g_iFrame)
_WinAPI_CombineRgn($hFull_rgn, $hFull_rgn, $hCtrl_rgn, $RGN_OR)
_WinAPI_DeleteObject($hCtrl_rgn)
EndFunc ;==>__HintBoxes_AddCtrlRegion
Func __HintBoxes_HandlesArray($hGui = "", $bAdd = True)
Local Static $aHandles[0]
If $bAdd Then
_ArrayAdd($aHandles, $hGui)
Else
If $hGui = "" Then
Local $aDeleteHandles = $aHandles
ReDim $aHandles[0]
Return $aDeleteHandles
Else
$iIndex = _ArraySearch($aHandles, $hGui)
If Not @error Then
Local $aDeleteHandles[1] = [$aHandles[$iIndex]]
_ArrayDelete($aHandles, $iIndex)
Return $aDeleteHandles
Else
Return SetError(1)
EndIf
EndIf
EndIf
EndFunc ;==>__HintBoxes_HandlesArray
Alles anzeigen