亲们,帮我看一下是怎么回事吧,产生的窗口应该如何关闭呢,我的问题出在了哪?我用的是vc++2010 的win32项目做的。
#include<windows.h>
#include<stdio.h>
#include"resource.h"
LRESULT CALLBACK Winproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lparam
);int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPreInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
MSG msg;
DialogBox(hInstance,MAKEINTRESOURCE(IDD_MAIN),NULL,(DLGPROC)Winproc);
return 0;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
};
return 0;
}
LRESULT CALLBACK Winproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lparam
)
{
switch(uMsg)
{
case IDOK:
EndDialog(hwnd, IDOK);
break;
}
return 0;
}
#include<windows.h>
#include<stdio.h>
#include"resource.h"
LRESULT CALLBACK Winproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lparam
);int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPreInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
MSG msg;
DialogBox(hInstance,MAKEINTRESOURCE(IDD_MAIN),NULL,(DLGPROC)Winproc);
return 0;
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
};
return 0;
}
LRESULT CALLBACK Winproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lparam
)
{
switch(uMsg)
{
case IDOK:
EndDialog(hwnd, IDOK);
break;
}
return 0;
}
解决方案 »
- MFC对话框重绘的问题
- 求救:关于内存泄露
- 小数位后数字带下划线
- 如何对窗口中画的图进行操作?
- 请高手帮忙给个 OpenGL实现水波的算法(涟漪的那种)
- 谁有sip或者h.323文档或者源码,要是好东西出点钱也可以的。
- 在BHO和toolbar中,如何动态卸载自己?
- 请问在vs6 MFC APPWizard(exe)工程中怎样打开 工具箱
- 各位高手、前辈请帮忙!!
- Listctrl的FindItem()可以根据item的状态来查吗,例如,item是select属性!
- 怎么把TXT文件中的字符一行一行读出来
- MFC有关 --AfxGetThreadState()到底实际的意义是什么 MSDN中未列出该函数
#include<windows.h>
#include<stdio.h>
#include"resource.h"
LRESULT CALLBACK Winproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lparam
);int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPreInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
MSG msg;
DialogBox(hInstance,MAKEINTRESOURCE(IDD_MAIN),NULL,(DLGPROC)Winproc);
while(GetMessage(&msg,NULL,0,0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
};
return 0;}LRESULT CALLBACK Winproc(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lparam
)
{
switch(uMsg)
{
case IDOK:
EndDialog(hwnd,IDOK);
break;
default:
return DefWindowProc(hwnd,uMsg,wParam,lparam);
}
return 0;
}