Jump to content

Transparent window causing issue with application it is hovering over


Recommended Posts

HI All -

This transparent application I have is cause a 25-35% decrease in the FPS rate of the application it is sitting over. Even if the Transparent window text is not being changed.

After doing some research I have seen this can be an issue, there are suggestions on about changing the blending type. I am not sure how one would do that with AutoIt or even if that is the correct direction to go.

I have included a code snippet of a transparent window. Any suggestions would be greatly appreciated.

#include <GuiConstantsEx.au3>
#include <Windowsconstants.au3>
#include <GuiRichEdit.au3>
#include <GuiEdit.au3>
 HotKeySet("{ESC}", "On_Exit")

maingui()

Func MainGui()
    $st1 = $WS_POPUP
    $st2 = BitOR($WS_EX_LAYERED,$WS_EX_TOOLWINDOW,$WS_EX_TOPMOST)
    Local $iHorizontal = 1
    Global $hGUIMain = GUICreate("Move Pop-Borderless-Trans", 500, 200, -1, -1, $WS_POPUP, $st2)    ;-31A- (took ; off)
    Global $lblDragMe = GUICtrlCreateLabel("Move", $iHorizontal, 1, 35, 21)
    GUICtrlSetBkColor($lblDragMe, 0xD4D0C8)
    guictrlsetfont($lblDragMe, 10)
    GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP)
    $iHorizontal = $iHorizontal + 35
    Global $btnMenuOpen = GUICtrlCreateButton("Resize", $iHorizontal ,1,35,21)
    GUICtrlSetResizing($btnMenuOpen, $GUI_DOCKLEFT + $GUI_DOCKTOP)
    $iHorizontal = $iHorizontal + 35
    Global $btnGetFile = GUICtrlCreateButton("File", $iHorizontal,1,35,21)
    GUICtrlSetResizing($btnGetFile, $GUI_DOCKLEFT + $GUI_DOCKTOP)
    $iHorizontal = $iHorizontal + 35
    Global $cmbMainOpt = GUICtrlCreateCombo("", $iHorizontal, 1, 70, 21)
    GUICtrlSetResizing($cmbMainOpt, $GUI_DOCKLEFT + $GUI_DOCKTOP)
    $iHorizontal = $iHorizontal + 70
    Global $btnExit = GUICtrlCreateButton("Exit", $iHorizontal,1,35,21)
    GUICtrlSetResizing($btnExit, $GUI_DOCKLEFT + $GUI_DOCKTOP)
    $iHorizontal = $iHorizontal + 35
    Global $hRichEdit = _GUICtrlRichEdit_Create($hGUIMain, "", 1, 23, 498, 166, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY), $WS_EX_TRANSPARENT) ;-24-
    _GUICtrlEdit_SetReadOnly($hRichEdit, True)
    GUICtrlSetResizing($hRichEdit, $GUI_DOCKLEFT + $GUI_DOCKTOP)
    GUISetBkColor(0xABCDEF, $hGUIMain)
    _WinAPI_SetLayeredWindowAttributes($hGUIMain, 0xABCDEF, 250)


    GUISetState(@SW_SHOW, $hGUIMain) ; Makes GUI Visible
EndFunc

Func On_Exit()
    GUIDelete($hGUIMain)
    Exit
EndFunc

 While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_PRIMARYDOWN
                _SendMessage($hGUIMain, $WM_SYSCOMMAND, 0xF012, 0)
            Case $btnExit
                On_Exit()
        EndSwitch
     Sleep(10)
 WEnd
Edited by MacScript
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...