监听消息:
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
protected override void WndProc(ref Message m)
{
if( m.Msg == StartMessage.WM_QUERYENDSESSION ) //你想监听的消息
{
//你想做的事...
}
base.WndProc(ref m);
}Windows消息大全:
http://search.csdn.net/Expert/topic/1674/1674496.xml?temp=.8844416
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name="FullTrust")]
protected override void WndProc(ref Message m)
{
if( m.Msg == StartMessage.WM_QUERYENDSESSION ) //你想监听的消息
{
//你想做的事...
}
base.WndProc(ref m);
}Windows消息大全:
http://search.csdn.net/Expert/topic/1674/1674496.xml?temp=.8844416
Thread.CurrentThread
进程的操作我也不太熟悉,你把你的问题问详细一些,看看有人回答吗。
MSN:[email protected]
http://www.codeproject.com/system/logonsessions.aspalso seeEventLog change notification in realtime
http://fsilva.online.pt/node/view/5Understanding WMI Eventing
http://www.winnetmag.com/WindowsScripting/Article/ArticleID/9805/WindowsScripting_9805.html