windows考试复习题“填空+简答”

一、填空
1、MFC库中负责应用程序管理的类是CWinApp而负责管理各种窗口的类是CWnd
2、Windows的所谓事件驱动的核心是消息
3、移动鼠标会产生的消息是WM_MOUSEMOVE
4、Windows系统中对各种对象(窗口、文件、资源等)的标识是句柄
5、用VC编写基于窗口的典型应用程序,可以使用的工具库有MFC和API函数库。

二、简答
1、MFC中产生消息映射表结构的宏有哪三个?
2、CWinApp类有什么作用?
3、简述PostMessage和SendMessage两个API函数的主要差别。

三、编程题

//可能用到的函数如下:
//BOOL ShowWindow( HWND hWnd, int nCmdShow);The ShowWindow function sets the specified window's show state.
//hWnd:[in] Handle to the window.
//nCmdShow:[in] Specifies how the window is to be shown.
//BOOL UpdateWindow(HWND hWnd   // handle to window);

//   下面是要完成的函数
//   FUNCTION: InitInstance(HINSTANCE, int)
//
//   PURPOSE: Saves instance handle and creates main window
//
//   COMMENTS:
//
//        In this function, we save the instance handle in a global variable and
//        create and display the main program window.

BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
   HWND hWnd;

   hInst = 1、_hInstance__; // Store instance handle in our global variable

   hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
      CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);

   if (!hWnd)
   {
     2、_ruturn_FALSE_;
   }

  

   3、ShowWindow(hWnd, nCmdShow);
   4、UpdateWindow(hWnd);

   5、return TRUE;
}

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值