Jump to content

Creating a transparent rectangle


Moist
 Share

Recommended Posts

Hello guys,

How can I create a transparent rectangle over my GUI? I can create a rectangle using the GUICtrlCreateGraphic(), but can I fill it with a transparent color, so all the controls underneath can be semi-seen?

Thanks

Link to comment
Share on other sites

   $label = GUICtrlCreateLabel(" " & @CRLF & @CRLF & @CRLF & "                         A carregar...", 5, 5, 500, 450)
   GUICtrlSetFont(-1, 15, 600, $GUI_FONTITALIC, "Arial")
   _Search_2($num, $check, $thick)
   WinWait("COMPONENT INTERFACE")
   GUICtrlDelete($label)

 

The function _search_2() makes somes changes in another software and when a window COMPONENT INTERFACE appears on my other software, I can use my GUI again.

Link to comment
Share on other sites

1 minute ago, Moist said:

   $label = GUICtrlCreateLabel(" " & @CRLF & @CRLF & @CRLF & "                         A carregar...", 5, 5, 500, 450)
   GUICtrlSetFont(-1, 15, 600, $GUI_FONTITALIC, "Arial")
   _Search_2($num, $check, $thick)
   WinWait("COMPONENT INTERFACE")
   GUICtrlDelete($label)

 

The function _search_2() makes somes changes in another software and when a window COMPONENT INTERFACE appears on my other software, I can use my GUI again.

1

Please Use code tag like this:

 

$label = GUICtrlCreateLabel(" " & @CRLF & @CRLF & @CRLF & "                         A carregar...", 5, 5, 500, 450)
   GUICtrlSetFont(-1, 15, 600, $GUI_FONTITALIC, "Arial")
   _Search_2($num, $check, $thick)
   WinWait("COMPONENT INTERFACE")
   GUICtrlDelete($label)

 

Link to comment
Share on other sites

2 minutes ago, Moist said:

This is what I want:

 

Screenshot_3.jpg.6f163f427a8ce15e8cc023396895e9a8.jpg   --->  Screenshot_4.jpg.97543e9ff2ecced3bb5dc2d45d7eff46.jpg

 

Here You GO:

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$click = GUICtrlCreateButton("Click Me", 40, 32, 89, 25)
$after = GUICtrlCreateButton("Click Me After", 224, 80, 241, 121)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $click
            $pos = WinGetPos("Form1", "")
            GUICreate("", $pos[2], $pos[3], $pos[0], $pos[1], $WS_DISABLED)
            GUISetState(@SW_SHOW)
            WinSetTrans("", "", 50)
            Sleep(5000)
            GUIDelete(WinGetHandle("", ""))

    EndSwitch
WEnd

 

Link to comment
Share on other sites

you could also use simply : 

WinSetTrans ($hForm, "", 50)
  WinSetState ($hForm, "", @SW_DISABLE)
  Sleep (5000) ; do the things you need to do there
  WinSetState (h$Form, "", @SW_ENABLE)
  WinSetTrans ($hForm, "", 255)

that will disable and set transparent the whole window. nn to disable each individual controls

Link to comment
Share on other sites

21 hours ago, rm4453 said:

 

Here You GO:

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)
$click = GUICtrlCreateButton("Click Me", 40, 32, 89, 25)
$after = GUICtrlCreateButton("Click Me After", 224, 80, 241, 121)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $click
            $pos = WinGetPos("Form1", "")
            GUICreate("", $pos[2], $pos[3], $pos[0], $pos[1], $WS_DISABLED)
            GUISetState(@SW_SHOW)
            WinSetTrans("", "", 50)
            Sleep(5000)
            GUIDelete(WinGetHandle("", ""))

    EndSwitch
WEnd

 

That doesn't work so well with my script because I used  $WS_EX_TOPMOST on my GUI.

18 hours ago, Nine said:

you could also use simply : 

WinSetTrans ($hForm, "", 50)
  WinSetState ($hForm, "", @SW_DISABLE)
  Sleep (5000) ; do the things you need to do there
  WinSetState (h$Form, "", @SW_ENABLE)
  WinSetTrans ($hForm, "", 255)

that will disable and set transparent the whole window. nn to disable each individual controls

Thanks, I will try that when I get around to it.

Link to comment
Share on other sites

21 hours ago, Nine said:

you could also use simply : 

WinSetTrans ($hForm, "", 50)
  WinSetState ($hForm, "", @SW_DISABLE)
  Sleep (5000) ; do the things you need to do there
  WinSetState (h$Form, "", @SW_ENABLE)
  WinSetTrans ($hForm, "", 255)

that will disable and set transparent the whole window. nn to disable each individual controls

Thanks, worked like a charm.

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...