Jump to content

GhostGui


ioa747
 Share

Recommended Posts

GhostGui - masks the window and makes it darker

on this example put in the same directory GhostGui.au3 and AutoItHelp.au3 then run the _AutoItHelp.au3

press F1 to activate the help. With ALT + mouse wheel scroll you can adjust

 

GhostGui.au3

; https://www.autoitscript.com/forum/topic/209769-ghostgui/
;------------------------------------------------------------------------------
; Title...........: GhostGui.au3
; Description.....: masks the window and makes it darker with ALT + mouse wheel scroll  ; ALT key in Line 199
;------------------------------------------------------------------------------
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <WinAPISys.au3>
#include <WinAPIConstants.au3>

Global $GToolstate = 0, $GToolTimer
Global $iParams
$iParams = $CmdLine[0]
If Not $iParams Then
    MsgBox(0, "* This is an example...", "This means that you have run the" & @CRLF & @CRLF _
             & "    -->  " & @ScriptName & "  <--  " & @CRLF & @CRLF _
             & "without command line parameters." & @CRLF _
             & "and for this reason go to test mode." & @CRLF & @CRLF _
             & "First select the windows you want to act" & @CRLF _
             & "and then press OK." & @CRLF _
             & "Act with ALT key + WHEEL UP/DOWN")


    Global $iParams[4] = [3, '[ACTIVE]', 0x000000, 125]
    ;GhostGUI($HosthWnd, $BackColor = 0x000000, $Transparency = 125)
Else
    $iParams = $CmdLine
EndIf

If _Singleton($iParams[1], 1) = 0 Then Exit ; to avoid running it multiple times!

;Mouse hook ;---------------------------------------------------------------------------
Global $mX, $mY, $mEvent
Global $hDLL = DllOpen("user32.dll")
Global $hHook, $hStub_KeyProc, $hmod, $tmpTrack, $WheelTrack = 0
$hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
$hmod = _WinAPI_GetModuleHandle(0)
$hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod)
;----------------------------------------------------------------------------------------
Global $hGhostGUI, $hWnd

GhostGUI($iParams[1], $iParams[2], $iParams[3])
;call GhostGUI($HosthWnd, $BackColor = 0x000000, $Transparency = 125)

GoToExit()
;----------------------------------------------------------------------------------------
Func GoToExit()    ; exit & Cleanup
    Cleanup()
    Exit
EndFunc   ;==>GoToExit
;----------------------------------------------------------------------------------------
Func Cleanup()    ; Cleanup dll callback
    _WinAPI_UnhookWindowsHookEx($hHook)
    DllCallbackFree($hStub_KeyProc)
EndFunc   ;==>Cleanup
;----------------------------------------------------------------------------------------
Func ScripExit()
    If WinActive($hWnd) Then GoToExit()
EndFunc   ;==>ScripExit
;----------------------------------------------------------------------------------------

Func GhostGUI($HosthWnd, $BackColor = 0x000000, $Transparency = 125)
    $hWnd = WinWait($HosthWnd)
    $hGhostGUI = GUICreate('GhostGUI', 200, 200, -200, -200, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TRANSPARENT, $hWnd)
    GUISetBkColor($BackColor)
    WinSetTrans($hGhostGUI, '', $Transparency)
    $WheelTrack = $Transparency
    Local $HWPos0, $HWPos[4] ; [0]=X  [1]=Y  [2]=Width  [3]=Height

    $GToolTimer = TimerInit()
    HotKeySet("{ESC}", "ScripExit")

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGhostGUI)

    WinActivate($hWnd)

    Local $gtooltiptmptxt = "press  ESC to terminate." & @CRLF & "Act with ALT key + WHEEL UP/DOWN"

    ;*******************************************
    While 1
        If $GToolstate = 0 Then
            ToolTip("Transparency " & $WheelTrack & @CRLF & $gtooltiptmptxt _
                    , MouseGetPos(0), MouseGetPos(1) + 32, "info", 1)
            If TimerDiff($GToolTimer) > 4000 Then
                $GToolstate = 2
                $gtooltiptmptxt = ""
                ToolTip("")
            EndIf
        EndIf

        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch

        If WinExists($hWnd) Then
            $HWPos0 = WinGetPos($hWnd)

            $HWPos[0] = $HWPos0[0] + 7
            $HWPos[1] = $HWPos0[1]
            $HWPos[2] = $HWPos0[2] - 14
            $HWPos[3] = $HWPos0[3] - 7

            WinMove($hGhostGUI, "", $HWPos[0], $HWPos[1], $HWPos[2], $HWPos[3])
        Else
            ExitLoop
        EndIf

        MouseAct()

        Sleep(100)
    WEnd
    ;*******************************************

    ; Delete the previous GUI and all controls.
    GUIDelete($hGhostGUI)

EndFunc   ;==>GhostGUI
;----------------------------------------------------------------------------------------
Func _KeyProc($nCode, $wParam, $lParam)    ; callback function mouse hook
    Local $tKEYHOOKS, $X, $Y, $tmp, $Delta
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)

    $X = DllStructGetData($tKEYHOOKS, "vkCode")
    $Y = DllStructGetData($tKEYHOOKS, "scanCode")

    Switch $wParam
        Case $WM_MOUSEWHEEL
            $Delta = BitShift(DllStructGetData($tKEYHOOKS, "flags"), 16)

            If $Delta > 0 Then
                $tmp = 'WHEEL_UP'
            Else
                $tmp = 'WHEEL_DOWN'
            EndIf
            $tmp &= ' (' & $Delta & ')'

        Case Else
            $tmp = ""
            $mEvent = ""
            $mX = $X
            $mY = $Y
            Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)

    EndSwitch

    $mEvent = $tmp

    ; Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)

EndFunc   ;==>_KeyProc
;----------------------------------------------------------------------------------------
Func GetMouseMsg()    ; Mouse Msg

    Local $mMsg
    Local $sMax = 255
    If $mEvent = "" Then


    ElseIf $mEvent = "WHEEL_UP (120)" Then
        ;ConsoleWrite("$mEvent = " & $mEvent & @CRLF)
        $mEvent = ""
        $mMsg = "WHEEL_UP"
        $WheelTrack -= 5
        $GToolstate = 0
        $GToolTimer = TimerInit()
    ElseIf $mEvent = "WHEEL_DOWN (-120)" Then
        ;ConsoleWrite("$mEvent = " & $mEvent & @CRLF)
        $mEvent = ""
        $mMsg = "WHEEL_DOWN"
        $WheelTrack += 5
        $GToolstate = 0
        $GToolTimer = TimerInit()
    Else
        ;nothing
        ConsoleWrite("$mEvent = " & $mEvent & @CRLF)
        $mEvent = ""
        $mMsg = ""
    EndIf

    If $WheelTrack > $sMax Then
        $WheelTrack = $sMax
    ElseIf $WheelTrack < 0 Then
        $WheelTrack = 0
    EndIf

    Return $mMsg
EndFunc   ;==>GetMouseMsg
;----------------------------------------------------------------------------------------
Func MouseAct()

    If _IsPressed("12", $hDLL) Then ;12 ALT  key
        While _IsPressed("12", $hDLL) ;While CTRL  key
            GetMouseMsg()
            ;ConsoleWrite("- $WheelTrack=" & $WheelTrack & @CRLF)
            If $tmpTrack <> $WheelTrack Then
                WinSetTrans($hGhostGUI, '', $WheelTrack)
                $tmpTrack = $WheelTrack
            EndIf
            Sleep(100)
        WEnd
    EndIf

EndFunc   ;==>MouseAct

 

_AutoItHelp.au3 as example

;https://www.autoitscript.com/forum/topic/209769-ghostgui/
;------------------------------------------------------------------------------
; Title...........: _AutoItHelp.au3
; Description.....: Example to test the GhostGui()

;------------------------------------------------------------------------------
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#include <Misc.au3>

Global $hWnd = WinWait("[TITLE:AutoIt Help; CLASS:HH Parent]")

GhostGui()
;************************************************
While WinActive($hWnd) ; Loop While win exits.
    Sleep(100)
WEnd
;************************************************

Exit

;----------------------------------------------------------------------------------------
Func GhostGui()
    Local $FilePath = @ScriptDir & "\GhostGui.au3"
    Local $Param = '"[TITLE:AutoIt Help; CLASS:HH Parent]" "0x000000" "50"'
    _RunScript($FilePath, $Param)
EndFunc   ;==>GhostGui
;----------------------------------------------------------------------------------------
Func _RunScript($FilePath, $Param = "")
    Run(FileGetShortName(@AutoItExe) & " " & FileGetShortName($FilePath) & " " & $Param)
EndFunc   ;==>_RunScript

since i did  i want to share it :)

Please, leave your comments and experiences here.

Thank you !

:D

Edited by ioa747
UpDate

I know that I know nothing

Link to comment
Share on other sites

It works ok if the (windows) scaling settings is on the default (100%).


Lucky - there was a thread on the scaling topic, few days/weeks ago ... 


If you want to avoid the delay then here is how you can do it:

 

; https://www.autoitscript.com/forum/topic/209769-ghostgui/
;------------------------------------------------------------------------------
; Title...........: GhostGui.au3
; Description.....: masks the window and makes it darker with ALT + mouse wheel scroll  ; ALT key in Line 186
;------------------------------------------------------------------------------
#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>
#include <WinAPISys.au3>
#include <WinAPIConstants.au3>

Global $GToolstate = 0, $GToolTimer
Global $iParams
$iParams = $CmdLine[0]
If Not $iParams Then
    MsgBox(0, "* This is an example...", "This means that you have run the" & @CRLF & @CRLF _
             & "    -->  " & @ScriptName & "  <--  " & @CRLF & @CRLF _
             & "without command line parameters." & @CRLF _
             & "and for this reason go to test mode." & @CRLF & @CRLF _
             & "First select the windows you want to act" & @CRLF _
             & "and then press OK." & @CRLF _
             & "Act with ALT key + WHEEL UP/DOWN")


    Global $iParams[4] = [3, '[ACTIVE]', 0x000000, 125]
    ;GhostGUI($HosthWnd, $BackColor = 0x000000, $Transparency = 125)
Else
    $iParams = $CmdLine
EndIf

If _Singleton($iParams[1], 1) = 0 Then Exit ; to avoid running it multiple times!

;Mouse hook ;---------------------------------------------------------------------------
Global $mX, $mY, $mEvent
Global $hDLL = DllOpen("user32.dll")
Global $hHook, $hStub_KeyProc, $hmod, $tmpTrack, $WheelTrack = 0
$hStub_KeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
$hmod = _WinAPI_GetModuleHandle(0)
$hHook = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($hStub_KeyProc), $hmod)
;----------------------------------------------------------------------------------------
Global $hGhostGUI, $hWnd

GhostGUI($iParams[1], $iParams[2], $iParams[3])
;call GhostGUI($HosthWnd, $BackColor = 0x000000, $Transparency = 125)

GoToExit()
;----------------------------------------------------------------------------------------
Func GoToExit()    ; exit & Cleanup
    Cleanup()
    Exit
EndFunc   ;==>GoToExit
;----------------------------------------------------------------------------------------
Func Cleanup()    ; Cleanup dll callback
    _WinAPI_UnhookWindowsHookEx($hHook)
    DllCallbackFree($hStub_KeyProc)
EndFunc   ;==>Cleanup
;----------------------------------------------------------------------------------------
Func ScripExit()
    If WinActive($hWnd) Then GoToExit()
EndFunc   ;==>ScripExit
;----------------------------------------------------------------------------------------

Func GhostGUI($HosthWnd, $BackColor = 0x000000, $Transparency = 125)
    $hWnd = WinWait($HosthWnd)
    $hGhostGUI = GUICreate('GhostGUI', 200, 200, -200, -200, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TRANSPARENT, $hWnd)
    GUISetBkColor($BackColor)
    WinSetTrans($hGhostGUI, '', $Transparency)
    $WheelTrack = $Transparency
    Local $HWPos[4] ; [0]=X  [1]=Y  [2]=Width  [3]=Height

    $GToolTimer = TimerInit()
    HotKeySet("{ESC}", "ScripExit")

    ; Display the GUI.
    GUISetState(@SW_SHOW, $hGhostGUI)

    WinActivate($hWnd) ;*

    Local $gtooltiptmptxt = "press  ESC to terminate." & @CRLF & "Act with ALT key + WHEEL UP/DOWN"

    ;*******************************************
    While 1
        If $GToolstate = 0 Then
            ToolTip("Visibility " & (255 - $WheelTrack) & @CRLF & $gtooltiptmptxt _
                    , MouseGetPos(0), MouseGetPos(1) + 32, "info", 1)
            If TimerDiff($GToolTimer) > 4000 Then
                $GToolstate = 2
                $gtooltiptmptxt=""
                ToolTip("")
            EndIf
        EndIf

        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch

        If WinExists($hWnd) Then
            $HWPos[0] = _WindowDWMX($hWnd)
            $HWPos[1] = _WindowDWMY($hWnd)
            $HWPos[2] = _WindowDWMWidth($hWnd)
            $HWPos[3] = _WindowDWMHeight($hWnd)

            WinMove($hGhostGUI, "", $HWPos[0], $HWPos[1], $HWPos[2], $HWPos[3])
        Else
            ExitLoop
        EndIf

        MouseAct()

        Sleep(100)
    WEnd
    ;*******************************************

    ; Delete the previous GUI and all controls.
    GUIDelete($hGhostGUI)

EndFunc   ;==>GhostGUI
;----------------------------------------------------------------------------------------
Func _KeyProc($nCode, $wParam, $lParam)    ; callback function mouse hook
    Local $tKEYHOOKS, $X, $Y, $tmp, $Delta
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
    $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)

    $X = DllStructGetData($tKEYHOOKS, "vkCode")
    $Y = DllStructGetData($tKEYHOOKS, "scanCode")

    Switch $wParam
        Case $WM_MOUSEWHEEL
            $Delta = BitShift(DllStructGetData($tKEYHOOKS, "flags"), 16)

            If $Delta > 0 Then
                $tmp = 'WHEEL_UP'
            Else
                $tmp = 'WHEEL_DOWN'
            EndIf
            $tmp &= ' (' & $Delta & ')'

        Case Else
            $tmp = ""
            $mEvent = ""
            $mX = $X
            $mY = $Y
            Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)

    EndSwitch

    $mEvent = $tmp

    ; Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)

EndFunc   ;==>_KeyProc
;----------------------------------------------------------------------------------------
Func GetMouseMsg()    ; Mouse Msg

    Local $mMsg
    Local $sMax = 255
    If $mEvent = "" Then


    ElseIf $mEvent = "WHEEL_UP (120)" Then
        ;ConsoleWrite("$mEvent = " & $mEvent & @CRLF)
        $mEvent = ""
        $mMsg = "WHEEL_UP"
        $WheelTrack -= 5
                $GToolstate = 0
                $GToolTimer = TimerInit()
    ElseIf $mEvent = "WHEEL_DOWN (-120)" Then
        ;ConsoleWrite("$mEvent = " & $mEvent & @CRLF)
        $mEvent = ""
        $mMsg = "WHEEL_DOWN"
        $WheelTrack += 5
                        $GToolstate = 0
                $GToolTimer = TimerInit()
    Else
        ;nothing
        ConsoleWrite("$mEvent = " & $mEvent & @CRLF)
        $mEvent = ""
        $mMsg = ""
    EndIf

    If $WheelTrack > $sMax Then
        $WheelTrack = $sMax
    ElseIf $WheelTrack < 0 Then
        $WheelTrack = 0
    EndIf

    Return $mMsg
EndFunc   ;==>GetMouseMsg
;----------------------------------------------------------------------------------------
Func MouseAct()

    If _IsPressed("12", $hDLL) Then ;12 ALT  key
        While _IsPressed("12", $hDLL) ;While CTRL  key
            GetMouseMsg()
            ;ConsoleWrite("- $WheelTrack=" & $WheelTrack & @CRLF)
            If $tmpTrack <> $WheelTrack Then
                WinSetTrans($hGhostGUI, '', $WheelTrack)
                $tmpTrack = $WheelTrack
            EndIf
            Sleep(100)
        WEnd
    EndIf

EndFunc   ;==>MouseAct
;----------------------------------------------------------------------------------------

#Region === a short extract from Pal, Peter's AutoIt Library, version 1.25 UDF ===

; https://www.autoitscript.com/forum/topic/201518-pal-peters-autoit-functions-library/

; #FUNCTION# ====================================================================================================================
; Name...........: _WindowDWMWidth
; Description....: Returns window width as registered by the Desktop Window Manager (DWM)
; Syntax.........: _WindowDWMWidth($hGUI)
; Parameters.....: $hGUI                    - Window GUI handle
; Return values..: Desktop Window Manager window width
; Author.........: Peter Verbeek
; Modified.......:
; ===============================================================================================================================
Func _WindowDWMWidth($hGUI)
    ; Try finding width by the Desktop Window Manager, Windows Vista and higher
    Local $tagRect = "struct;long Left;long Top;long Right;long Bottom;endstruct", $tRect = DllStructCreate($tagRect)
    DllCall("Dwmapi.dll", "long", "DwmGetWindowAttribute", "hwnd", WinGetHandle($hGUI), "dword", 9, "ptr", DllStructGetPtr($tRect), "dword", DllStructGetSize($tRect))
    If @error = 0 And DllStructGetData($tRect, 3) - DllStructGetData($tRect, 1) > 0 And DllStructGetData($tRect, 4) - DllStructGetData($tRect, 2) > 0 Then Return DllStructGetData($tRect, 3) - DllStructGetData($tRect, 1)
    ; Alternatively return window width by AutoIt
    Local $aWindow = WinGetPos($hGUI)
    If @error <> 0 Or $aWindow[0] = -32000 Then Return 0                ; correcting for a minimized window
    Return $aWindow[2]
EndFunc   ;==>_WindowDWMWidth
; #FUNCTION# ====================================================================================================================
; Name...........: _WindowDWMHeight
; Description....: Returns window height as registered by the Desktop Window Manager (DWM)
; Syntax.........: _WindowDWMHeight($hGUI)
; Parameters.....: $hGUI                    - Window GUI handle
; Return values..: Desktop Window Manager window height
; Author.........: Peter Verbeek
; Modified.......:
; ===============================================================================================================================
Func _WindowDWMHeight($hGUI)
    ; Try finding width by the Desktop Window Manager, Windows Vista and higher
    Local $tagRect = "struct;long Left;long Top;long Right;long Bottom;endstruct", $tRect = DllStructCreate($tagRect)
    DllCall("Dwmapi.dll", "long", "DwmGetWindowAttribute", "hwnd", WinGetHandle($hGUI), "dword", 9, "ptr", DllStructGetPtr($tRect), "dword", DllStructGetSize($tRect))
    If @error = 0 And DllStructGetData($tRect, 3) - DllStructGetData($tRect, 1) > 0 And DllStructGetData($tRect, 4) - DllStructGetData($tRect, 2) > 0 Then Return DllStructGetData($tRect, 4) - DllStructGetData($tRect, 2)
    ; Alternatively return window height by AutoIt
    Local $aWindow = WinGetPos($hGUI)
    If @error <> 0 Or $aWindow[0] = -32000 Then Return 0                ; correcting for a minimized window
    Return $aWindow[3]
EndFunc   ;==>_WindowDWMHeight
; #FUNCTION# ====================================================================================================================
; Name...........: _WindowDWMX
; Description....: Returns window x coordinate as registered by the Desktop Window Manager (DWM)
; Syntax.........: _WindowDWMWidth($hGUI)
; Parameters.....: $hGUI                    - Window GUI handle
; Return values..: Desktop Window Manager window x coordinate
; Author.........: Peter Verbeek
; Modified.......:
; ===============================================================================================================================
Func _WindowDWMX($hGUI)
    ; Try finding x coordinate by the Desktop Window Manager, Windows Vista and higher
    Local $tagRect = "struct;long Left;long Top;long Right;long Bottom;endstruct", $tRect = DllStructCreate($tagRect)
    DllCall("Dwmapi.dll", "long", "DwmGetWindowAttribute", "hwnd", WinGetHandle($hGUI), "dword", 9, "ptr", DllStructGetPtr($tRect), "dword", DllStructGetSize($tRect))
    If @error = 0 And DllStructGetData($tRect, 3) - DllStructGetData($tRect, 1) > 0 And DllStructGetData($tRect, 4) - DllStructGetData($tRect, 2) > 0 Then Return DllStructGetData($tRect, 1)
    ; Alternatively return window width by AutoIt
    Local $aWindow = WinGetPos($hGUI)
    If @error <> 0 Or $aWindow[0] = -32000 Then Return 0                ; correcting for a minimized window
    Return $aWindow[0]
EndFunc   ;==>_WindowDWMX
; #FUNCTION# ====================================================================================================================
; Name...........: _WindowDWMY
; Description....: Returns window y coordinate as registered by the Desktop Window Manager (DWM)
; Syntax.........: _WindowDWMWidth($hGUI)
; Parameters.....: $hGUI                    - Window GUI handle
; Return values..: Desktop Window Manager window y coordinate
; Author.........: Peter Verbeek
; Modified.......:
; ===============================================================================================================================
Func _WindowDWMY($hGUI)
    ; Try finding y coordinate by the Desktop Window Manager, Windows Vista and higher
    Local $tagRect = "struct;long Left;long Top;long Right;long Bottom;endstruct", $tRect = DllStructCreate($tagRect)
    DllCall("Dwmapi.dll", "long", "DwmGetWindowAttribute", "hwnd", WinGetHandle($hGUI), "dword", 9, "ptr", DllStructGetPtr($tRect), "dword", DllStructGetSize($tRect))
    If @error = 0 And DllStructGetData($tRect, 3) - DllStructGetData($tRect, 1) > 0 And DllStructGetData($tRect, 4) - DllStructGetData($tRect, 2) > 0 Then Return DllStructGetData($tRect, 2)
    ; Alternatively return window width by AutoIt
    Local $aWindow = WinGetPos($hGUI)
    If @error <> 0 Or $aWindow[0] = -32000 Then Return 0                ; correcting for a minimized window
    Return $aWindow[1]
EndFunc   ;==>_WindowDWMY
#EndRegion === a short extract from Pal, Peter's AutoIt Library, version 1.25 UDF ===

I made some additions to the original script
now it stops at the 0 and 255 and the tool tip displays the visibiility value 

Edited by Dan_555

Some of my script sourcecode

Link to comment
Share on other sites

10 hours ago, Dan_555 said:

It works ok if the (windows) scaling settings is on the default (100%).

did you find anything?  in my own system within the limits it allows me, I didn't find anything
I thought I got over it with use

$HWPos[0] = _WindowDWMX($hWnd)
$HWPos[1] = _WindowDWMY($hWnd)
$HWPos[2] = _WindowDWMWidth($hWnd)
$HWPos[3] = _WindowDWMHeight($hWnd)

if you found anything i would like to know

Thank you very much for your suggestions
nice touches on tool-tip !

I'm glad you liked it  :)

I know that I know nothing

Link to comment
Share on other sites

Hi @ioa747,

I like your approach of the GhostGui 👍 .

I did a similar thing years ago, but way simpler => I only dimmed the complete monitor by a "GhostGui", not a specific window. Your way is more comfortable, thanks 😀 .

Best regards
Sven

Stay innovative!

Spoiler

🌍 Au3Forums

🎲 AutoIt (en) Cheat Sheet

📊 AutoIt limits/defaults

💎 Code Katas: [...] (comming soon)

🎭 Collection of GitHub users with AutoIt projects

🐞 False-Positives

🔮 Me on GitHub

💬 Opinion about new forum sub category

📑 UDF wiki list

✂ VSCode-AutoItSnippets

📑 WebDriver FAQs

👨‍🏫 WebDriver Tutorial (coming soon)

Link to comment
Share on other sites

I updated the original post

 

8 hours ago, Dan_555 said:

Well, at first the scaling was at 125% and the window postition was not right, so i switched to 100% and it was ok.

@Dan_555  thank you for your interaction

I updated the original post and adopted your touches

now it should work normally regardless of scaling

Try it :)

 

I know that I know nothing

Link to comment
Share on other sites

8 hours ago, Nisteo said:

Can be used as a night light. Looks better than standard yellow night light in Windows 10.

I'm glad you liked it

informational, color may change

in example _AutoItHelp.au3 in line 24 i use the 0x000000 which is black, and the 50  which is the start transparency

Func GhostGui()
    Local $FilePath = @ScriptDir & "\GhostGui.au3"
    Local $Param = '"[TITLE:AutoIt Help; CLASS:HH Parent]" "0x000000" "50"'
    _RunScript($FilePath, $Param)
EndFunc   ;==>GhostGui

Thank you

I know that I know nothing

Link to comment
Share on other sites

Actually it does not fix the problem. 

With the addition the 100% scaling is not ok, but it is ok with 125%.

Without the addition the 100% scaling is ok, but not with 125%.

(haven't tested the higher scaling.)

p.s. i have a dual monitor setup. so whenever a cloned screen is on (im playing on the xbox on the other monitor), the scaling setting is set to go to 125.

The smaller monitor is the primary monitor in that case, so the scaling is always 125%. 

In extended mode, the primary monitor is 125% and secondary is 100% ...

Edited by Dan_555

Some of my script sourcecode

Link to comment
Share on other sites

4 hours ago, Dan_555 said:

Actually it does not fix the problem. 

you are right i tried it and it didn't look right

on win10 while on my primary screen(in clone mode) 1920X1080 when I tested it with Scala 100 125 and 150 it played correctly

when i turn extended mode primary screen 1920X1080 and secondary 3840 x 2160 is 300%

in primary screen is ok regardless of scaling , but in secondary elsewhere the window and elsewhere the mask

Sorry for the inconvenience

Again thank you very much

 

however, i changed tactics. If you want to try it, I wish I made it

I updated the original post again :)

I know that I know nothing

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...