gpt4 book ai didi

c++ - Visual Studio 2013 是否以比手动运行 .exe 更高的权限运行应用程序?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:23:25 25 4
gpt4 key购买 nike

我注意到了一些非常奇怪的事情。如果我从 VS2013 运行以下代码,它会按预期工作。但是,当我手动双击已编译的.exe 时,却没有。这让我相信 VS2013 以某种方式启动了具有提升权限的应用程序。

#include <stdio.h>
#include <tchar.h>
#include <windows.h>

int _tmain(int argc, _TCHAR* argv[])
{
printf("You have 5 seconds to open a Metro App. \nThen we'll try setting the TaskBar as the foreground window.\n\n");
Sleep(5000);

printf("Setting Taskbar as foreground window now... \n");
SetForegroundWindow(FindWindow(L"Shell_TrayWnd", NULL));

getchar();

return 0;
}

从 VS2013 运行时:即使 Metro App 打开(占据全屏),在任务栏设置为前台窗口后,用户也会被带回桌面。

双击 .exe 时:如果 Metro App 是前台窗口,则没有任何反应。

作为旁注,我尝试右键单击并“以管理员身份运行”,但是仍然没有效果。这更令人困惑。有人知道这里发生了什么吗?

此外,我正在运行 Windows 8.1 预览版。

最佳答案

不,它以相同的权限运行调试的应用程序。

但是,如果您read the manual ,你会看到权限与它无关。但是正在调试中被明确列出。

关于c++ - Visual Studio 2013 是否以比手动运行 .exe 更高的权限运行应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18681494/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com