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

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

    <legend id='uENlG'><style id='uENlG'><dir id='uENlG'><q id='uENlG'></q></dir></style></legend>
    <tfoot id='uENlG'></tfoot>
      <bdo id='uENlG'></bdo><ul id='uENlG'></ul>

        創建沒有窗口的應用程序

        Create an Application without a Window(創建沒有窗口的應用程序)
        <i id='ecCyy'><tr id='ecCyy'><dt id='ecCyy'><q id='ecCyy'><span id='ecCyy'><b id='ecCyy'><form id='ecCyy'><ins id='ecCyy'></ins><ul id='ecCyy'></ul><sub id='ecCyy'></sub></form><legend id='ecCyy'></legend><bdo id='ecCyy'><pre id='ecCyy'><center id='ecCyy'></center></pre></bdo></b><th id='ecCyy'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ecCyy'><tfoot id='ecCyy'></tfoot><dl id='ecCyy'><fieldset id='ecCyy'></fieldset></dl></div>

      1. <tfoot id='ecCyy'></tfoot>

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

        • <bdo id='ecCyy'></bdo><ul id='ecCyy'></ul>
          <legend id='ecCyy'><style id='ecCyy'><dir id='ecCyy'><q id='ecCyy'></q></dir></style></legend>

              <tbody id='ecCyy'></tbody>

                1. 本文介紹了創建沒有窗口的應用程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  您將如何編寫無需打開窗口或控制臺即可運行的 C/C++ 應用程序?

                  How would you program a C/C++ application that could run without opening a window or console?

                  推薦答案

                  當您編寫 WinMain 程序時,您會自動將/SUBSYSTEM 選項設置為編譯器中的窗口.(假設您使用 Visual Studio).對于任何其他編譯器,可能存在類似的選項,但標志名稱可能不同.

                  When you write a WinMain program, you automatically get the /SUBSYSTEM option to be windows in the compiler. (Assuming you use Visual Studio). For any other compiler a similar option might be present but the flag name might be different.

                  這會導致編譯器以可執行文件格式(PE 格式) 將可執行文件標記為 Windows 可執行文件.

                  This causes the compiler to create an entry in the executable file format (PE format) that marks the executable as a windows executable.

                  一旦此信息出現在可執行文件中,啟動程序的系統加載程序會將您的二進制文件視為 Windows 可執行文件而不是控制臺程序,因此它不會導致控制臺窗口在運行時自動打開.

                  Once this information is present in the executable, the system loader that starts the program will treat your binary as a windows executable and not a console program and therefore it does not cause console windows to automatically open when it runs.

                  但是如果不需要,Windows 程序不需要創建任何窗口,就像您在任務欄中看到的所有那些程序和服務一樣,但沒有看到任何對應的窗口.如果您創建了一個窗口但選擇不顯示它,也會發生這種情況.

                  But a windows program need not create any windows if it need not want to, much like all those programs and services that you see running in the taskbar, but do not see any corresponding windows for them. This can also happen if you create a window but opt not to show it.

                  你需要做的就是實現這一切,

                  All you need to do, to achieve all this is,

                  #include <Windows.h>
                  
                  int WinMain(HINSTANCE hInstance,
                              HINSTANCE hPrevInstance, 
                              LPTSTR    lpCmdLine, 
                              int       cmdShow)
                      {
                      /* do your stuff here. If you return from this function the program ends */
                      }
                  

                  您需要 WinMain 本身的原因是,一旦您將子系統標記為 Windows,鏈接器就會假定您的入口點函數(在程序加載和 C Run TIme 庫初始化后調用)將是 WinMain 而不是 main.如果您沒有在此類程序中提供 WinMain,您將在鏈接過程中收到未解決的符號錯誤.

                  The reason you require a WinMain itself is that once you mark the subsystem as Windows, the linker assumes that your entry point function (which is called after the program loads and the C Run TIme library initializes) will be WinMain and not main. If you do not provide a WinMain in such a program you will get an un-resolved symbol error during the linking process.

                  這篇關于創建沒有窗口的應用程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 之間的區別)
                    <bdo id='gQE1H'></bdo><ul id='gQE1H'></ul>
                        <tbody id='gQE1H'></tbody>
                      <tfoot id='gQE1H'></tfoot>

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

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

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

                          • 主站蜘蛛池模板: 亚洲网站在线观看 | 日日夜夜草 | 久久久久久亚洲国产精品 | 欧美激情五月 | 欧美综合久久久 | 成人一区二区三区在线观看 | 超碰综合 | 男人视频网站 | 中文av网站 | 免费激情网站 | 国内精品视频在线观看 | 国产在线视频三区 | 伊人免费观看视频 | 国产美女精品视频 | 中文字幕专区 | 五月婷婷婷 | 99re66在线观看精品热 | 黄色a视频| 久久久久国产精品午夜一区 | 日韩在线不卡视频 | 日本精品一区二区三区四区 | 国产一区不卡 | 成人免费小视频 | 国产精品中文字幕在线 | 欧美久久一区二区三区 | 久久久噜噜噜久久中文字幕色伊伊 | 秋霞a级毛片在线看 | 91xxx在线观看 | 亚洲一区二区三区免费 | 亚洲一区二区三区在线 | 久久精品免费一区二区 | 亚洲国产精品一区二区三区 | 国产成人av在线 | 日韩久久久久 | 第一区在线观看免费国语入口 | 黑人精品欧美一区二区蜜桃 | 中文字幕第一页在线 | 可以看黄的视频 | 免费同性女女aaa免费网站 | 高清不卡毛片 | 九七午夜剧场福利写真 |