[C++]C++学习笔记

C++学习笔记

include “windows.h”

include “resource.h”

int LCY() //LCY代码函数****************************************
{
return 0;
}

INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
BOOL bRet = true;
switch (uMsg)
{
case WM_CLOSE:
{
UINT nRet = MessageBox(hDlg, “确认关闭?”, “提示”, MB_OKCANCEL | MB_ICONERROR);
if (nRet == IDOK)
{
EndDialog(hDlg, 0);
break;
}

    else if (nRet == IDCANCEL)
    {}

}
case WM_COMMAND:
{
    switch (LOWORD(wParam))
    {
        case IDOK :
        UINT nRet = MessageBox(hDlg, "确认提交?", "提示", MB_OKCANCEL | MB_ICONERROR);
        if (nRet == IDOK)
        {
            MessageBox(hDlg, "正在处理……", "提示",0);
            LCY();  //执行LCY代码**************************************
            MessageBox(hDlg, "上传成功!!!", "成功", 0);

            break;
        }
        else if (nRet == IDCANCEL)
        {}

    }
}
default:
    bRet = FALSE;
}
return bRet;

}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hprevInstance, LPSTR lpCmdLine, int nCmdShow)
{
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, MainDlgProc);
}

你可能感兴趣的:(C/C++基础)