NassauSky Posted September 25, 2020 Posted September 25, 2020 (edited) Wanted to start a new topic since it's not only related to a webdriver app I was working on. It's more of probably a windows API trick or something like that. As I was playing with locking down a remote browser window, I was able to blacken out the whole chrome windows from edge to edge. I wish I remember how I did that unless it was a windows fluke. If anyone knows how to make that magic happen, it would be great. Disabling the window was not the objective but I was able to somehow paint the whole remote window black (though I wasn't working with paint API's). I was playing with the following API's when this happened #include <WinAPI.au3> #include <WindowsConstants.au3> #include <Constants.au3> Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe") $sTestApp = "New Tab - Google Chrome" WinWait($sTestApp) $hWnd = WinGetHandle($sTestApp) ConsoleWrite($hWnd & @CRLF) $iStyles = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE) _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, BitXOR($iStyles, $WS_SIZEBOX)) _WinAPI_SetWindowLong($hWnd, $GWL_EXSTYLE, BitXOR($iStyles, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX)) Edited September 25, 2020 by NassauSky
Danp2 Posted September 25, 2020 Posted September 25, 2020 What's your ultimate goal? There may be a better solution than blacking out the screen. Latest Webdriver UDF Release Webdriver Wiki FAQs
NassauSky Posted September 25, 2020 Author Posted September 25, 2020 (edited) I'm creating a statistics scraper for staff and want to keep them from seeing anything in the window as it's capturing it's data. Some sites I use that have responsive designs, don't make it easy to capture if i resize the screen to just a small block. Edited September 25, 2020 by NassauSky
Danp2 Posted September 25, 2020 Posted September 25, 2020 Just run the browser in headless mode. Latest Webdriver UDF Release Webdriver Wiki FAQs
NassauSky Posted September 25, 2020 Author Posted September 25, 2020 (edited) Thanks @Danp2 I'm hooking up to lots of resource servers and I don't think the IE UDF allowed that (headless mode) but now that I'm using webdriver with chrome, I can try that. For some reason I think I tried that a while back and it didn't work for some sites statistics but I'll try that again. I still want to keep this question out here if anyone knows the magic behind what I might have done to blacken the whole window. 😇 Edited September 25, 2020 by NassauSky
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