NassauSky Posted January 4, 2023 Share Posted January 4, 2023 Trying to make a small app that makes my laptop screen darker as I'm watching TV at night. The built-in brightness controls doesn't make the screen dark enough. One thought is a transparent box over the bottom left corner of my desktop in front of where I normally start my streaming TV app. Thing is the regular transparency effect makes it lighter. See this example: Hoping there is a way to maybe put a black transparent mask over it or any other tricks that might do the job #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 437, 192, 124) GUISetBkColor(0x000000) $click = GUICtrlCreateButton("Click To Test Trans for 3 secs", 224, 80, 241, 121) GUISetState(@SW_SHOW) 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("", "", 200) Sleep(3000) GUIDelete(WinGetHandle("", "")) EndSwitch WEnd Link to comment Share on other sites More sharing options...
ioa747 Posted January 4, 2023 Share Posted January 4, 2023 Try this if OK ? Win close from taskbar #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> $ghost_gui = GUICreate("ghost_gui", 615, 437, 192, 124, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor("0x0D1117") ; $COLOR WinSetTrans($ghost_gui, "", 80) GUISetState(@SW_SHOW, $ghost_gui) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd NassauSky 1 I know that I know nothing Link to comment Share on other sites More sharing options...
NassauSky Posted January 4, 2023 Author Share Posted January 4, 2023 @ioa747Jackpot! Thanks Link to comment Share on other sites More sharing options...
ioa747 Posted January 4, 2023 Share Posted January 4, 2023 I know that I know nothing Link to comment Share on other sites More sharing options...
SOLVE-SMART Posted January 5, 2023 Share Posted January 5, 2023 Hi @NassauSky, I extended the code change of @ioa747 just a bit more: #include-once #include <WindowsConstants.au3> Global Const $iGuiCloseFlag = -3 Global Const $hGui = GUICreate('ghost_gui', 615, 437, 192, 124, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TRANSPARENT) GUISetBkColor('0x0D1117') WinSetTrans($hGui, '', 80) GUISetState(@SW_SHOW, $hGui) While True Switch GUIGetMsg() Case $iGuiCloseFlag ExitLoop EndSwitch WEnd ➕ Advantage: You can click through the transparent GUI and control your windows behind it 😀 . Before adding $WS_EX_TRANSPARENT you couldn't do that.➖ Disadvantage: If you want to close the transparent GUI and you have clicked somewhere, you have to get the focus back to your transparent GUI, by the taskbar or the TaskView button for example. Best regardsSven________________Stay innovative! ioa747 1 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 More sharing options...
TheDcoder Posted January 5, 2023 Share Posted January 5, 2023 (edited) I know that I'm not helping with the script but I'm curious, why not just decrease the brightness of the screen? Edit: I was stupid and didn't read this 8 hours ago, NassauSky said: The built-in brightness controls doesn't make the screen dark enough. There might already be programs out there which can do this for you, perhaps they might be a better option. Edited January 5, 2023 by TheDcoder SOLVE-SMART 1 EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
ioa747 Posted February 25, 2023 Share Posted February 25, 2023 @NassauSky take a look I know that I know nothing Link to comment Share on other sites More sharing options...
argumentum Posted February 25, 2023 Share Posted February 25, 2023 (edited) ..I use a dark theme called BIB3 Works in Win10 and 11 quite well. Here's a small snapshot: Am also requesting a Dark mode help file at https://www.autoitscript.com/forum/topic/209770-cssdefaultcss-in-helpfile/ I hope it takes off and we have a less painful experience in the Windows canvas 😇 Edited February 25, 2023 by argumentum ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
ioa747 Posted February 25, 2023 Share Posted February 25, 2023 18 minutes ago, argumentum said: ..I use a dark theme called BIB3 Is there any reason we avoid direct links? I know that I know nothing Link to comment Share on other sites More sharing options...
argumentum Posted February 25, 2023 Share Posted February 25, 2023 no, none imposed by this site that I know. I just had it for the longest time and deviantart changed a lot as a site. Then again by now there may be a better version, or your search leads you to something different. <Rant> these ppl at deviantart they now have this "watchers only" that Ggrrr...</rant> Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now