已阅读5页,还剩6页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
操作系统课程设计操作系统课程设计 FIFO FIFO页面置换算法页面置换算法 课程设计课程设计 操作系统课程设计 FIFO页面置换算法 课程设计 计算机数据库课程设计 文件名 testDlg cpp Copyright c 2005 湖南农业大学 程序设计 赵德祥 日 期 2005 5 描 述 FIFO页面置换算法演示 版 本 1 0 include stdafx h include test h include testDlg h ifdef DEBUG define new DEBUG NEW undef THIS FILE static char THIS FILE FILE endif struct SeqQueue tier NULL BOOL flag CAboutDlg dialog used for App About class CAboutDlg public CDialog public CAboutDlg Dialog Data AFX DATA CAboutDlg enum IDD IDD ABOUTBOX AFX DATA ClassWizard generated virtual function overrides AFX VIRTUAL CAboutDlg protected virtual void DoDataExchange CDataExchange pDX DDX DDV support AFX VIRTUAL Implementation protected AFX MSG CAboutDlg AFX MSG DECLARE MESSAGE MAP CAboutDlg CAboutDlg CDialog CAboutDlg IDD AFX DATA INIT CAboutDlg AFX DATA INIT void CAboutDlg DoDataExchange CDataExchange pDX CDialog DoDataExchange pDX AFX DATA MAP CAboutDlg AFX DATA MAP BEGIN MESSAGE MAP CAboutDlg CDialog AFX MSG MAP CAboutDlg No message handlers AFX MSG MAP END MESSAGE MAP CTestDlg dialog CTestDlg CTestDlg CWnd pParent NULL CDialog CTestDlg IDD pParent AFX DATA INIT CTestDlg NOTE the ClassWizard will add member initialization here AFX DATA INIT Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m hIcon AfxGetApp LoadIcon IDR MAINFRAME void CTestDlg DoDataExchange CDataExchange pDX CDialog DoDataExchange pDX AFX DATA MAP CTestDlg DDX Control pDX IDC BACK m back AFX DATA MAP BEGIN MESSAGE MAP CTestDlg CDialog AFX MSG MAP CTestDlg ON WM SYSCOMMAND ON WM PAINT ON WM QUERYDRAGICON ON COMMAND ID EXIT OnExit ON COMMAND ID ABOUT OnAbout ON BN CLICKED IDC BUTTON1 OnButton1 ON BN CLICKED IDC BUTTON2 OnButton2 ON COMMAND ID RESTART OnRestart ON BN CLICKED IDC BUTTON3 OnButton3 ON BN CLICKED IDC BUTTON4 OnButton4 ON BN CLICKED IDC BUTTON5 OnButton5 ON BN CLICKED IDC BUTTON6 OnButton6 ON BN CLICKED IDC BUTTON7 OnButton7 ON BN CLICKED IDC BUTTON8 OnButton8 ON WM SHOWWINDOW ON WM TIMER AFX MSG MAP END MESSAGE MAP CTestDlg message handlers void Permute short int x flag true for int i 0 irear i if x tier page i flag false return tier ptr tier ptr 1 MAXNUM tier page tier front x tier front tier front 1 MAXNUM tier rear tier rear MAXNUM MAXNUM tier rear 1 void CTestDlg InitDemo for int i 0 iSetBitmap HBITMAP hBlt tier front 0 tier rear 0 tier ptr 1 flag true BOOL CTestDlg OnInitDialog CDialog OnInitDialog Add About menu item to system menu IDM ABOUTBOX must be in the system command range ASSERT IDM ABOUTBOX ASSERT IDM ABOUTBOX AppendMenu MF SEPARATOR pSysMenu AppendMenu MF STRING IDM ABOUTBOX strAboutMenu Set the icon for this dialog The framework does this automatically when the application s main window is not a dialog SetIcon m hIcon TRUE Set big icon SetIcon m hIcon FALSE Set small icon TODO Add extra initialization here MoveWindow 0 0 WIDTH 6 HEIGHT 44 CenterWindow bitmap LoadBitmap IDB BACK GetDlgItem IDC BACK MoveWindow 0 0 640 480 TRUE GetDlgItem IDC STATIC1 MoveWindow 73 189 75 97 TRUE m Button 0 CButton GetDlgItem IDC BUTTON1 m Button 1 CButton GetDlgItem IDC BUTTON2 m Button 2 CButton GetDlgItem IDC BUTTON3 m Button 3 CButton GetDlgItem IDC BUTTON4 m Button 4 CButton GetDlgItem IDC BUTTON5 m Button 5 CButton GetDlgItem IDC BUTTON6 m Button 6 CButton GetDlgItem IDC BUTTON7 m Button 7 CButton GetDlgItem IDC BUTTON8 m Static 0 CStatic GetDlgItem IDC STATIC1 m Static 1 CStatic GetDlgItem IDC STATIC2 m Static 2 CStatic GetDlgItem IDC STATIC3 m Static 3 CStatic GetDlgItem IDC STATIC4 m Static 4 CStatic GetDlgItem IDC STATIC5 m Static 5 CStatic GetDlgItem IDC STATIC6 m Blt 0 LoadBitmap IDB BITMAP1 m Blt 1 LoadBitmap IDB BITMAP2 m Blt 2 LoadBitmap IDB BITMAP3 m Blt 3 LoadBitmap IDB BITMAP4 m Blt 4 LoadBitmap IDB BITMAP5 m Blt 5 LoadBitmap IDB BITMAP6 m Blt 6 LoadBitmap IDB BITMAP7 m Blt 7 LoadBitmap IDB BITMAP8 hBlt LoadBitmap AfxGetInstanceHandle MAKEINTRESOURCE IDB BITMAP0 int i for i 0 iMoveWindow 9 78 i HEIGHT 120 75 97 TRUE m Button i SetBitmap HBITMAP m Blt i for i 0 iMoveWindow 76 102 i HEIGHT 120 2 75 97 TRUE m Static i MoveWindow WIDTH 100 20 75 97 TRUE GetDlgItem IDC STATIC MoveWindow WIDTH 113 120 100 20 TRUE tier SeqQueue malloc sizeof struct SeqQueue InitDemo return TRUE return TRUE unless you set the focus to a control void CTestDlg OnSysCommand UINT nID LPARAM lParam if nID dlgAbout DoModal else CDialog OnSysCommand nID lParam If you add a minimize button to your dialog you will need the code below to draw the icon For MFC applications using the document view model this is automatically done for you by the framework void CTestDlg DrawBackdrop BITMAP bm CDC pDC new CDC CClientDC dc pDC CreateCompatibleDC pDC SelectObject bitmap bitmap GetObject sizeof BITMAP dc StretchBlt 0 0 640 480 pDC 0 0 bm bmWidth bm bmHeight SRCCOPY delete pDC void CTestDlg OnPaint if IsIconic CPaintDC dc this device context for painting SendMessage WM ICONERASEBKGND WPARAM dc GetSafeHdc 0 Center icon in client rectangle int cxIcon GetSystemMetrics SM CXICON int cyIcon GetSystemMetrics SM CYICON CRect rect GetClientRect int x rect Width cxIcon 1 2 int y rect Height cyIcon 1 2 Draw the icon dc DrawIcon x y m hIcon else CDialog OnPaint DrawBackdrop The system calls this to obtain the cursor to display while the user drags the minimized window HCURSOR CTestDlg OnQueryDragIcon return HCURSOR m hIcon void CTestDlg OnExit TODO Add your command handler code here OnCancel void CTestDlg OnCancel TODO Add your message handler code here if MessageBox GetSafeHwnd 退出程序吗 系统提示 MB YESNO MB ICONQUESTION MB DEFBUTTON2 IDYES DeleteObject hBlt CDialog OnCancel void CTestDlg OnAbout TODO Add your command handler code here CAboutDlg dlg dlg DoModal void CTestDlg OnRestart TODO Add your command handler code here InitDemo void CTestDlg SetImage int n Permute n if flag m Static tier ptr SetBitmap HBITMAP m Blt n m Static STNUM 1 SetBitmap HBITMAP m Blt n else m Static STNUM 1 SetBitmap HBITMAP hBlt void CTestDlg OnButton1 TODO Add your control notification handler code here SetImage 0 void CTestDlg OnButton2 TODO Add your control notification handler code here SetImage 1 void CTestDlg OnButton3 TODO Add your control notification handler code here SetImage 2 void CTestDlg OnButton4 TODO Add your control notification handler code here SetImage 3 void CTestDlg OnButton5 TODO Add your control notification handler code here SetImage 4 void CTestDlg OnButton6 TODO Add your control notification handler code here SetImage 5 void CTestDlg OnButton7 TODO Add your control notification handler code here SetImage 6 void CTestDlg OnButton8 TODO Add your control notification handler code here SetImage 7 void CTestDlg OnShowWindow BOOL bShow UINT nStatus CDialog OnShowWindow bShow nStatus TODO Add your message handler code here BOOL CTestDlg Create LPCTSTR lpszClassName LPCTSTR lpszWindowName DWORD dwStyle const RECT void CTestDlg OnTimer UINT nIDEvent TODO Add your message handler code here and or call default CDialog OnTimer nIDEvent testDlg h header file if defined AFX TESTDLG H BC831C21 F558 4681 8EA8 512BDD43AAA8 I NCLUDED define AFX TESTDLG H BC831C21 F558 4681 8EA8 512BDD43AAA8 INCLUD ED if MSC VER 1000 pragma once endif MSC VER 1000 define WIDTH 640 define HEIGHT 480 define BTNUM 8 define STNUM 6 define MAXNUM 5 struct SeqQueue short int page MAXNUM int ptr int front rear CTestDlg dialog class CTestDlg public CDialog Construction public CTestDlg CWnd pParent NULL standard constructor CBitmap bitmap CStatic m Static STNUM CButton m Button BTNUM HBITMAP hBlt CBitmap m Blt BTNUM Dialog Data AFX DATA CTestDlg enum IDD IDD TEST DIALOG CStatic m back AFX DATA ClassWizard generated virtual function overrides AFX VIRTUAL CTestDlg public virtual BOOL Create LPCTSTR lpszClassName LPCTSTR lpszWindowName DWORD dwStyle const RECT protected virtual void DoDataExchange CDataExchange pDX DDX DDV
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 胸腔闭式引流术及护理
- 活性炭酸洗工操作评估模拟考核试卷含答案
- 木竹藤材干燥工安全演练知识考核试卷含答案
- 印泥制作工操作规范水平考核试卷含答案
- 露天采矿工岗前班组建设考核试卷含答案
- 保健砭术师创新思维能力考核试卷含答案
- 船艇救生员班组考核水平考核试卷含答案
- 采气工安全行为测试考核试卷含答案
- 剪切工成果转化水平考核试卷含答案
- 索状爆破器材制造工操作技能强化考核试卷含答案
- DB34∕T 4793-2024 涉及人的生物医学研究伦理审查规范
- 九安物联 测试题及答案
- 临床护理文献解读
- DB13-T 5188-2020 地下管道非开挖铺设工程水平定向钻施工技术规程
- DB34T 4827-2024低温环保沥青路面技术规程
- 青岛版六年级数学下册《全册》教案【新修订】
- DB4107T 443-2020 潮土冬小麦-夏玉米合理耕层构建技术规程
- Profinet(S523-FANUC)发那科通讯设置
- DL∕T 1342-2014 电气接地工程用材料及连接件
- 2024年辽宁省中考语文试卷(含答案解析)
- 《管理会计实务》课后参考答案 丁增稳王家明
评论
0/150
提交评论