Restart Application

A

Armando Rocha

Hi, 2 questions.

1.
I m working in a mobile application and i need restart my application after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i change the
language display a msgbox asking if the user want restart application, if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 
S

Simon Hart [MVP]

Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime", SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName, byte[] lpTime);
 
C

Christian Resma Helle

Wrappers for this is included in OpenNETCF's Smart Device Framework. Its
also available in source code from the old SDF 1.4

--
Regards,
Christian Helle
http://christian-helle.blogspot.com


Simon Hart said:
Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime", SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName, byte[]
lpTime);


--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi, 2 questions.

1.
I m working in a mobile application and i need restart my application
after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i change
the
language display a msgbox asking if the user want restart application, if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 
A

Armando Rocha

Hi, Thanks for the help.

I solved this problem with ProcessStartInfo(). Its work perfect.

Code below:
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);

Armando Rocha
http://www.ifthensoftware.com



Christian Resma Helle said:
Wrappers for this is included in OpenNETCF's Smart Device Framework. Its
also available in source code from the old SDF 1.4

--
Regards,
Christian Helle
http://christian-helle.blogspot.com


Simon Hart said:
Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime", SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName, byte[]
lpTime);


--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi, 2 questions.

1.
I m working in a mobile application and i need restart my application
after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i change
the
language display a msgbox asking if the user want restart application,
if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 
S

Simon Hart [MVP]

I don't see how that will work from within the same executable.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi, Thanks for the help.

I solved this problem with ProcessStartInfo(). Its work perfect.

Code below:
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);

Armando Rocha
http://www.ifthensoftware.com



Christian Resma Helle said:
Wrappers for this is included in OpenNETCF's Smart Device Framework. Its
also available in source code from the old SDF 1.4

--
Regards,
Christian Helle
http://christian-helle.blogspot.com


Simon Hart said:
Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime", SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName, byte[]
lpTime);


--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

Hi, 2 questions.

1.
I m working in a mobile application and i need restart my application
after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i change
the
language display a msgbox asking if the user want restart application,
if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 
A

Armando Rocha

Hi Simon,

When i said "change language settings", I did mean languages settings of my
own application and not languages settings of the OS (in my case WM6).

complete code:
public void RestartApp() {
Dispose(true);
Application.Exit();
//Restart new Process
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);
}

So far its work fine, but i dont know if is the right way to do it. is?

--
Armando Rocha
Mobile Developer

http://www.ifthensoftware.com
Simon Hart said:
I don't see how that will work from within the same executable.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi, Thanks for the help.

I solved this problem with ProcessStartInfo(). Its work perfect.

Code below:
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);

Armando Rocha
http://www.ifthensoftware.com



Christian Resma Helle said:
Wrappers for this is included in OpenNETCF's Smart Device Framework.
Its
also available in source code from the old SDF 1.4

--
Regards,
Christian Helle
http://christian-helle.blogspot.com


Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime",
SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName, byte[]
lpTime);


--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

Hi, 2 questions.

1.
I m working in a mobile application and i need restart my application
after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i
change
the
language display a msgbox asking if the user want restart
application,
if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 
S

Simon Hart [MVP]

I wouldn't do it that way. I take it you are running on Win CE?
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi Simon,

When i said "change language settings", I did mean languages settings of my
own application and not languages settings of the OS (in my case WM6).

complete code:
public void RestartApp() {
Dispose(true);
Application.Exit();
//Restart new Process
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);
}

So far its work fine, but i dont know if is the right way to do it. is?

--
Armando Rocha
Mobile Developer

http://www.ifthensoftware.com
Simon Hart said:
I don't see how that will work from within the same executable.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi, Thanks for the help.

I solved this problem with ProcessStartInfo(). Its work perfect.

Code below:
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);

Armando Rocha
http://www.ifthensoftware.com



"Christian Resma Helle" <[email protected]> escreveu na mensagem
Wrappers for this is included in OpenNETCF's Smart Device Framework.
Its
also available in source code from the old SDF 1.4

--
Regards,
Christian Helle
http://christian-helle.blogspot.com


Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime",
SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName, byte[]
lpTime);


--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

Hi, 2 questions.

1.
I m working in a mobile application and i need restart my application
after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i
change
the
language display a msgbox asking if the user want restart
application,
if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 
A

Armando Rocha

Hi,

I m run application on Windows Mobile 6.0, Compact Framework 3.5 on Pocket
PC HTC TyTN.

--
Armando Rocha
Mobile Developer

http://www.ifthensoftware.com
Simon Hart said:
I wouldn't do it that way. I take it you are running on Win CE?
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi Simon,

When i said "change language settings", I did mean languages settings of
my
own application and not languages settings of the OS (in my case WM6).

complete code:
public void RestartApp() {
Dispose(true);
Application.Exit();
//Restart new Process
ProcessStartInfo s = new ProcessStartInfo();
s.FileName =
Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);
}

So far its work fine, but i dont know if is the right way to do it. is?

--
Armando Rocha
Mobile Developer

http://www.ifthensoftware.com
Simon Hart said:
I don't see how that will work from within the same executable.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

Hi, Thanks for the help.

I solved this problem with ProcessStartInfo(). Its work perfect.

Code below:
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);

Armando Rocha
http://www.ifthensoftware.com



"Christian Resma Helle" <[email protected]> escreveu na mensagem
Wrappers for this is included in OpenNETCF's Smart Device Framework.
Its
also available in source code from the old SDF 1.4

--
Regards,
Christian Helle
http://christian-helle.blogspot.com


Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime",
SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName,
byte[]
lpTime);


--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

Hi, 2 questions.

1.
I m working in a mobile application and i need restart my
application
after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i
change
the
language display a msgbox asking if the user want restart
application,
if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 
S

Simon Hart [MVP]

Seems you have to use CABWIZ.exe on Windows CE, I code on Windows Mobile
which uses makecab. Also ensure you are using the correct Windows CE SDK.

See if this article helps: http://support.microsoft.com/kb/181007
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi,

I m run application on Windows Mobile 6.0, Compact Framework 3.5 on Pocket
PC HTC TyTN.

--
Armando Rocha
Mobile Developer

http://www.ifthensoftware.com
Simon Hart said:
I wouldn't do it that way. I take it you are running on Win CE?
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


Armando Rocha said:
Hi Simon,

When i said "change language settings", I did mean languages settings of
my
own application and not languages settings of the OS (in my case WM6).

complete code:
public void RestartApp() {
Dispose(true);
Application.Exit();
//Restart new Process
ProcessStartInfo s = new ProcessStartInfo();
s.FileName =
Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);
}

So far its work fine, but i dont know if is the right way to do it. is?

--
Armando Rocha
Mobile Developer

http://www.ifthensoftware.com
"Simon Hart [MVP]" <[email protected]> escreveu na mensagem
I don't see how that will work from within the same executable.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

Hi, Thanks for the help.

I solved this problem with ProcessStartInfo(). Its work perfect.

Code below:
ProcessStartInfo s = new ProcessStartInfo();
s.FileName = Assembly.GetExecutingAssembly().GetName().CodeBase;
s.UseShellExecute = false;
Process.Start(s);

Armando Rocha
http://www.ifthensoftware.com



"Christian Resma Helle" <[email protected]> escreveu na mensagem
Wrappers for this is included in OpenNETCF's Smart Device Framework.
Its
also available in source code from the old SDF 1.4

--
Regards,
Christian Helle
http://christian-helle.blogspot.com


Without writting a separate program to do this, you could use the
CeRunAppAtTime function (part of coredll.dll):

DllImport("coredll.dll", EntryPoint="CeRunAppAtTime",
SetLastError=true)]
private static extern bool CeRunAppAtTime(string pwszAppName,
byte[]
lpTime);


--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com


:

Hi, 2 questions.

1.
I m working in a mobile application and i need restart my
application
after
i change language settings. How i do that?

2.
I have a Main form and i call another form (frmLanguages), when i
change
the
language display a msgbox asking if the user want restart
application,
if
the user choose yes i want call a function in Main form to restart
application.


Armando Rocha
http://www.ifthensoftware.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top