J
Jeremy Horton
Hi,
New to C# and trying to build an app that has a logout button.
I just want the user to be able to log out of their Windows session from
within the Windows Form.
I have;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern bool ExitWindowsEx(string teststring1, int testint1);
// private static extern bool ExitWindows(int testint1, int testint2);
// error: entry point not found in user32.dll (?)
and then when the button is clicked;
public void Logout_Click(object sender, System.EventArgs e)
{
ExitWindowsEx(@"EWX_LOGOFF", 0);
// ExitWindows(0, 0);
// error: entry point not found in user32.dll (?)
}
With ExitWindows the entry point is not found, but with ExitWindowsEx
nothing happens (?)
I also see the memory of the .exe increasing by 4k everytime I press the
logout button,
any help greatly appreciated.
Jeremy.
New to C# and trying to build an app that has a logout button.
I just want the user to be able to log out of their Windows session from
within the Windows Form.
I have;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern bool ExitWindowsEx(string teststring1, int testint1);
// private static extern bool ExitWindows(int testint1, int testint2);
// error: entry point not found in user32.dll (?)
and then when the button is clicked;
public void Logout_Click(object sender, System.EventArgs e)
{
ExitWindowsEx(@"EWX_LOGOFF", 0);
// ExitWindows(0, 0);
// error: entry point not found in user32.dll (?)
}
With ExitWindows the entry point is not found, but with ExitWindowsEx
nothing happens (?)
I also see the memory of the .exe increasing by 4k everytime I press the
logout button,
any help greatly appreciated.
Jeremy.