ExitWindowsEx貌似只能针对所有活动的,而我想只针对指定用户,不要说logoff,调用cmd有点悲催。。提前谢过大家!
解决方案 »
- 下载源代码中文件名中(VC)表示什么
- vs2010取消“显示所有文件”就崩溃
- sprintf为什么只输出第一个字符
- 开发群,欢迎加入!!!!!!!!!!!!!
- 求救ADO错误:IDispatch error #3121
- 请问‘巨集’是什么东西?
- CFile::Read()怎么从文件中指定位置往后读?
- 妈妈呀,TCP/IP这是怎么了???
- 学C++如何入手?
- 如何判断一个Socket是否是Active,还有如何判断一个文件已经打开?
- 服务器上的页面无法创建activex
- 小弟编了一个MFC程序,给一个编辑框关联一个变量后,程序编译链接没错,程序运行出了提示框“请键入一个数”请教各位高手怎么解决啊?
BOOL WTSLogoffSession(
HANDLE hServer,
DWORD SessionId,
BOOL bWait
);Parameters
hServer
[in] Handle to a terminal server. Specify a handle opened by the WTSOpenServer function, or specify WTS_CURRENT_SERVER_HANDLE to indicate the terminal server on which your application is running.
SessionId
[in] A Terminal Services session identifier. To indicate the current session, specify WTS_CURRENT_SESSION. You can use the WTSEnumerateSessions function to retrieve the identifiers of all sessions on a specified terminal server.
To be able to log off another user's session, you need to have the Reset permission. For more information, see Terminal Services Permissions. To modify permissions on a session, use the Terminal Services Configuration administrative tool.bWait
[in] Indicates whether the operation is synchronous.
If bWait is TRUE, the function returns when the session is logged off.If bWait is FALSE, the function returns immediately. To verify that the session has been logged off, specify the session identifier in a call to the WTSQuerySessionInformation function. WTSQuerySessionInformation returns zero if the session is logged off.