如何使用MFC应用程序执行切换用户操作 [英] How to perform Switch User operation using an MFC application

查看:115
本文介绍了如何使用MFC应用程序执行切换用户操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

如何使用MFC应用程序对Windows进行切换用户"操作.我在google中搜索了相同的内容,但没有任何想法.我获得了以下功能进行注销.

ExitWindowsEx(EWX_LOGOFF,0);
(使用此功能,iam可以注销系统)

#define EWX_LOGOFF 0
#define EWX_SHUTDOWN 0x00000001
#define EWX_REBOOT 0x00000002
#define EWX_FORCE 0x00000004
#define EWX_POWEROFF 0x00000008
#if(_WIN32_WINNT> = 0x0500)
#define EWX_FORCEIFHUNG 0x00000010
#endif/* _WIN32_WINNT> = 0x0500 */
#define EWX_QUICKRESOLVE 0x00000020
#if(_WIN32_WINNT> = 0x0600)
#define EWX_RESTARTAPPS 0x00000040

因此,有什么类似的API可以执行窗口切换用户操作.感谢Advance.

Hello,

How to do "Switch user" operation of the windows using an MFC application.I was searching for the same in the google but didnt get any idea.I got the below function to logoff.

ExitWindowsEx(EWX_LOGOFF,0);
(With this function iam able to logoff the system)

#define EWX_LOGOFF 0
#define EWX_SHUTDOWN 0x00000001
#define EWX_REBOOT 0x00000002
#define EWX_FORCE 0x00000004
#define EWX_POWEROFF 0x00000008
#if(_WIN32_WINNT >= 0x0500)
#define EWX_FORCEIFHUNG 0x00000010
#endif /* _WIN32_WINNT >= 0x0500 */
#define EWX_QUICKRESOLVE 0x00000020
#if(_WIN32_WINNT >= 0x0600)
#define EWX_RESTARTAPPS 0x00000040

So is there any thing such kind APIs to do window Switch user.Thanks in Advance.

推荐答案


能否请您描述一下您所遇到的问题在试图解决?有丰富的API函数集,这些函数允许Windows模拟或创建登录的会话.如果您的问题是您需要访问文件系统中需要用户凭据的部分,则应该研究这些API.
Can you please describe the problem you are trying to solve? There are a rich set of API functions that allow windows to impersonate or create a logged on session. If your problem is that you need to access parts of the file system requiring user credentials then you should investigate these API''s.


这篇关于如何使用MFC应用程序执行切换用户操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆