It is currently March 29th, 2024, 12:47 am
Title active window
-
- Posts: 10
- Joined: August 17th, 2019, 5:14 pm
Title active window
How to create a skin with dynamic title active window?
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Title active window
I don't follow you at all.
-
- Posts: 10
- Joined: August 17th, 2019, 5:14 pm
Re: Title active window
I see
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Title active window
What I'm saying is that I don't understand your question. We need some more details on what you are trying to do.
-
- Posts: 10
- Joined: August 17th, 2019, 5:14 pm
Re: Title active window
https://imgur.com/dRlAhOU
Title active window on the skin.
I make plugin now, but problem with other languages. Need utf 8 for wstring or somthing else
Title active window on the skin.
I make plugin now, but problem with other languages. Need utf 8 for wstring or somthing else
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Title active window
I'm sorry, I don't understand at all what you are trying to do. If you can't elaborate, I'm afraid I can't help.
-
- Posts: 10
- Joined: August 17th, 2019, 5:14 pm
Re: Title active window
i have open window. This window have a name, like "New Folder 1" ... This name i'm need in rainmeter widget.
How to explain differently, idk.
How to explain differently, idk.
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Title active window
I imagine you will want something like this in your plugin...
Code: Select all
#include <windows.h>
#include <string>
using std::string;
string GetActiveWindowTitle()
{
char wnd_title[256];
HWND hwnd=GetForegroundWindow(); // get handle of currently active window
GetWindowText(hwnd,wnd_title,sizeof(wnd_title));
return wnd_title;
}
-
- Posts: 10
- Joined: August 17th, 2019, 5:14 pm
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Title active window
Code: Select all
#include <Windows.h>
#include "../../API/RainmeterAPI.h"
struct Measure
{
Measure() {}
};
PLUGIN_EXPORT void Initialize(void** data, void* rm)
{
Measure* measure = new Measure;
*data = measure;
}
PLUGIN_EXPORT void Reload(void* data, void* rm, double* maxValue)
{
Measure* measure = (Measure*)data;
}
PLUGIN_EXPORT double Update(void* data)
{
Measure* measure = (Measure*)data;
return 0.0;
}
PLUGIN_EXPORT LPCWSTR GetString(void* data)
{
Measure* measure = (Measure*)data;
WCHAR wnd_title[1024];
HWND hwnd = GetForegroundWindow(); // get handle of currently active window
GetWindowText(hwnd, wnd_title, sizeof(wnd_title));
return wnd_title;
}
//PLUGIN_EXPORT void ExecuteBang(void* data, LPCWSTR args)
//{
// Measure* measure = (Measure*)data;
//}
//PLUGIN_EXPORT LPCWSTR (void* data, const int argc, const WCHAR* argv[])
//{
// Measure* measure = (Measure*)data;
// return nullptr;
//}
PLUGIN_EXPORT void Finalize(void* data)
{
Measure* measure = (Measure*)data;
delete measure;
}
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
[PluginTest]
Measure=Plugin
Plugin=Empty
[MeterOne]
Meter=String
MeasureName=PluginTest
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
You do not have the required permissions to view the files attached to this post.