Skip to content

Commit

Permalink
Add isMaximized to bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Hladkyi committed Apr 5, 2023
1 parent 27221e5 commit 14b2425
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Sources/windows/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ Napi::Value getWindowInformation(const HWND &hwnd, const Napi::CallbackInfo &inf
bounds.Set(Napi::String::New(env, "width"), lpRect.right - lpRect.left);
bounds.Set(Napi::String::New(env, "height"), lpRect.bottom - lpRect.top);

WINDOWINFO pwi;
BOOL infoResult = GetWindowInfo(hwnd, &pwi);
if (infoResult == 0) {
return env.Null();
}

if (pwi.dwStyle & WS_MAXIMIZE) {
bounds.Set(Napi::Boolean::New(env, "isMaximized"), true);
}
else {
bounds.Set(Napi::Boolean::New(env, "isMaximized"), false);
}

Napi::Object activeWinObj = Napi::Object::New(env);

activeWinObj.Set(Napi::String::New(env, "platform"), Napi::String::New(env, "windows"));
Expand Down

0 comments on commit 14b2425

Please sign in to comment.