I have a problem with my app... two actually. The first one is it seams like the title(string) function doesn't work the way it says it does. Here is the description strait from the doc pages at http://www.pocketc.net/doc/

Description

give your applet a name! So it will appear on the taskbar on the bottom. It will also keep your application single instance. <u><b>When a new PocketC application launchs, it will check if any existing same application running. If it is, it will terminate itself, and switch to the running application.</b></u> It is important feature to have for PPC users.

It doesn't do what I hi-lighted. Look at the shot I took of the two instances.

You are probably using the V3 compiler - I seem to remember that V3 has a bug and the single-instance-feature does not work even when you give your app a title. Another instance (sorry for the pun) where V3 is unusable. It works fine in V2 (I only use V2 anyway).

Second: There is no way to trap the close button event. Your app never gets notified when this button gets pressed, the app simply closes down. Same goes for File -> Exit in the standard menu.

Solution: On older HPC and PPC devices (WindowsCE 2.x) you remove the menu bar (menu_off()) and then draw and handle your own menubar. That's what I do in my programs. You can use Guy's menubar library for that purpose. I did not find a way to trap the close button (the "X") on a PocketPC though, but at least you can remove the standard file menu.

Thanks wolfgang. Is there any limmitations in V2? Also where do I get it.

What you said about the close button just isn't true. The close button on all the PocketC programs I make only minimizes the app, it doesn't close it. That has been my whole problem. I know all about the atexit() function, but it doesn't do any good because the app never actually closes. Thanks for your help and quick response.

GetClassName(hMain = gethwnd(1), sClass, 128); if (hPrev = FindWindow(sClass, sAppTitle)) { SetForegroundWindow(hPrev);// quit() on PocketPC is real QUIT or only minimize ? I not have PocketPC and can't try.// if quit() only minimize then use DestroyWindow(hMain); instead quit(); quit(); } title(sAppTitle); return hMain;}

2. Close button event.I not have PocketPC. I not known what actual make "close" button. Variants:- hidden window- minimize but not hidden (IsWindowVisible() will return TRUE)- change Z-orderCode below should work anyway.