服务中监视会话切换

来源:互联网 发布:云计算服务器搭建 编辑:程序博客网 时间:2024/06/10 08:36

g_UserSessionID = 0;

VOID CALLBACK OnTimerProc(HWND hwnd,UINT uMsg,UINT_PTR idEvent,DWORD dwTime)
{
 /*****if session changed then reload OSD process******/
 CurrentSessionID = WTSGetActiveConsoleSessionId();
 if ((CurrentSessionID > 0) && (CurrentSessionID != g_UserSessionID))
 {
  Log_Message(_T("Session changed"));

  g_UserSessionID = CurrentSessionID;

  }
 /*****************************************************/
}

 

SetTimer(NULL, 1, Timer_Interval, (TIMERPROC)OnTimerProc); 

原创粉丝点击