kbhao7788 2017-03-14 03:59 采纳率: 0%
浏览 1310

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条回答 默认 最新

  • shen_wei 2017-03-14 04:17
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制