You can register to receive a WM_WTSSESSION_CHANGE message when that occurs by calling 'WTSRegisterSessionNotific
WTSRegisterSessionNotifica
class CMyMainWnd : public CWnd
{
//...
afx_msg LRESULT OnWM_WTSSESSION_CHANGE(WPA
//...
BEGIN_MESSAGE_MAP( CMyMainWnd, CWnd )
//{{AFX_MSG_MAP( CMyWnd
ON_MESSAGE( WM_WTSSESSION_CHANGE, OnWM_WTSSESSION_CHANGE )
// ... Possibly more entries to handle additional messages
//}}AFX_MSG_MAP
END_MESSAGE_MAP( )
};
afx_msg LRESULT CMyMainWnd::OnWM_WTSSESSIO
{
switch( wParam )
{
case WTS_CONSOLE_CONNECT:
MessageBox(m_hWnd, TEXT("WTS_CONSOLE_CONNECT"
TEXT("WM_WTSSESSION_CHANGE
break;
case WTS_CONSOLE_DISCONNECT:
MessageBox(m_hWnd, TEXT("WTS_CONSOLE_DISCONNE
TEXT("WM_WTSSESSION_CHANGE
break;
case WTS_SESSION_LOCK:
MessageBox(m_hWnd, TEXT("WTS_SESSION_LOCK"),
TEXT("WM_WTSSESSION_CHANGE
break;
case WTS_SESSION_UNLOCK:
MessageBox(m_hWnd, TEXT("WTS_SESSION_UNLOCK")
TEXT("WM_WTSSESSION_CHANGE
break;
default:
break;
}
return 0;
}
Main Topics
Browse All Topics





by: Purple_TidderPosted on 2007-07-21 at 03:54:03ID: 19538031
This may help a bit. Someone was wanting to do just that with a VB6 app.
e.com/Prog ramming/Mi sc/ Q_21438 881.html
http://www.experts-exchang