yvesh / active-windows Goto Github PK
View Code? Open in Web Editor NEWNode C++ N-API module to get information on the currently selected window on Linux and Windows.
Node C++ N-API module to get information on the currently selected window on Linux and Windows.
I just tried it out on Windows 10, and got this error right away. Any idea?
I'm using electron 8.2.1.
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: "╨Ф╨╢╨╕╨╜╤Б╤Л 511 Slim Fit Levi's┬о 6407635 ╨║╤Г╨┐╨╕╤В╤М ╨╖╨░ 3┬а544┬атВ╜ ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В-╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ Wildberries - Google Chrome",
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: "╨Ф╨╢╨╕╨╜╤Б╤Л 511 Slim Fit Levi's┬о 6407635 ╨║╤Г╨┐╨╕╤В╤М ╨╖╨░ 3┬а544┬атВ╜ ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В-╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ Wildberries - Google Chrome",
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
{
os: 'windows',
windowClass: 'chrome.exe',
windowName: '╨Ъ╤Г╨┐╨╕╤В╤М ╨╝╤Г╨╢╤Б╨║╨╕╨╡ ╨┤╨╢╨╕╨╜╤Б╤Л ╨▓ ╨╕╨╜╤В╨╡╤А╨╜╨╡╤В ╨╝╨░╨│╨░╨╖╨╕╨╜╨╡ WildBerries.ru - Google Chrome',
windowDesktop: '0',
windowType: '0',
windowPid: '9608',
idleTime: '0'
}
getActiveWindow()
opens a handle to the process but doesn't close it.
Would it be possible to have a binding/function for hooking shell messages?
That allows us to know when a new windows is created, changes state or is removed.
That would allow for some awesome new integrations and utilities (in my case, i'm making a windows taskbar replacement with only webtech)
Here's one example in AHK for reference:
DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return
ShellMessage( wParam,lParam ) {
Local k
If ( wParam = 1 ) ; HSHELL_WINDOWCREATED
{
; A new window was created.
; Diferent callbacks could be called for different events, or a single one with the event enum as argument.
}
}
Running this on my mac I get current data on any active window
os: 'macos',
windowClass: 'wm_class',
windowName: 'wm_name',
windowDesktop: 't',
windowType: 'd',
windowPid: 'b'
When I install this module on linux, the build fails.
prebuild-install WARN install No prebuilt binaries found (target=10.16.3 runtime=node arch=x64 libc= platform=linux)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.