SwitchDesktop()后会自行跳出回到原界面这是为什么,有什么办法留在生成的界面吗?

a244606 2018-01-29 04:45:57
SwitchDesktop()后会自行跳出回到原界面这是为什么,有什么办法留在生成的界面吗?
...全文
955 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2018-02-05
  • 打赏
  • 举报
回复
关闭原界面的explorer.exe进程再试试看。 SwitchDesktop Function Makes the specified desktop visible and activates it. This enables the desktop to receive input from the user. The calling process must have DESKTOP_SWITCHDESKTOP access to the desktop for the SwitchDesktop function to succeed. BOOL WINAPI SwitchDesktop( __in HDESK hDesktop ); Parameters hDesktop A handle to the desktop. This handle is returned by the CreateDesktop and OpenDesktop functions. This desktop must be associated with the current window station for the process. Return Value If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. However, SwitchDesktop only sets the last error for the following cases: When the desktop belongs to an invisible window station When hDesktop is an invalid handle, refers to a destroyed desktop, or belongs to a different session than that of the calling process Remarks The SwitchDesktop function fails if the desktop belongs to an invisible window station. SwitchDesktop also fails when called from a process associated with a secured desktop, such as the WinLogon and ScreenSaver desktops. Requirements Client Requires Windows Vista, Windows XP, Windows 2000 Professional, or Windows NT Workstation 3.51 and later. Server Requires Windows Server 2008, Windows Server 2003, Windows 2000 Server, or Windows NT Server 3.51 and later. Header Declared in Winuser.h; include Windows.h. Library Use User32.lib. DLL Requires User32.dll. See Also CreateDesktop Desktops OpenDesktop Window Station and Desktop Functions Send comments about this topic to Microsoft Build date: 8/15/2007

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧