如下:
新建一个dialogbox窗口,不需要那么复杂吧。
看看下面的这个代码即可:
include <windows.h>

#include "resource.h"



LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM) ;




int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{

DialogBox( hInstance, ( LPCTSTR ) IDD_DIALOG1, NULL, ( DLGPROC ) WndProc );



return 0;

}


LRESULT CALLBACK WndProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{


switch(uMsg)
{

case WM_INITDIALOG:


{

}

break;

case WM_COMMAND:


switch(LOWORD( wParam ))
{

case IDOK:


{

EndDialog( hDlg, 0 );

}

break;

};

break;

case WM_CLOSE:

EndDialog( hDlg, 0 );

break;

};

return 0;

}
posted on 2010-02-03 15:48
deercoder 阅读(828)
评论(2) 编辑 收藏 引用