Click here to Skip to main content
15,898,373 members
Home / Discussions / C#
   

C#

 
GeneralRe: Scroll Bars Pin
vickycao5-Jan-03 21:45
vickycao5-Jan-03 21:45 
GeneralScollable PictureBox Pin
Torsch13-Dec-02 5:12
Torsch13-Dec-02 5:12 
GeneralRe: Scollable PictureBox Pin
leppie13-Dec-02 7:00
leppie13-Dec-02 7:00 
GeneralRe: Scollable PictureBox Pin
Torsch13-Dec-02 9:18
Torsch13-Dec-02 9:18 
GeneralRe: Scollable PictureBox Pin
leppie13-Dec-02 9:36
leppie13-Dec-02 9:36 
GeneralIs Windows Shutting Down Pin
OBRon13-Dec-02 4:12
OBRon13-Dec-02 4:12 
GeneralRe: Is Windows Shutting Down Pin
Richard Deeming13-Dec-02 5:47
mveRichard Deeming13-Dec-02 5:47 
GeneralRe: Is Windows Shutting Down Pin
Gaul14-Dec-02 17:10
Gaul14-Dec-02 17:10 
When the user initiates a shutdown, or when the OS is is about to shutdown, Windows sends out the WM_QUERYENDSESSION to all top level applications. Applications should return a non-zero to allow the the shutdown to continue. If any application returns zero, the session is not ended. The system stops sending WM_QUERYENDSESSION messages as soon as one application returns zero.

You could override the WndProc (Window Procedure) for you main form, and watch for the WM_QUERYENDSESSION message.

public enum Msg
{
WM_QUERYENDSESSION = 0x0011,
WM_QUIT = 0x0012,
WM_ENDSESSION = 0x0016,
}

protected override void WndProc(ref Message m)
{
switch(m.Msg)
{
case (int)Msg.WM_QUERYENDSESSION:
// your code to handle the end session or respond to it


break;
default:
base.WndProc(ref m);
break;
}
}





Gaulles
http://www.gaulles.com
GeneralRe: Is Windows Shutting Down Pin
OBRon16-Dec-02 4:01
OBRon16-Dec-02 4:01 
GeneralDirect console output to a window Pin
Daniel Bright13-Dec-02 3:19
Daniel Bright13-Dec-02 3:19 
GeneralRe: Direct console output to a window Pin
Nick Parker13-Dec-02 3:23
protectorNick Parker13-Dec-02 3:23 
GeneralRe: Direct console output to a window Pin
Daniel Bright13-Dec-02 9:11
Daniel Bright13-Dec-02 9:11 
GeneralRe: Direct console output to a window Pin
Richard Deeming13-Dec-02 5:52
mveRichard Deeming13-Dec-02 5:52 
GeneralInstall Shield Serial Validation Pin
Murat YILDIZ12-Dec-02 22:33
Murat YILDIZ12-Dec-02 22:33 
GeneralRe: Install Shield Serial Validation Pin
Shaun Wilde13-Dec-02 3:49
Shaun Wilde13-Dec-02 3:49 
GeneralRe: Install Shield Serial Validation Pin
Murat YILDIZ13-Dec-02 4:12
Murat YILDIZ13-Dec-02 4:12 
GeneralRe: Install Shield Serial Validation Pin
Shaun Wilde13-Dec-02 9:05
Shaun Wilde13-Dec-02 9:05 
GeneralRe: Install Shield Serial Validation Pin
Murat YILDIZ13-Dec-02 22:55
Murat YILDIZ13-Dec-02 22:55 
Questionhow to rightClick any file in windows - > I find my menu item Pin
ashshab12-Dec-02 12:13
sussashshab12-Dec-02 12:13 
AnswerRe: how to rightClick any file in windows - > I find my menu item Pin
Kannan Kalyanaraman12-Dec-02 17:38
Kannan Kalyanaraman12-Dec-02 17:38 
GeneralRe: how to rightClick any file in windows - > I find my menu item Pin
grv57513-Dec-02 1:53
grv57513-Dec-02 1:53 
GeneralControls in C# Pin
David K12-Dec-02 11:36
David K12-Dec-02 11:36 
GeneralRe: Controls in C# Pin
Christian Graus12-Dec-02 18:11
protectorChristian Graus12-Dec-02 18:11 
GeneralRe: Controls in C# Pin
James T. Johnson13-Dec-02 1:06
James T. Johnson13-Dec-02 1:06 
GeneralRe: Controls in C# Pin
grv57513-Dec-02 2:19
grv57513-Dec-02 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.