解决方案 »
- tree control控件如何添加消息处理函数.
- VC连接数据库(急)
- 错误提示error LNK2001: unresolved external symbol "public: virtual class
- 请教 CArray 的 GetCount() 的返回值
- 如何判断一个程序是在本次开机后第一次运行的?需要MFC或SDK的那些类或函数判断呀?
- 求Char* a,a的长度?
- 大家帮帮我!!!!!!!!!!!!!!!
- 怎样在两个坐标之间绘制一条直线?
- ***小问题,高分数,来者有分,在vc中如何实现多标签的形式?***
- 高手请进,怎样的建立的ActiveX控件才能在IE里能调用?如果能帮我解决问题当场就给分
- 如何跨进程选中sysListView32控件的指定项
- CTabCtrl自绘标签,如何去除凸起的3D效果?
#include"resource.h"
BOOL APIENTRY Hostname_ipDlgPro(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam);
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCMdShow)
{
DialogBox(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),NULL,(DLGPROC)Hostname_ipDlgPro);
}
BOOL APIENTRY Hostname_ipDlgPro(HWND hDlg,UINT message,WPARAM wParam,LPARAM lParam)
{
return DefWindowProc(hDlg, message, wParam, lParam);
}
UINT Msg,
WPARAM wParam,
LPARAM lParam
);
ParametershDlg
[in] Handle to the dialog box.
Msg
[in] Specifies the message.
wParam
[in] Specifies additional message-specific information.
lParam
[in] Specifies additional message-specific information.
Return ValueThe return value specifies the result of the message processing and depends on the message sent.
ResThe DefDlgProc function is the window procedure for the predefined class of dialog box. This procedure provides internal processing for the dialog box by forwarding messages to the dialog box procedure and carrying out default processing for any messages that the dialog box procedure returns as FALSE. Applications that create custom window procedures for their custom dialog boxes often use DefDlgProc instead of the DefWindowProc function to carry out default message processing. Applications create custom dialog box classes by filling a WNDCLASS structure with appropriate information and registering the class with the RegisterClass function. Some applications fill the structure by using the GetClassInfo function, specifying the name of the predefined dialog box. In such cases, the applications modify at least the lpszClassName member before registering. In all cases, the cbWndExtra member of WNDCLASS for a custom dialog box class must be set to at least DLGWINDOWEXTRA.The DefDlgProc function must not be called by a dialog box procedure; doing so results in recursive execution. Windows 95/98/Me: DefDlgProcW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .Function InformationMinimum DLL Version user32.dll
Header Declared in Winuser.h, include Windows.h
Import library User32.lib
Minimum operating systems Windows 95, Windows NT 3.1
Unicode Implemented as Unicode version. See Also
是不是下面这个原因,说是会递归执行---造成无限递归。。
The DefDlgProc function must not be called by a dialog box procedure; doing so results in recursive execution.