编译运行通过了,大家看还有什么问题吗?
#include <windows.h>
#include "resource.h"
BOOL CALLBACK DialogProc(HWND,UINT,WPARAM,LPARAM);
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
DialogBox(NULL,MAKEINTRESOURCE(IDD_DIALOG1), NULL, (DLGPROC) DialogProc);
return 0;
}
BOOL CALLBACK DialogProc(
HWND hwndDlg, // handle to dialog box
UINT uMsg, // message
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
)
{
char buffer1[512],buffer2[512];
switch (uMsg)
{
case WM_COMMAND:
if (LOWORD(wParam) == IDOK)
{
GetDlgItemText(hwndDlg,IDC_EDIT1,buffer1,512);
GetDlgItemText(hwndDlg,IDC_EDIT2,buffer2,512);
if (lstrcmp(buffer1,buffer2)==0)
MessageBoxA(hwndDlg,"Thank you for your purchase!","It's
good",MB_OK);
else
MessageBoxA(hwndDlg,"Please register!","It's wrong",MB_OK);
EndDialog(hwndDlg,0);
}
if (LOWORD(wParam) == IDCANCEL)
EndDialog(hwndDlg,0);
} // End of switch (uMsg)
return 0;
}
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课