• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            大龍的博客

            常用鏈接

            統(tǒng)計

            最新評論

            Don’t Use the Win32 API PostThreadMessage() to Post Messages to UI Threads(翻譯)

            Don’t Use the Win32 API PostThreadMessage() to Post Messages to UI Threads
              不要用Win32 API PostThreadMessage()向UI線程發(fā)送消息。
              
              PostThreadMessage is a Win32 API used to post messages to threads. Usually, the message posted is a standard windows message with the window handle set to NULL.
              PostThreadMessage是一個Win32 API常用于向線程發(fā)送消息。通常,這個被發(fā)送的消息是個窗口句柄被設(shè)為NULL的,標(biāo)準(zhǔn)的窗口消息。
              When PostThreadMessage is used to post messages to a thread that has created a window, it is very likely that the posted messages will be lost. This is because UI threads are not always run by the primary message loop. For example, when a thread is showing a message box, it is running on the message loop supplied by the message box. This secondary message loop does not know how to handle the thread message (since its window handle is NULL) and it will be dropped.
              當(dāng)你將PostThreadMessage用于向一個創(chuàng)建窗口的線程發(fā)送消息,結(jié)果這個消息很可能會丟失。這是因為UI線程并非總是在一級消息循環(huán)中。例如,當(dāng)一個線程正顯示一個消息對話框,它就運行在這個消息對話框提供的(代理的)消息循環(huán)中。這個二級消息循環(huán)不知如何處理這個線程消息(因為其窗口句柄是NULL)所以它會被放棄。
              So when posting messages to a UI threads, use PostMessage() instead and post messages to a window owned by that thread. Then the messages won’t be lost, even if the thread is running a secondary message loop.
              因此,當(dāng)要發(fā)送一個消息給UI線程,就用PostMessage()作替代并向線程自己的窗口發(fā)消息。這樣消息就不會被丟失,即便這個消息是運行在二級消息循環(huán)中。

            posted on 2009-04-22 11:37 大龍 閱讀(739) 評論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            国产色综合久久无码有码| 亚洲va久久久噜噜噜久久男同| 国产精品久久影院| 久久久噜噜噜久久中文字幕色伊伊| 久久香蕉国产线看观看99| 婷婷久久综合九色综合绿巨人| 久久无码中文字幕东京热| 精品久久久久香蕉网| 精品久久久久中文字| 日产精品久久久一区二区| 久久综合九色综合精品| 亚洲人成伊人成综合网久久久 | 99久久成人国产精品免费| 久久精品国产亚洲Aⅴ香蕉 | 久久久免费精品re6| 日日狠狠久久偷偷色综合96蜜桃| 日本欧美久久久久免费播放网| 观看 国产综合久久久久鬼色 欧美 亚洲 一区二区| 免费精品久久久久久中文字幕| 国内精品伊人久久久久AV影院| 欧美精品国产综合久久| 国产叼嘿久久精品久久| 欧美久久综合性欧美| 久久综合综合久久综合| 一本色道久久88综合日韩精品 | 国产亚洲精午夜久久久久久| 久久精品人人槡人妻人人玩AV | 久久精品国产福利国产琪琪| 国产精品久久久久jk制服| 亚洲国产一成人久久精品| 色天使久久综合网天天| 午夜视频久久久久一区 | 久久精品成人国产午夜| 九九久久自然熟的香蕉图片| 一本一本久久A久久综合精品| 久久这里只有精品首页| 久久AV高潮AV无码AV| 亚洲精品乱码久久久久久蜜桃图片| 久久久久久久精品成人热色戒| 精品久久久久久久久免费影院| 区久久AAA片69亚洲|