SDL_APPACTIVE & WIN2k

Hello!

This is my first mail to the list, so first of all:
thanks to Sam for writing SDL (and to all the helpers).

My questions is…
When I’m querying SDL_GetAppState() for SDL_APPACTIVE state (under Win 2k),
I get false when I minimized the window by the minimization button,
but I get true when I minimized it by clicking on the app button in the
task bar (or whatever you call the thing with “start” on the left).
Am I missing something or is SDL (1.1.7) missing something?

Ciao,
Eike

Hello!

This is my first mail to the list, so first of all:
thanks to Sam for writing SDL (and to all the helpers).

My questions is…
When I’m querying SDL_GetAppState() for SDL_APPACTIVE state (under Win 2k),
I get false when I minimized the window by the minimization button,
but I get true when I minimized it by clicking on the app button in the
task bar (or whatever you call the thing with “start” on the left).
Am I missing something or is SDL (1.1.7) missing something?

SDL is missing something.
Can you debug the windows messages that are sent when the app button is
clicked on the task bar, so we can see what SDL should be reacting to?

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

From the spy log, I can see these messages:

WM_NCACTIVATE
WM_ACTIVATE fActive:WA_ACTIVE fMinimized:true hwndPrevious:(null)
WM_NCPAINT hrgn:1
WM_WINDOWPOSCHANGED
WM_MOVE xPos:33536 yPos:33536 (?)
WM_SIZE fwSizeType:SIZE_MINIMIZED nWidth:0 nHeight:0

I’d suggest to ignore the WM_ACTIVATE message since it does not seem to do
what you need. You should check for WM_ACTIVATEAPP and WM_SIZE.
Basically:

case WM_ACTIVATEAPP:
if (wParam)
appActive = true;
else
appActive = false;

case WM_SIZE:
if (wParam == SIZE_MAXHIDE || wParam == SIZE_MINIMIZED)
appActive = false;
else
appActive = true;

Hope this helps.—
Giovanni Bajo
Lead Programmer

Protonic Interactive
www.protonic.net

  • Black holes are generated when God divides by zero -

-----Messaggio originale-----
Da: owner-sdl at lokigames.com [mailto:owner-sdl at lokigames.com]Per conto di
Sam Lantinga
Inviato: marted? 30 gennaio 2001 7.19
A: sdl at lokigames.com
Oggetto: Re: [SDL] SDL_APPACTIVE & WIN2k

Hello!

This is my first mail to the list, so first of all:
thanks to Sam for writing SDL (and to all the helpers).

My questions is…
When I’m querying SDL_GetAppState() for SDL_APPACTIVE state
(under Win 2k),
I get false when I minimized the window by the minimization button,
but I get true when I minimized it by clicking on the app button in the
task bar (or whatever you call the thing with “start” on the left).
Am I missing something or is SDL (1.1.7) missing something?

SDL is missing something.
Can you debug the windows messages that are sent when the app button is
clicked on the task bar, so we can see what SDL should be reacting to?

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I’d suggest to ignore the WM_ACTIVATE message since it does not seem to do
what you need. You should check for WM_ACTIVATEAPP and WM_SIZE.

I spent a bunch of time today researching this. WM_ACTIVATE is actually
the only message that gives me all the information I need. The other two
can give me wierd state information in some cases. However, I was
interpreting the WM_ACTIVATE paramerters a little naively. This is fixed
in the latest CVS code.

Thanks!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

…to be continued…

When I minimize my window (Win2k), I’m getting the
correct state (!SDL_APPACTIVE) now, but the window
contents stay on the screen. Just true for 2000,
under NT it works as expected.

Ciao,
Eike

…to be continued…

When I minimize my window (Win2k), I’m getting the
correct state (!SDL_APPACTIVE) now, but the window
contents stay on the screen. Just true for 2000,
under NT it works as expected.

Wierd. Can anybody confirm this, or even better, provide a fix? :slight_smile:

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Hello, again…

When I minimize my window (Win2k), I’m getting the
correct state (!SDL_APPACTIVE) now, but the window
contents stay on the screen. Just true for 2000,
under NT it works as expected.

PS: This was due to my strange graphics card and/or
strange settings. Exchanged it and have no problems
any more (in this respect :wink: ).

Ciao,
Eike