all groups > dotnet compact framework > february 2005 >
You're in the

dotnet compact framework

group:

running app in background still not working on Smartphone


Re: running app in background still not working on Smartphone Peter Foot [MVP]
2/10/2005 10:32:18 PM
dotnet compact framework:
Have you tried SetForegroundWindow?
http://blog.opennetcf.org/pfoot/PermaLink.aspx?guid=a4bca0e4-439b-411a-87cd-0950e9d16b10

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

[quoted text, click to view]

running app in background still not working on Smartphone Mustafa Rabie
2/10/2005 11:29:05 PM
I tried the following to hide my application and then bring it back or show
it again if it was ran from a shortcut or from directly clicking on the exe
file from the file manager and still doesnt work, you help is really
appreciated i really need to get this working ASAP.
The App is for Smartphone 2003 SPV C_500

the code:
this.Activated += new System.EventHandler(this.Form1_Activate);

private void menuItem2_Click(object sender, System.EventArgs e)

{

this.Hide();

}

private void Form1_Activate(object sender, System.EventArgs e)

{

this.Show();

this.BringToFront();

}

thanks a lot
mustafa

Re: running app in background still not working on Smartphone Mustafa Rabie
2/11/2005 12:37:18 AM
yep and not working also :'(
[quoted text, click to view]

Re: running app in background still not working on Smartphone Mustafa Rabie
2/11/2005 1:11:15 AM
when i debug, and try to start the application again, it doesn't break @
Form1_Activate, which means it's not even being called


[quoted text, click to view]

Re: running app in background still not working on Smartphone Sergey Bogdanov
2/11/2005 12:10:22 PM
Mustafa,

Applications that are written with Compact Framework 1.0 for Smartphone
2003 (as well as PocketPC) are single-instance applications. That is why
you can not run application when it has been already run (see the
excellent Alex Feinman's article [1]). Though as stated in this article
there is workaround - find NETCF_AGL_PARK_ window handle for your
application and rename it. When your application will be run next time
you can find Main window by title and activate it. See the complete
example here [2].

[1]
http://blog.opennetcf.org/afeinman/PermaLink,guid,ec034858-e071-4daa-b1be-0323b7f54b11.aspx

[2]
http://www.sergeybogdanov.com/Samples/SPSingleInstance.zip

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com


[quoted text, click to view]
Re: running app in background still not working on Smartphone Mustafa Rabie
2/11/2005 1:28:56 PM
hi sergey
it worked thanks a lot
[quoted text, click to view]

AddThis Social Bookmark Button