1. <tfoot id='13tAe'></tfoot>

      • <bdo id='13tAe'></bdo><ul id='13tAe'></ul>
        <i id='13tAe'><tr id='13tAe'><dt id='13tAe'><q id='13tAe'><span id='13tAe'><b id='13tAe'><form id='13tAe'><ins id='13tAe'></ins><ul id='13tAe'></ul><sub id='13tAe'></sub></form><legend id='13tAe'></legend><bdo id='13tAe'><pre id='13tAe'><center id='13tAe'></center></pre></bdo></b><th id='13tAe'></th></span></q></dt></tr></i><div id='13tAe'><tfoot id='13tAe'></tfoot><dl id='13tAe'><fieldset id='13tAe'></fieldset></dl></div>

        <small id='13tAe'></small><noframes id='13tAe'>

        <legend id='13tAe'><style id='13tAe'><dir id='13tAe'><q id='13tAe'></q></dir></style></legend>

        如何在 Windows 上用 C++ 创建进程?

        时间:2023-08-01

          <i id='paVvv'><tr id='paVvv'><dt id='paVvv'><q id='paVvv'><span id='paVvv'><b id='paVvv'><form id='paVvv'><ins id='paVvv'></ins><ul id='paVvv'></ul><sub id='paVvv'></sub></form><legend id='paVvv'></legend><bdo id='paVvv'><pre id='paVvv'><center id='paVvv'></center></pre></bdo></b><th id='paVvv'></th></span></q></dt></tr></i><div id='paVvv'><tfoot id='paVvv'></tfoot><dl id='paVvv'><fieldset id='paVvv'></fieldset></dl></div>
        • <tfoot id='paVvv'></tfoot>

            <bdo id='paVvv'></bdo><ul id='paVvv'></ul>
                <tbody id='paVvv'></tbody>

                  <legend id='paVvv'><style id='paVvv'><dir id='paVvv'><q id='paVvv'></q></dir></style></legend>

                  <small id='paVvv'></small><noframes id='paVvv'>

                  本文介绍了如何在 Windows 上用 C++ 创建进程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  谁能告诉我如何在 VC++ 中创建一个进程?我需要执行

                  Can anyone tell me how to create a process in VC++? I need to execute

                  regasm.exe testdll /tlb:test.tlb /codebase
                  

                  该过程中的命令.

                  推荐答案

                  regasm.exe(程序集注册工具)对 Windows 注册表进行更改,因此如果您想启动 regasm.exe 作为提升的进程,您可以使用以下代码:

                  regasm.exe(Assembly Registration Tool) makes changes to the Windows Registry, so if you want to start regasm.exe as elevated process you could use the following code:

                  #include "stdafx.h"
                  #include "windows.h"
                  #include "shellapi.h"
                  
                  int _tmain(int argc, _TCHAR* argv[])
                  {
                        SHELLEXECUTEINFO shExecInfo;
                  
                        shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
                  
                        shExecInfo.fMask = NULL;
                        shExecInfo.hwnd = NULL;
                        shExecInfo.lpVerb = L"runas";
                        shExecInfo.lpFile = L"regasm.exe";
                        shExecInfo.lpParameters = L"testdll /tlb:test.tlb /codebase";
                        shExecInfo.lpDirectory = NULL;
                        shExecInfo.nShow = SW_NORMAL;
                        shExecInfo.hInstApp = NULL;
                  
                        ShellExecuteEx(&shExecInfo);
                  
                        return 0;
                  }
                  

                  shExecInfo.lpVerb = L"runas" 表示该进程将以提升的权限启动.如果您不想要,只需将 shExecInfo.lpVerb 设置为 NULL.但在 Vista 或 Windows 7 下,更改 Windows 注册表的某些部分需要管理员权限.

                  shExecInfo.lpVerb = L"runas" means that process will be started with elevated privileges. If you don't want that just set shExecInfo.lpVerb to NULL. But under Vista or Windows 7 it's required administrator rights to change some parts of Windows Registry.

                  这篇关于如何在 Windows 上用 C++ 创建进程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Windows Media Foundation 录制音频 下一篇:在 C++ Win32 中获取计算机上的用户配置文件列表

                  相关文章

                  最新文章

                    <i id='9i9yr'><tr id='9i9yr'><dt id='9i9yr'><q id='9i9yr'><span id='9i9yr'><b id='9i9yr'><form id='9i9yr'><ins id='9i9yr'></ins><ul id='9i9yr'></ul><sub id='9i9yr'></sub></form><legend id='9i9yr'></legend><bdo id='9i9yr'><pre id='9i9yr'><center id='9i9yr'></center></pre></bdo></b><th id='9i9yr'></th></span></q></dt></tr></i><div id='9i9yr'><tfoot id='9i9yr'></tfoot><dl id='9i9yr'><fieldset id='9i9yr'></fieldset></dl></div>

                    • <bdo id='9i9yr'></bdo><ul id='9i9yr'></ul>

                  1. <legend id='9i9yr'><style id='9i9yr'><dir id='9i9yr'><q id='9i9yr'></q></dir></style></legend>

                      <small id='9i9yr'></small><noframes id='9i9yr'>

                      <tfoot id='9i9yr'></tfoot>