久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='U0mFg'></bdo><ul id='U0mFg'></ul>
  • <small id='U0mFg'></small><noframes id='U0mFg'>

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

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

        Windows 服務如何執行 GUI 應用程序?

        How can a Windows service execute a GUI application?(Windows 服務如何執行 GUI 應用程序?)

        1. <tfoot id='yS6k1'></tfoot>
            <bdo id='yS6k1'></bdo><ul id='yS6k1'></ul>
            • <small id='yS6k1'></small><noframes id='yS6k1'>

              <legend id='yS6k1'><style id='yS6k1'><dir id='yS6k1'><q id='yS6k1'></q></dir></style></legend>
                <tbody id='yS6k1'></tbody>

                1. <i id='yS6k1'><tr id='yS6k1'><dt id='yS6k1'><q id='yS6k1'><span id='yS6k1'><b id='yS6k1'><form id='yS6k1'><ins id='yS6k1'></ins><ul id='yS6k1'></ul><sub id='yS6k1'></sub></form><legend id='yS6k1'></legend><bdo id='yS6k1'><pre id='yS6k1'><center id='yS6k1'></center></pre></bdo></b><th id='yS6k1'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yS6k1'><tfoot id='yS6k1'></tfoot><dl id='yS6k1'><fieldset id='yS6k1'></fieldset></dl></div>
                  本文介紹了Windows 服務如何執行 GUI 應用程序?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我編寫了一個 Windows 服務,允許我遠程運行和停止應用程序.這些應用程序使用 CreateProcess 運行,這對我有用,因為它們中的大多數只執行后端處理.最近,我需要運行向當前登錄用戶顯示 GUI 的應用程序.我如何使用 C++ 編寫代碼以允許我的服務定位當前活動的桌面并在其上運行 GUI?

                  I have written a Windows service that allows me to remotely run and stop applications. These applications are run using CreateProcess, and this works for me because most of them only perform backend processing. Recently, I need to run applications that present GUI to the current log in user. How do I code in C++ to allow my service to locate the currently active desktop and run the GUI on it?

                  推薦答案

                  Roger Lipscombe 的回答,使用 WTSEnumerateSessions 找到合適的桌面,然后 CreateProcessAsUser 在該桌面上啟動應用程序(您將桌面句柄作為 STARTUPINFO 結構)是正確的.

                  Roger Lipscombe's answer, to use WTSEnumerateSessions to find the right desktop, then CreateProcessAsUser to start the application on that desktop (you pass it the handle of the desktop as part of the STARTUPINFO structure) is correct.

                  但是,我強烈建議不要這樣做.在某些環境中,例如具有許多活躍用戶的終端服務器主機,確定哪個桌面是活躍"桌面并不容易,甚至可能不可能.

                  However, I would strongly recommend against doing this. In some environments, such as Terminal Server hosts with many active users, determining which desktop is the 'active' one isn't easy, and may not even be possible.

                  但最重要的是,如果一個應用程序突然出現在用戶的桌面上,這很可能發生在一個糟糕的時間(或者因為用戶根本沒有預料到它,或者因為你試圖在會話尚未完全初始化,正在關閉或其他過程中).

                  But most importantly, if an application will suddenly appear on a user's desktop, this may very well occur at a bad time (either because the user simply isn't expecting it, or because you're trying to launch the app when the session isn't quite initialized yet, in the process of shutting down, or whatever).

                  更傳統的方法是在全局啟動組中為您的服務添加一個小型客戶端應用程序的快捷方式.然后,此應用將與每個用戶會話一起啟動,并可用于啟動其他應用(如果需要),而無需處理用戶憑據、會話和/或桌面.

                  A more conventional approach would be to put a shortcut to a small client app for your service in the global startup group. This app will then launch along with every user session, and can be used start other apps (if so desired) without any juggling of user credentials, sessions and/or desktops.

                  此外,管理員可以根據需要移動/禁用此快捷方式,這將使您的應用程序的部署更加容易,因為它不會偏離其他 Windows 應用程序使用的標準...

                  Also, this shortcut can be moved/disabled by administrators as desired, which will make deployment of your application much easier, since it doesn't deviate from the standards used by other Windows apps...

                  這篇關于Windows 服務如何執行 GUI 應用程序?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  In what ways do C++ exceptions slow down code when there are no exceptions thown?(當沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                  Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                  When and how should I use exception handling?(我應該何時以及如何使用異常處理?)
                  Scope of exception object in C++(C++中異常對象的范圍)
                  Catching exceptions from a constructor#39;s initializer list(從構造函數的初始化列表中捕獲異常)
                  Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區別)
                  <legend id='JWPry'><style id='JWPry'><dir id='JWPry'><q id='JWPry'></q></dir></style></legend>

                    1. <small id='JWPry'></small><noframes id='JWPry'>

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

                        <tfoot id='JWPry'></tfoot>
                        • <bdo id='JWPry'></bdo><ul id='JWPry'></ul>
                              <tbody id='JWPry'></tbody>
                            主站蜘蛛池模板: 精品视频一区二区三区在线观看 | 久久久久久国产精品久久 | 视频三区 | 国产丝袜一区二区三区免费视频 | 国产一区二区三区不卡av | 伊人91在线 | 国产激情91久久精品导航 | 91精品一区二区三区久久久久久 | 理论片87福利理论电影 | 国产亚洲第一页 | 一区二区三区四区在线视频 | 国产精品女人久久久 | 国产免费观看一级国产 | 丁香婷婷在线视频 | 成人国产免费观看 | 一区二区在线不卡 | 国产精品一区二区精品 | 91九色porny首页最多播放 | 亚洲欧美日韩精品久久亚洲区 | 亚洲一区二区日韩 | 日本成人综合 | 久久在线 | 精品国产1区2区3区 在线国产视频 | 狠狠夜夜 | 第一区在线观看免费国语入口 | 超级黄色一级片 | 久久99精品视频 | 日韩精品免费在线观看 | 青青伊人久久 | 看av网 | 久久久久国产 | 久久国产精品一区二区三区 | 国产久 | av黄色免费在线观看 | 国产高清视频在线 | 精品免费视频一区二区 | 日韩一级欧美一级 | 亚洲第一中文字幕 | 精品麻豆剧传媒av国产九九九 | 中文字幕第一页在线 | 精品久久久久久久久久 |