Jump to content

Launch hidden/ Transparent controls


Mikesch
 Share

Recommended Posts

For quite a while now, I've been working on a script which should allow to set the backlighting of Logitech's G19 keyboard. I started with getting the average colour from the desktop and setting that value to the keyboard, then expanded it to get the colour from VLC, if it's running and apply that. And it even works nicely. Next step was a script which would get the colour from the pixel under the mouse pointer and apply that colour. This was an easy step then.

But: The only way (I could make out) to set the values is by launching the trackbar window for Colour adjustment in the keyboard driver itself. That was still quite easy, as the key profiler is constantly active in the tray bar and has the effect of giving a fine smooth colour change, but of course for the price of having the sliders on top.

I recently tried to hide the process. Even that works well. Only thing I could not overcome so far is two of the controls flashing up for a moment.

There's one of the controls of which I can't get any information but a handle, and I can't think of another method to control it. The other control is the trackbar window itself, which I set transparent after it exists and once I got its handle.

Maybe there are way better ideas, but I haven't done many more complex scripts yet.

Any suggestions in making this script work completely 'in stealth mode' would be most welcome.

The essential code snippet is:

WinActivate("Logitech G-series Key Profiler")

;will launch that strange control with will at least provide a handle now.
ControlClick("Logitech G-series Key Profiler", "", "Button19")

;wait for control window to exist, glad I got the class now
$hWnd2 = WinWait("[CLASS:#32768]")
;make it transparent immediately
WinSetTrans($hWnd2, "", 0)

ControlSend($hWnd2, "", "", "{UP}")
Sleep(5)
ControlSend($hWnd2, "", "", "{ENTER}")
Sleep(30)
;(have to do it that way as options there don't seem to be accesible otherwise, without MouseClick()

;Launch slider control now:
$tWindow = WinGetTitle("[ACTIVE]")
$hWnd = WinGetHandle($tWindow, "")
WinSetTrans($hWnd, "", 0)

The complete script ist attached.

If you're owning a G19 (or a G13, too) you may want to look at this thread at G15forums.com

exp_Colour_set.au3

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