亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? counter.cpp

?? windows 程序開發(fā)人員必備的參考書。這本書可以幫助您理解windows的精髓和核心構(gòu)成。這應(yīng)該是同類書中最權(quán)威
?? CPP
字號(hào):
/******************************************************************************
Module:  Counter.cpp
Notices: Copyright (c) 2000 Jeffrey Richter
******************************************************************************/


#include "..\CmnHdr.h"     /* See Appendix A. */
#include <WindowsX.h>
#include <tchar.h>
#include "Resource.h"


///////////////////////////////////////////////////////////////////////////////


// The possible state of the background processing
typedef enum { 
   BPS_STARTOVER,  // Start the background processing from the beginning.
   BPS_CONTINUE,   // Continue the background processing.
   BPS_DONE        // There is no background processing to do.
} BKGNDPROCSTATE;


typedef struct {
   PVOID pFiberUI;      // User interface fiber execution context
   HWND  hwnd;          // Handle of main UI window
   BKGNDPROCSTATE bps;  // State of background processing
} FIBERINFO, *PFIBERINFO;


// A global that contains application state information. This 
// global is accessed directly by the UI fiber and indirectly
// by the background processing fiber.
FIBERINFO g_FiberInfo;


///////////////////////////////////////////////////////////////////////////////


void WINAPI FiberFunc(PVOID pvParam) {

   PFIBERINFO pFiberInfo = (PFIBERINFO) pvParam;

   // Update the window showing which fiber is executing.
   SetDlgItemText(pFiberInfo->hwnd, IDC_FIBER, TEXT("Recalculation"));

   // Get the current count in the EDIT control.
   int nCount = GetDlgItemInt(pFiberInfo->hwnd, IDC_COUNT, NULL, FALSE);
   
   // Count from 0 to nCount, updating the STATIC control.
   for (int x = 0; x <= nCount; x++) {

      // UI events have higher priority than counting.
      // If there are any UI events, handle them ASAP.
      if (HIWORD(GetQueueStatus(QS_ALLEVENTS)) != 0) {

         // The UI fiber has something to do; temporarily
         // pause counting and handle the UI events.
         SwitchToFiber(pFiberInfo->pFiberUI);

         // The UI has no more events; continue counting.
         SetDlgItemText(pFiberInfo->hwnd, IDC_FIBER, TEXT("Recalculation"));
      }

      // Update the STATIC control with the most recent count.
      SetDlgItemInt(pFiberInfo->hwnd, IDC_ANSWER, x, FALSE);

      // Sleep for a while to exaggerate the effect; remove 
      // the call to Sleep in production code.
      Sleep(200);
   }

   // Indicate that counting is complete.
   pFiberInfo->bps = BPS_DONE;

   // Reschedule the UI thread. When the UI thread is running
   // and has no events to process, the thread is put to sleep.
   // NOTE: If we just allow the fiber function to return,
   // the thread and the UI fiber die -- we don't want this!
   SwitchToFiber(pFiberInfo->pFiberUI);
}


///////////////////////////////////////////////////////////////////////////////


BOOL Dlg_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam) {

   chSETDLGICONS(hwnd, IDI_COUNTER);

   SetDlgItemInt(hwnd, IDC_COUNT, 0, FALSE);
   return(TRUE);
}


///////////////////////////////////////////////////////////////////////////////


void Dlg_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify) {

   switch (id) {
      case IDCANCEL: 
         PostQuitMessage(0);
         break;

      case IDC_COUNT:
         if (codeNotify == EN_CHANGE) {

            // When the user changes the count, start the 
            // background processing over from the beginning.
            g_FiberInfo.bps = BPS_STARTOVER; 
         }
         break;
   }
}


///////////////////////////////////////////////////////////////////////////////


INT_PTR WINAPI Dlg_Proc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {

   switch (uMsg) {
      chHANDLE_DLGMSG(hwnd, WM_INITDIALOG, Dlg_OnInitDialog);
      chHANDLE_DLGMSG(hwnd, WM_COMMAND,    Dlg_OnCommand);
   }
   return(FALSE);
}


///////////////////////////////////////////////////////////////////////////////


int WINAPI _tWinMain(HINSTANCE hinstExe, HINSTANCE, PTSTR pszCmdLine, int) {

   // Counter fiber execution context
   PVOID pFiberCounter = NULL;   

   // Convert this thread to a fiber.
   g_FiberInfo.pFiberUI = ConvertThreadToFiber(NULL);

   // Create the application's UI window.
   g_FiberInfo.hwnd = CreateDialog(hinstExe, MAKEINTRESOURCE(IDD_COUNTER), 
      NULL, Dlg_Proc);

   // Update the window showing which fiber is executing.
   SetDlgItemText(g_FiberInfo.hwnd, IDC_FIBER, TEXT("User interface"));

   // Initially, there is no background processing to be done.
   g_FiberInfo.bps = BPS_DONE;

   // While the UI window still exists...
   BOOL fQuit = FALSE;
   while (!fQuit) {

      // UI messages are higher priority than background processing.
      MSG msg;
      if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {

         // If a message exists in the queue, process it.
         fQuit = (msg.message == WM_QUIT);
         if (!IsDialogMessage(g_FiberInfo.hwnd, &msg)) {
            TranslateMessage(&msg);
            DispatchMessage(&msg);
         }

      } else {

         // No UI msgs exist; check the state of the background processing.
         switch (g_FiberInfo.bps) {
            case BPS_DONE:
               // No background processing to do; wait for a UI event.
               WaitMessage();
               break;

            case BPS_STARTOVER:
               // User changed the count; restart the background processing.

               if (pFiberCounter != NULL) { 
                  // A recalculation fiber exists; delete it so that
                  // background processing starts over from the beginning.
                  DeleteFiber(pFiberCounter); 
                  pFiberCounter = NULL; 
               }

               // Create a new recalc fiber that starts from the beginning.
               pFiberCounter = CreateFiber(0, FiberFunc, &g_FiberInfo);

               // The background processing started; it should continue.
               g_FiberInfo.bps = BPS_CONTINUE;

               // Fall through to BPS_CONTINUE case...

            case BPS_CONTINUE:
               // Allow the background processing to execute...
               SwitchToFiber(pFiberCounter);

               // The background processing has been paused 
               // (because a UI message showed up) or has been 
               // stopped (because the counting has completed).

               // Update the window showing which fiber is executing.
               SetDlgItemText(g_FiberInfo.hwnd, IDC_FIBER, 
                  TEXT("User interface"));

               if (g_FiberInfo.bps == BPS_DONE) { 
                  // The background processing ran to completion. Delete the
                  // fiber so that processing will restart next time.
                  DeleteFiber(pFiberCounter); 
                  pFiberCounter = NULL; 
               }
               break;
         }  // switch on background processing state

      }  // No UI messages exist
   }  // while the window still exists
   DestroyWindow(g_FiberInfo.hwnd); 

   return(0);  // End the application.
}


//////////////////////////////// End of File //////////////////////////////////

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久夜色精品国产欧美乱极品| 99久久国产综合精品女不卡| 成人性生交大片免费| 色婷婷精品久久二区二区蜜臀av| 欧美日韩精品系列| 精品国产91九色蝌蚪| 亚洲欧洲性图库| 日韩国产精品久久| 成人精品鲁一区一区二区| 91香蕉视频mp4| 日韩丝袜美女视频| 亚洲视频一二三| 免费久久99精品国产| 成人动漫一区二区| 日韩网站在线看片你懂的| 国产精品美女一区二区| 日韩av一级电影| 91视视频在线观看入口直接观看www| 欧美一区二区不卡视频| 国产精品传媒入口麻豆| 老色鬼精品视频在线观看播放| 不卡视频在线观看| 欧美一区二区在线观看| 日韩理论片网站| 久久国产精品99久久人人澡| 色先锋aa成人| 国产日韩亚洲欧美综合| 秋霞电影网一区二区| 99久久99久久精品免费观看| 久久综合九色综合97婷婷| 亚洲第一福利一区| 成人午夜激情片| 日韩欧美成人午夜| 亚洲国产一区二区三区青草影视| 国产·精品毛片| 日韩欧美一区二区久久婷婷| 亚洲欧美色图小说| 国产91富婆露脸刺激对白| 日韩免费观看2025年上映的电影| 亚洲激情在线播放| 99热这里都是精品| 久久看人人爽人人| 久久福利视频一区二区| 欧美性猛片xxxx免费看久爱| 成人免费在线播放视频| 国产精品一区二区视频| 91精品国产欧美一区二区18| 亚洲最大成人综合| 97精品久久久午夜一区二区三区| 国产亚洲一区二区三区| 韩国精品久久久| 精品久久五月天| 日本欧美一区二区三区乱码 | 国产清纯美女被跳蛋高潮一区二区久久w| 亚洲国产精品久久久久婷婷884| 99在线热播精品免费| 国产日韩欧美a| 激情五月激情综合网| 日韩欧美国产麻豆| 日本成人在线不卡视频| 欧美日韩aaaaa| 亚洲一级二级三级| 色久优优欧美色久优优| 亚洲天堂中文字幕| 不卡视频一二三| 国产精品三级久久久久三级| 国产成人日日夜夜| 国产日产欧美精品一区二区三区| 国产电影一区二区三区| 久久精品欧美日韩精品| 高清不卡在线观看| 国产日韩成人精品| 丁香婷婷综合色啪| 中文字幕在线视频一区| 91在线精品一区二区| 伊人夜夜躁av伊人久久| 欧洲一区在线观看| 日韩国产精品久久| 日韩你懂的电影在线观看| 精品影视av免费| 久久免费看少妇高潮| 国产91富婆露脸刺激对白| 国产精品国产三级国产普通话三级 | 99麻豆久久久国产精品免费| 中文字幕中文在线不卡住| 91在线视频观看| 亚洲大片精品永久免费| 欧美精品九九99久久| 另类小说图片综合网| 欧美精品一区男女天堂| 国产91精品在线观看| 亚洲美女免费在线| 欧美日韩电影一区| 精品一区在线看| 国产精品欧美久久久久无广告| 91亚洲午夜精品久久久久久| 午夜影视日本亚洲欧洲精品| 日韩一级大片在线| 国产成人激情av| 亚洲黄色免费网站| 日韩一区二区在线观看视频 | 亚洲欧洲精品一区二区三区不卡| 色婷婷综合五月| 免费人成黄页网站在线一区二区| 久久天天做天天爱综合色| a4yy欧美一区二区三区| 午夜免费欧美电影| 久久婷婷色综合| 91福利视频网站| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美国产97人人爽人人喊| 91国偷自产一区二区三区观看 | 2022国产精品视频| 91污片在线观看| 日韩va亚洲va欧美va久久| 国产欧美一区二区精品性| 欧美优质美女网站| 国产一区二区三区免费看| 亚洲综合在线免费观看| 日韩精品影音先锋| 一本色道久久综合狠狠躁的推荐| 久久99这里只有精品| 国产精品电影一区二区| 日韩一区二区三区电影在线观看| 成人精品视频一区| 免费一级欧美片在线观看| 国产精品久久精品日日| 欧美一级在线视频| 99久久99久久精品免费看蜜桃 | 国产精品欧美一级免费| 欧美一级二级三级乱码| 99re8在线精品视频免费播放| 美美哒免费高清在线观看视频一区二区 | 国产一区二区三区在线看麻豆| 一区二区三区国产精品| 国产视频视频一区| 91麻豆精品国产91久久久资源速度| 成人午夜电影久久影院| 免费在线看成人av| 一区二区三区在线影院| 欧美国产一区在线| 亚洲精品在线一区二区| 欧美日韩精品久久久| av毛片久久久久**hd| 国产在线精品一区二区夜色| 亚洲小说春色综合另类电影| 欧美国产精品一区| 日韩精品自拍偷拍| 欧美另类高清zo欧美| 色美美综合视频| 成人一区二区三区| 国产精品99久久久久久有的能看| 天使萌一区二区三区免费观看| 亚洲欧美另类久久久精品| 国产日韩欧美高清| 久久综合色之久久综合| 精品乱人伦小说| 91精品国模一区二区三区| 91福利在线播放| 色呦呦网站一区| 99久久久久久99| 成人理论电影网| 国产91对白在线观看九色| 国产精品一区二区男女羞羞无遮挡| 免费精品视频在线| 日韩vs国产vs欧美| 日本麻豆一区二区三区视频| 亚洲成人一二三| 一区二区三区在线播放| 一区二区在线电影| 亚洲男人天堂一区| 自拍偷拍亚洲欧美日韩| 亚洲人成7777| 中文字幕日韩欧美一区二区三区| 国产日韩欧美精品一区| 国产精品入口麻豆九色| 国产精品欧美综合在线| 亚洲国产成人在线| 国产精品美女久久久久aⅴ| 国产日韩精品一区二区三区在线| 久久九九久精品国产免费直播| 2020国产精品自拍| 久久亚洲免费视频| 中文字幕不卡在线播放| 中文字幕在线免费不卡| 亚洲激情校园春色| 亚洲午夜免费电影| 天天爽夜夜爽夜夜爽精品视频| 天天操天天色综合| 美女脱光内衣内裤视频久久网站 | 26uuu欧美| 欧美国产在线观看| 1区2区3区精品视频| 亚洲精品日产精品乱码不卡| 亚洲伊人伊色伊影伊综合网| 亚洲午夜电影在线观看| 日本三级亚洲精品| 国产一区二区三区免费在线观看| 粉嫩av一区二区三区| 91在线视频免费91|