C++ EndDialog问题怎么解决啊

#include "stdafx.h"
#include

#include"resource.h"
void leftright(HWND hwndDlg)
{
int left = GetDlgItemInt(hwndDlg, IDC_EDIT1, NULL, TRUE);
int right = GetDlgItemInt(hwndDlg, IDC_EDIT2, NULL, TRUE);

SetDlgItemInt(hwndDlg, result, (left + right), TRUE);

}
void reduce(HWND hwndDlg)
{
int left = GetDlgItemInt(hwndDlg, reduce1, NULL, TRUE);
int right = GetDlgItemInt(hwndDlg, reduce2, NULL, TRUE);
SetDlgItemInt(hwndDlg, reduce3, left - right, TRUE);
}
void ride(HWND hwndDlg)
{
int left = GetDlgItemInt(hwndDlg, ride1, NULL, TRUE);
int right = GetDlgItemInt(hwndDlg, ride2, NULL, TRUE);
SetDlgItemInt(hwndDlg, ride3, left * right, TRUE);
}

BOOL comand(HWND hwndDlg, WPARAM wParam)
{

switch (LOWORD(wParam))
{
case PUTIND:
    EndDialog(hwndDlg, 0);
case OK:
    leftright(hwndDlg);
    return TRUE;
case OK2:
    reduce(hwndDlg);
    return TRUE;
case OK3:
    ride(hwndDlg);
    return TRUE;
}
return FALSE;

}
BOOL CALLBACK DialogProc(
HWND hwndDlg,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
switch (uMsg)
{
case WM_COMMAND:
return comand(hwndDlg, wParam);

    return TRUE;
}
return FALSE;

}
int APIENTRY tWinMain(_In HINSTANCE hInstance,
In_opt HINSTANCE hPrevInstance,
In LPTSTR lpCmdLine,
In int nCmdShow)
{
HWND head = FindWindow("CalcFrame", NULL);
if (head)
{
return 0;
}

int p=DialogBox(hInstance, (LPCSTR)BIG, NULL, DialogProc);

return 0;

}

为什么点运行起来图标的最右上角的叉却关闭不掉怎么回事啊

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!