Hey Com.
Eine kleine Frage:
Ist es möglich dort wo die System-Buttons (Minimieren, Maximieren, Schliessen) sind einen eigenen Button zu erstellen?
lg,
Blume
Hey Com.
Eine kleine Frage:
Ist es möglich dort wo die System-Buttons (Minimieren, Maximieren, Schliessen) sind einen eigenen Button zu erstellen?
lg,
Blume
eine kleine Antwort: ja
#include <GUIConstants.au3>
#include <ButtonConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <Constants.au3>
#region - GUI Create
DllCall("UxTheme.dll","int","SetThemeAppProperties","dword",0)
$GUI = GUICreate('PopUp',16,14,-1,1,$WS_POPUP,$WS_EX_TOPMOST+$WS_EX_TOOLWINDOW)
GUISetBkColor(_WinAPI_GetSysColor($COLOR_ACTIVEBORDER))
$Button = GUICtrlCreateButton("2",0,0,16,14,$BS_CENTER)
GUICtrlSetFont(-1,12,400,0,"Wingdings")
DllCall("UxTheme.dll","int","SetThemeAppProperties","dword",3)
GUISetState(@SW_SHOWNOACTIVATE)
#endregion
$hwnd = -1
$w = 0
CheckWin()
AdlibRegister("CheckWin",100)
#region - GUI SelectLoop
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button
MsgBox(0, '', "hi")
WinActivate($hwnd)
Case $hwnd <> $GUI And WinExists($hwnd)
$pos = WinGetPos($hwnd)
WinMove($GUI,"",$pos[0]+$pos[2]-$w,$pos[1]+6)
EndSelect
WEnd
#endregion
Func CheckWin()
Local $hwnd1 = WinGetHandle("")
If $hwnd1 <> $GUI And $hwnd <> $hwnd1 Then
Global $hwnd = $hwnd1
$Style = _WinAPI_GetWindowLong($hwnd,$GWL_STYLE)
$w = 5
If BitAND($Style,$WS_MINIMIZEBOX) Then $w += 30
If BitAND($Style,$WS_SYSMENU) Then $w += 70
If BitAND($Style,$WS_MAXIMIZEBOX) Then $w += 30
EndIf
EndFunc
Ein dickes Dankeschön