Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ Returns a `boolean` indicating if the window still exists

Returns a `boolean` indicating if the window is visible

#### #isMinimized()

Returns a `boolean` indicating if the window is minimized (iconic).

#### #getDimensions()

Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
Expand Down
6 changes: 6 additions & 0 deletions src/c++/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Napi::Object Window::Init(Napi::Env env, Napi::Object exports) {
InstanceMethod("getHwnd", &Window::GetHwnd),
InstanceMethod("getDimensions", &Window::GetDimensions),
InstanceMethod("isVisible", &Window::IsVisible),
InstanceMethod("isMinimized", &Window::IsMinimized),
InstanceMethod("exists", &Window::Exists),
InstanceMethod("getTitle", &Window::GetTitle),
InstanceMethod("getClassName", &Window::GetClassName),
Expand Down Expand Up @@ -237,6 +238,11 @@ Napi::Value Window::IsVisible(const Napi::CallbackInfo& info) {
return Napi::Boolean::New(info.Env(), returned);
}

Napi::Value Window::IsMinimized(const Napi::CallbackInfo& info) {
bool returned = IsIconic(this->_identifier);
return Napi::Boolean::New(info.Env(), returned);
}

Napi::Value Window::Exists(const Napi::CallbackInfo& info) {
bool returned = IsWindow(this->_identifier);
return Napi::Boolean::New(info.Env(), returned);
Expand Down
1 change: 1 addition & 0 deletions src/c++/window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Window : public Napi::ObjectWrap<Window> {
Napi::Value GetHwnd(const Napi::CallbackInfo &info);
Napi::Value GetDimensions(const Napi::CallbackInfo& info);
Napi::Value IsVisible(const Napi::CallbackInfo& info);
Napi::Value IsMinimized(const Napi::CallbackInfo& info);
Napi::Value Exists(const Napi::CallbackInfo& info);
Napi::Value GetTitle(const Napi::CallbackInfo& info);
Napi::Value GetClassName(const Napi::CallbackInfo& info);
Expand Down