It is currently March 19th, 2024, 3:33 am

Plugin process change Zpos value

Get help with creating, editing & fixing problems with skins
Post Reply
TrueFaith
Posts: 19
Joined: November 28th, 2016, 7:28 am

Plugin process change Zpos value

Post by TrueFaith »

i found in docs a way to set Zpos of skin, by detecting is targeted process is running or not, currently plugin changes Zpos from 0 to 2, if process of game is running Gw2-64.exe, but is there a way to change Zpos if there is Gw2-64.exe process is running and the window is on focus, and if window is not on focus - set Zpos back to 0

currently code looks like:

Code: Select all

[mProcess]
Measure=Plugin
Plugin=Process
ProcessName=Gw2-64.exe
UpdateDivider=5
IfAboveValue=0
IfAboveAction=!ZPos 2
IfBelowValue=0
IfBelowAction=!ZPos 0
Last edited by TrueFaith on February 16th, 2017, 4:08 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin process change Zpos value

Post by jsmorley »

I don't know of a way to detect which application has "focus", as focus is about a "window" not an "application", but this plugin might help with a full-screen game like GW2.

https://forum.rainmeter.net/viewtopic.php?p=122046#p122046
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin process change Zpos value

Post by jsmorley »

BTW, if the intent is to have one or more Rainmeter skins stay "on top" of a full-screen DirectX game, that probably won't work. It may depend some on the game, but in general normal windows using DWM can't be on top of application running in DirectX. At best, it may not work at all, at worst, they might "fight", and make the game unstable. I don't know about Guild Wars, but I do know Fallout 4 pitches a fit...
TrueFaith
Posts: 19
Joined: November 28th, 2016, 7:28 am

Re: Plugin process change Zpos value

Post by TrueFaith »

game played in window, not full screen.
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin process change Zpos value

Post by jsmorley »

TrueFaith wrote:game played in window, not full screen.
Don't know of anything that will help with this off the top of my head. GW2.exe doesn't have "focus". As I said, focus is not about applications, but about windows.

There is just no reliable way to use the "class" name of a window, which can be found, to identify which application opened that window. Some window classes are helpful. Notepad++.exe opens a window with a class of "Notepad++". An Explorer window opened by Windows has a class of "CabinetWClass". Not as helpful. The Manage window in Rainmeter has a class of "#32770". Not helpful at all.

The "title" of a window is even less reliable, as many apps don't have one, and if they do, nothing at all says they need to be unique.

I guess my point is that in spite of what it might feel like, there is no "external" relationship between an application and the windows it opens. The application itself knows what it opened of course, it was given a "window handle". Nobody else has insight into that relationship.
TrueFaith
Posts: 19
Joined: November 28th, 2016, 7:28 am

Re: Plugin process change Zpos value

Post by TrueFaith »

hm. can i detect is window minimized or not?
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin process change Zpos value

Post by jsmorley »

TrueFaith wrote:hm. can i detect is window minimized or not?
Nope. Not based on GW2.exe. If you know the class or title of a window, you can see if that particular window is minimized, or even has focus. Nothing to do with any particular application, unless it happens that GW2 always runs with a window that has a single, distinct, reasonably unique window class name.
User avatar
jsmorley
Developer
Posts: 22632
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Plugin process change Zpos value

Post by jsmorley »

Post Reply