running app in background still not working on Smartphone

  • Thread starter Thread starter Mustafa Rabie
  • Start date Start date
M

Mustafa Rabie

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
 
when i debug, and try to start the application again, it doesn't break @
Form1_Activate, which means it's not even being called
 
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
 
hi sergey
it worked thanks a lot
Sergey Bogdanov said:
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


Mustafa said:
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
 
Back
Top