It is currently October 26th, 2021, 12:37 pm

Getting window handle of skin

Help with creating, editing & fixing problems with skins
User avatar
death.crafter
Posts: 1070
Joined: April 24th, 2021, 8:13 pm

Re: Getting window handle of skin

Post by death.crafter »

Judian81 wrote: July 27th, 2021, 5:06 am is it possible to get the handler of a image meter?
Meters are like an element of a window. Not "like" but "are". They can't have handles.

But why do you need it tho. If you want to control it from some other skin, you can use bangs with configs, like [!SetOption SomeMeter SomeOption "SomeValue" "SomeConfig"]. Also you can do it from command line if you are interested.

In powershell it would be like:

Code: Select all

Start-Process "C:\Program Files\Rainmeter\Rainmeter.exe" -ArgumentList '[!SetOption SomeMeter SomeOption "SomeValue" "SomeConfig"]', '[!UpdateMeter SomeMeter "SomeConfig"]', '[!Redraw "SomeConfig"]'
from the Realm of Death
My Current Desktop
User avatar
Judian81
Posts: 90
Joined: May 6th, 2021, 2:57 pm

Re: Getting window handle of skin

Post by Judian81 »

death.crafter wrote: July 27th, 2021, 5:22 amBut why do you need it tho.
hmm in the past i had used a handle of a activemovie element to cast it to a picturebox in another window.
it was like pass handle activemovie element to windows forms button handle
windows 10
User avatar
death.crafter
Posts: 1070
Joined: April 24th, 2021, 8:13 pm

Re: Getting window handle of skin

Post by death.crafter »

Judian81 wrote: July 27th, 2021, 5:36 am hmm in the past i had used a handle of a activemovie element to cast it to a picturebox in another window.
it was like pass handle activemovie element to windows forms button handle
Ohh in that case I have no idea. What I thought was you were asking about window handles. Sorry for the misunderstanding.
from the Realm of Death
My Current Desktop
User avatar
Judian81
Posts: 90
Joined: May 6th, 2021, 2:57 pm

Re: Getting window handle of skin

Post by Judian81 »

when i make a windows forms application. i can place buttons, textboxes and picturebox.

every control has its own handle.

Code: Select all

me.handle (form)
me.button1.handle
me.picturebox1.handle
windows 10
User avatar
Yincognito
Rainmeter Sage
Posts: 4071
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Getting window handle of skin

Post by Yincognito »

Judian81 wrote: July 27th, 2021, 6:46 am when i make a windows forms application. i can place buttons, textboxes and picturebox.

every control has its own handle.

Code: Select all

me.handle (form)
me.button1.handle
me.picturebox1.handle
Ok, but the question remains: what would you need those handles for? I mean ... what can't be achieved through Rainmeter and absolutely needs a handle to achieve a certain functionality? In other words, what are you actually trying to achieve? Maybe a simpler solution exists...

EDIT: If by any chance your goal is related to what you mentioned here, maybe this or this (it has 2 approaches, eclectic-tech's one which is complete but the player window is separated from the skin, and mine which is massively incomplete and probably buggy due to that but the player "window" - well, more like its image - actually belongs to the skin) could help. Other than that, if you wonder how can you capture when a skin is moving to another place, don't - just follow it wherever it is moving, as that's largely achievable (assuming a lower update rate) from another skin, see the preview for a somewhat similar goal here.

EDIT2: Actually, you can capture when a skin is moving to another place as well, from another skin, using a similar approach to the one used when following it. It's more or less about passing the moving skin's positional data to the "observer skin" and optionally compare the current data with the previous one to detect movement.
User avatar
balala
Rainmeter Sage
Posts: 13346
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Getting window handle of skin

Post by balala »

Judian81 wrote: July 27th, 2021, 6:46 am when i make a windows forms application. i can place buttons, textboxes and picturebox.

every control has its own handle.
Not entirely sure this is correct, however I think death.crafter is right when says, related to meters:
death.crafter wrote: July 27th, 2021, 5:22 am They can't have handles.
Just that unlike an element of a "general" window, meters don't have handles, but I believe you don't even need them. What for? No need at all for them. Their name (or the name of the group, if they belong to a group) is entirely enough to work with them.
A dev could say if I am right, but me at least suppose (hope) I am.
User avatar
jsmorley
Developer
Posts: 22374
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Getting window handle of skin

Post by jsmorley »

Meters are not "windows" and they are not "controls". They have no handle.
User avatar
Yincognito
Rainmeter Sage
Posts: 4071
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Getting window handle of skin

Post by Yincognito »

balala wrote: July 27th, 2021, 4:47 pmNot entirely sure this is correct...
Control.Handle Property
User avatar
Active Colors
Moderator
Posts: 875
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: Getting window handle of skin

Post by Active Colors »

I haven't read through your thread as it is simply beyond my knowledge. However, since the thread is still going, I suppose you haven't yet found a way to get the handles. I've just recalled about something called RainnThumbnail. There is no source published by the author but since it is made with AutoIt it should be fairly easy to get the code of the project. Maybe by looking at the different solution it can give you a hint how to proceed. Good luck :p
User avatar
death.crafter
Posts: 1070
Joined: April 24th, 2021, 8:13 pm

Re: Getting window handle of skin

Post by death.crafter »

Active Colors wrote: July 27th, 2021, 5:12 pm I haven't read through your thread as it is simply beyond my knowledge. However, since the thread is still going, I suppose you haven't yet found a way to get the handles. I've just recalled about something called RainnThumbnail. There is no source published by the author but since it is made with AutoIt it should be fairly easy to get the code of the project. Maybe by looking at the different solution it can give you a hint how to proceed. Good luck :p
If you are replying to me, I have found a way.

This is what I wanted to do, but in a non-rainmeter (powershell) way. But, I just ended up making a plugin.
https://forum.rainmeter.net/viewtopic.php?f=128&t=37989
from the Realm of Death
My Current Desktop