码迷,mamicode.com
首页 > 其他好文 > 详细

对话框资源创建窗口

时间:2015-03-15 12:07:38      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:

#include <Windows.h>
#include "resource.h"
INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam,LPARAM lParam)
{
    BOOL bRet = TRUE;

    switch(uMsg)
    {
    case WM_CLOSE:
        EndDialog(hDlg,0);
        break;
    case WM_COMMAND:
        switch(LOWORD(wParam))
        {
        case IDC_BUTTON1:
            MessageBox(hDlg,"Hello Button 1","Demo",MB_OK);
            break;
        case IDC_BUTTON2:
            MessageBox(hDlg,"Hello Button 2","Demo",MB_OK);
            break;
        default:
            bRet = FALSE;
            break;
        }
        break;
    case WM_LBUTTONDOWN:
        MessageBox(hDlg,"Helle窗口!","Demo",MB_OK);
    default:
        bRet = FALSE;
        break;
    }
    return bRet;
}
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
    DialogBox(hInstance, MAKEINTRESOURCE(IDMAIN),NULL, MainDlgProc);
}

 

对话框资源创建窗口

标签:

原文地址:http://www.cnblogs.com/gongyan/p/4338942.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!