1)
using System.Runtime.InteropServices ;
.....
public class Form1 : System.Windows.Forms.Form
{
[DllImport("user32.dll", SetLastError=true)]
public static extern bool ExitWindows(
[MarshalAs(UnmanagedType.U4)]
int dwReserved,
[MarshalAs(UnmanagedType.U4)]
int uReserved);
......
.....
private void exit_button_Click(object sender, System.EventArgs e)
{
ExitWindows(0,0);
}
**
I think reason should be:
SHTDN_REASON_MAJOR_APPLICATION
but C# compiler do not understand it.
2)No application is running on my system except VS.NET and outlook
express..
in
message news:%
[email protected]...
Bredal,
Can you show the code that you are using (the declaration and the call).
Also, it is possible that there are programs that are hung and
waiting
to exit, and that is preventing the shutdown of the system.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
My apllication needs to shut down windows XP when users are done with
it
and i have therefore p/Invoked exitwindows as suggested from this
newsgroup.(My earlier posting)
Can soeone tell me why is this freezing.
Many thanks ...