Login  Register

Re: How to tell if a newt window is maximized?

Posted by Sven Gothel on Feb 24, 2012; 2:10pm
URL: https://forum.jogamp.org/How-to-tell-if-a-newt-window-is-maximized-tp3767837p3772652.html

On 02/24/2012 10:57 AM, GiGurra [via jogamp] wrote:
>
>
> Also, another reason why the maximized flag is important, is that the size of
> a maximized window will vary depending on if you have the start menu visible
> or not.

Right - same is true for all platforms.
You made your point, thx.

Since you are familiar w/ the Windows GDI API it seems,
can you provide code snippest for the MINIMIZED / MAXIMIZED window queries ?

Would you like to add this feature to NEWT (at least partially) ?

Instead of adding a bunch of new methods, how about:

  Enum WindowState { MIN, MAX, ... }
  WindowState getWindowState();

Please complete enums .. and change it as you see fit.

Brainstorming:
History of NEWT already caused a bunch of Window state query methods,
so I dunno whats best .. add more, or 'renovate' those API.
If the latter is true we may add already handled states (decoration,
fullscreen, visible) to the above WindowState.
For compatibility - we can keep the dedicated methods ..

~Sven

> To prove my statements above, I wrote the following small C code.
>
> #include <stdio.h>
> #include <stdlib.h>
> #include "windows.h"
>
> int main(void) {
>
> const HWND window = FindWindowA("Notepad", NULL);
> if (window != NULL) {
> RECT rect;
> GetWindowRect(window, &rect);
> printf("\n x: %ld", rect.left);
> printf("\n y: %ld", rect.top);
> printf("\n w: %ld", rect.right - rect.left);
> printf("\n h: %ld", rect.bottom - rect.top);
> }
>
> return EXIT_SUCCESS;
> }


signature.asc (910 bytes) Download Attachment