Xfce Forum

Sub domains
 

You are not logged in.

#1 2012-12-20 06:04:19

fgfgdf5
Member
Registered: 2012-12-20
Posts: 1

how to make a transparent and permeable to the cursor separate window

in windows(7,xp,vista) task was to make a modifier windows which made transparent and permeable to  mouse selected window
which was solved by autoita (this is such a scripting language based on windose api)

sample code

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinApi.au3>
;selection  window for transparency  and permeability mouse

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("transform_to_ win", 489, 194, 428, 368)
$Label1 = GUICtrlCreateLabel("none", 8, 16, 473, 17)
$Input1 = GUICtrlCreateInput("150", 8, 48, 473, 21)
$Label2 = GUICtrlCreateLabel("Enter a number from 0 to 255 to set the transparency of the window (default 150) and press", 11, 72, 466, 17)
$Label3 = GUICtrlCreateLabel("Next button to move  the selected window and you wait 10 seconds", 72, 96, 347, 17)
$Button1 = GUICtrlCreateButton("Next", 8, 120, 473, 49, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###




While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            Sleep(5000)
            $set00 = GUICtrlRead($Input1)
            $txt0 = _WinAPI_GetMousePos()
            $txt1 = _WinAPI_WindowFromPoint($txt0)
            $txt2 = _WinAPI_GetWindowText($txt1)
            Sleep(5000)
            _WinStyles()
            $Label1 = GUICtrlCreateLabel($txt2, 8, 16, 473, 17)
    EndSwitch
WEnd

Func _WinStyles()
Dim $txt2   
$hWnd = WinGetHandle($txt2)
$nStyle = _WinGetStyle($hWnd, 0)
$nExStyle = _WinGetStyle($hWnd, 1)

_WinSetStyle($hWnd,  -1,BitOr($nExStyle, BitOr($WS_EX_TRANSPARENT, $WS_EX_TOPMOST)))
WinSetTrans($hWnd,"",$set00);150 replaced by the variable
WinSetOnTop($hWnd,"",1)
EndFunc

Func _WinSetStyle($hWnd, $nStyle = -1, $nExStyle = 0)
    Local Const $GWL_STYLE = -16, $GWL_EXSTYLE = -20
    Local Const $SWP_NOMOVE = 0x2, $SWP_NOSIZE = 0x1, $SWP_SHOWWINDOW = 0x40, $SWP_NOZORDER = 0x4
    Local $iFlags = BitOR($SWP_SHOWWINDOW, $SWP_NOSIZE, $SWP_NOZORDER)
   
    If $nStyle = -1 Then
        $nStyle = BitOR($WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)
    EndIf
    $Pos = WinGetpos($hWnd)
    $x = $Pos[0]
    $y = $Pos[1]
   
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_STYLE, "int", $nStyle)
    DllCall("User32.dll", "int", "SetWindowLong", "hwnd", $hWnd, "int", $GWL_EXSTYLE, "int", $nExStyle)
    DllCall("User32.dll", "int", "SetWindowPos", "hwnd", $hWnd, "hwnd", 0, "int", $x + 1, "int", $y + 1 , "int", 0, "int", 0, "int", $iFlags)
EndFunc

Func _WinGetStyle($hWnd, $iIndex = 0)
    Local Const $GWL_STYLE = -16, $GWL_EXSTYLE = -20
   
    Local $iGWL_Index = $GWL_STYLE
   
    If $iIndex > 0 Then
        $iGWL_Index = $GWL_EXSTYLE
    EndIf
   
    Local $aStyles = DllCall('User32.dll', 'long', 'GetWindowLong', 'hwnd', $hWnd, 'int', $iGWL_Index)
    Return $aStyles[0]
EndFunc


Is it possible to make a similar  in xfce
p.s. I used it to watch the video (vlc) in the semi-transparent overlay with access to the desktop as the window player (vlc)  is permeable to mouse clicks
p.p.s. If  that is not clear please  ask because English is not my native language

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 8 queries executed - Memory usage: 518.56 KiB (Peak: 522.68 KiB) ]