Take a look at this blog entry to see how the previous instance is activated
in CF.
http://blog.opennetcf.org/afeinman/P...3b7f54b11.aspx
I suppose that you can send yourself a periodic timer-based message to pull
yourself on top. That of course has a drawback in that it will get your app
on top no matter what, even when you need access to another application
--
Alex Feinman
---
Visit
http://www.opennetcf.org
"shapij" <(E-Mail Removed)> wrote in message
news:141C2EEF-5B43-4913-A48C-(E-Mail Removed)...
>I have a kiosk-type Pocket PC app which has a problem of moving to the
> background after the device has been powered down with the power button.
> For
> short durations of minutes to an hour or two, the app is in the
> foreground.
> This only occurs after the device has been off for a relatively long time.
> (e.g. powered off overnight).
>
> I'm sure the app is still running because pressing a programmed HotKey
> causes the top portion of my app to appear over the title bar. And then
> tapping that exposed area of my app's screen restores the rest of the app
> to
> full view.
>
> I've tried using the BringToTop()/SetWindowPos()/ShowWindow() API commands
> in the form's GotFocus event to no avail. (In VB6, this code keeps the
> window on top no matter what; similar to a MsgBox with vbSystemModal.)
>
> I suspect that it is not my app that goes to the background but rather
> something in the OS that forces the Start screen to the foreground.
>
> This application is used in scientific experiments. In a controlled lab,
> this might not be such a problem. However, the app, being PDA-based, is
> also
> used outside of a lab. Therefore it is imperative that the app never go
> to
> the background. (To prevent subjects from running down the battery, and
> inadvertent or intentional deletion of the app & its data; and to some
> extent, give the appearance of a dedicated device which helps dissaude
> theft.)
>
> Thanks in advance for any help!
>
> shapij