Okay, jetzt komm kein Fehler mehr, aber es funktioniert auch nicht, das einzige was passiert sit das meine transparenz nicht emhr stimmt und ich wieder einen schwarzen rand habe
Spoiler anzeigen
#include <Constants.au3>
#include <WindowsConstants.au3>
#Include <WinAPI.au3>
$hGui = GUICreate ("Smily",15,15,0,0,-2147483648+0x08000000,$WS_EX_LAYERED+0x00000080+0x00000008)
GUISetBkColor (0x000000)
$hBmp = GUICtrlCreatePic ("i.bmp",0,0,15,15)
DllCall("user32.dll", "int", "SetLayeredWindowAttributes", "hwnd", $hGui, "long", 0x000000, "byte", 255, "long", 0x03)
GUISetState (@SW_SHOW)
_Win_SetClickThrough ($hGui)
While 1
Switch GUIGetMsg ()
Case -3
Exit
EndSwitch
Sleep (1)
$Pos = MouseGetPos()
WinMove ($hGui,"",$Pos[0] -7,$Pos[1] -7)
WEnd
;
; Function Name: _Win_SetClickThrough($hWnd,$noclic = True)
; Description:: Makes a window to not receive mouse input
; Parameter(s): $title -> Title or hWnd of Window
; $text [Optional] -> Text in Window
; $noclic [Optional] -> If False, the window regains MouseInput otherwise it will loose it, defalut: True
; Requirement(s): <WINApi.au3>
; Return Value(s): Success: 1, Error0 and @error
; @error Values: 1 -> Window does not exist
; 2 -> Error in Setting the Styles
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _Win_SetClickThrough($title,$text = "",$noclic = True)
Local $hWnd = WinGetHandle($title,$text)
If @error Then Return SetError(1,0,0)
If $noclic Then
_WinAPI_SetWindowLong($hWnd,$GWL_EXSTYLE,BitOR(_WinAPI_GetWindowLong($hWnd,$GWL_EXSTYLE),$WS_EX_TRANSPARENT))
If @error Then Return SetError(2,0,0)
WinSetTrans($hWnd,"",255) ; Sets the Layered Attribute, but still shows the window ![]()
If @error Then Return SetError(2,0,0)
Else
_WinAPI_SetWindowLong($hWnd,$GWL_EXSTYLE,BitAND(_WinAPI_GetWindowLong($hWnd,$GWL_EXSTYLE),BitNOT($WS_EX_TRANSPARENT)))
If @error Then Return SetError(2,0,0)
EndIf
Return 1
EndFunc
;### UDF END