This site is no longer active and is available for archival purposes only. Registration and login is disabled.

PPC2002 (X) on applications


PPC2002 (X) on applications

Postby RICoder » Feb 21, 2002 @ 9:41pm

What is the windows message that is sent when the little (X) in the upper corner of an app is pressed?

It is not a WM_COMMAND like in a dialog.

Hrm...is it the WM_CLOSE?
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby Kzinti » Feb 21, 2002 @ 9:54pm

It is indeed WM_CLOSE.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Postby RICoder » Feb 21, 2002 @ 9:55pm

uh..nope. tried it. meh...

thanks though.

anyone else?
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby Dan East » Feb 21, 2002 @ 10:11pm

Where / what are you sending it to?

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby RwGast » Feb 21, 2002 @ 10:26pm

not related but that button sucks it doesnt even close the app it just sends it to the background!
http://www.angelfire.com/ego/esoteric if you like to play quake3 keep your eye on this site
User avatar
RwGast
pm Member
 
Posts: 1123
Joined: Jun 28, 2001 @ 7:36pm
Location: California, USA


Postby James S » Feb 21, 2002 @ 10:44pm

WM_TERMINATE is the command that actually closes the app, I believe.
WM_MINIMIZE would be the one that brings it to the background.
<img src="http://home.comcast.net/~sonne/james/tag.gif">
James S
pm Insider
 
Posts: 17064
Joined: Jan 12, 2002 @ 2:33pm
Location: Lexington, KY


Postby RICoder » Feb 22, 2002 @ 4:55am

Let me be more clear. I want my app to close, not go to the background when it is tapped. So, I want to capture that command.

I suppose I could use Spy++ or something to find out.

My app creates a ~[filename].xml temp file, and I want it gone when it closes.
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby RwGast » Feb 22, 2002 @ 5:02am

Is there a spy++ for the ppc?
http://www.angelfire.com/ego/esoteric if you like to play quake3 keep your eye on this site
User avatar
RwGast
pm Member
 
Posts: 1123
Joined: Jun 28, 2001 @ 7:36pm
Location: California, USA


Postby RICoder » Feb 22, 2002 @ 5:07am

Yeah, do you have eVC++? It's tools->remote spy++, or you can find it in C:\Windows CE Tools\BIN if you installed to the default directory.
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby RwGast » Feb 22, 2002 @ 5:12am

Cool thanks, i just learned something new. You should make the X close your program i guess microsoft missed that X means close not hide when they built ppc2002.
http://www.angelfire.com/ego/esoteric if you like to play quake3 keep your eye on this site
User avatar
RwGast
pm Member
 
Posts: 1123
Joined: Jun 28, 2001 @ 7:36pm
Location: California, USA


Postby RICoder » Feb 22, 2002 @ 5:23am

Ok, it's one of the following.

WM_NCACTIVATE
WM_CANCELMODE

I can't find NCACTIVATE in the help files, so I have no clue what that is. My guess it is the CANCELMODE.
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby Dan East » Feb 22, 2002 @ 6:28am

Okay, now I see what you are trying to do. Here's the docs for WM_NCACTIVATE:

WM_NCACTIVATE
The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed to indicate an active or inactive state.

A window receives this message through its WindowProc function.

LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_NCACTIVATE
WPARAM wParam, // new state (BOOL)
LPARAM lParam // not used
);
Parameters
wParam
Specifies when a title bar or icon needs to be changed to indicate an active or inactive state. If an active title bar or icon is to be drawn, the wParam parameter is TRUE. It is FALSE for an inactive title bar or icon.
lParam
This parameter is not used.
Return Values
When the wParam parameter is FALSE, an application should return TRUE to indicate that the system should proceed with the default processing, or it should return FALSE to prevent the title bar or icon from being deactivated. When wParam is TRUE, the return value is ignored.

Remarks
The DefWindowProc function draws the title bar or icon title in its active colors when the wParam parameter is TRUE and in its inactive colors when wParam is FALSE.


So, if you receive WM_NCACTIVATE with wParam==FALSE, then PostMessage a WM_CLOSE to your main hwnd.

Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Postby RICoder » Feb 22, 2002 @ 6:54pm

Thank Dan...
WM_NCACTIVATE is undefined, so I have to use the hex, but other than that it is all cool.
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby RICoder » Feb 22, 2002 @ 7:18pm

<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Postby RICoder » Feb 23, 2002 @ 7:55pm

Don't know if anyone is reading this thread besides me, but just in case...

I used the code above and it was a no-go.

Problem is, if you launch a dialog or anything, the message is recieved and expected bad stuff happens. I was gonna put in a flag to handle this, but I don't want to hack it like that.

I am going to investigat WM_CANCELMODE a bit further, but until then, this is where I am.
<iframe src="http://gamercard.xbox.com/RICoder.card" scrolling="no" frameBorder="0" height="140" width="204">RICoder</iframe>
User avatar
RICoder
FOX News Correspondent
 
Posts: 3948
Joined: Jul 10, 2001 @ 1:48pm
Location: the matrix has me


Next

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum