DialogBox Function
发送反馈

DialogBox 宏从体格对话框模板资源创建一个模态对话框,DialogBox 不返回控制直到指定的回调函数调用 EndDialog 函数终止了模态对话框,DialogBox 宏使用 DialogBoxParam 函数。

Syntax

以带有颜色区分的格式查看复制到剪贴板打印
INT_PTR DialogBox(
__in  HINSTANCE hInstance,
__in  LPCTSTR lpTemplate,
__in  HWND hWndParent,
__in  DLGPROC lpDialogFunc
);

INT_PTR DialogBox(
__in  HINSTANCE hInstance,
__in  LPCTSTR lpTemplate,
__in  HWND hWndParent,
__in  DLGPROC lpDialogFunc
);

Parameters

hInstance [in]
HINSTANCE

Handle to the module whose executable file contains the dialog box template.

lpTemplate [in]
LPCTSTR

Specifies the dialog box template. This parameter is either the pointer to a null-terminated character string that specifies the name of the dialog box template or an integer value that specifies the resource identifier of the dialog box template. If the parameter specifies a resource identifier, its high-order word must be zero and its low-order word must contain the identifier. You can use the MAKEINTRESOURCE macro to create this value.

hWndParent [in]
HWND

Handle to the window that owns the dialog box.

lpDialogFunc [in]
DLGPROC

Pointer to the dialog box procedure. For more information about the dialog box procedure, see DialogProc.

Return Value

INT_PTR

If the function succeeds, the return value is the nResult parameter in the call to the EndDialog function used to terminate the dialog box.

If the function fails because the hWndParent parameter is invalid, the return value is zero. The function returns zero in this case for compatibility with previous versions of Windows. If the function fails for any other reason, the return value is –1. To get extended error information, call GetLastError.

This function typically fails for one of the following reasons:

  • an invalid parameter value
  • the system class was registered by a different module
  • The WH_CBT hook is installed and returns a failure code
  • if one of the controls in the dialog template is not registered, or its window window procedure fails WM_CREATE or WM_NCCREATE

Remarks

The DialogBox macro uses the CreateWindowEx function to create the dialog box. DialogBox then sends a WM_INITDIALOG message (and a WM_SETFONT message if the template specifies the DS_SETFONT or DS_SHELLFONT style) to the dialog box procedure. The function displays the dialog box (regardless of whether the template specifies the WS_VISIBLE style), disables the owner window, and starts its own message loop to retrieve and dispatch messages for the dialog box.

When the dialog box procedure calls the EndDialog function, DialogBox destroys the dialog box, ends the message loop, enables the owner window (if previously enabled), and returns the nResult parameter specified by the dialog box procedure when it called EndDialog.

Examples

For an example, see Creating a Modal Dialog Box.

DialogBox Function相关推荐

  1. 关于Win32 DialogBox的一些收获

    最近项目组让新来的小MM开发一个PC端的串口模拟器,我正好也一起学习一下win32编程. 懒得用CreateWindow建立窗口,所以就用VC自带的资源编辑器画Dialog了. 话说这个Dialog和 ...

  2. messagrbox自定义按钮c语言,基于dialogbox修改可自定义按钮及事件的弹出框插件

    插件描述:基于dialogbox1.0修改可自定义按钮及事件的弹出框插件,每个按钮可绑定单独的触发事件,并且能支持将弹出框作为一个表单来填入数据并获取 $('body').dialogbox({ ty ...

  3. 创建一个Scalar-valued Function函数来实现LastIndexOf

    昨天有帮助网友解决的个字符串截取的问题,<截取字符串中最后一个中文词语(MS SQL)>http://www.cnblogs.com/insus/p/7883606.html 虽然实现了, ...

  4. php function集合

    /*更新商品的某个字段*/ function update_goods($goods_id, $field, $value) {if ($goods_id){/* 清除缓存 */clear_cache ...

  5. 函数指针amp;绑定: boost::functoin/std::function/bind

    see link: https://isocpp.org/wiki/faq/pointers-to-members function vs template: http://stackoverflow ...

  6. class function或class procedure是什么意思

    类函数\类过程.   它们是直接操作在类上面(没有实例化的对象) 下面是Delphi    Help    的描述            A class method is a method (oth ...

  7. Cost Function

    首先本人一直有一个疑问缠绕了我很久,就是吴恩达老师所讲的机器学习课程里边的逻辑回归这点,使用的是交叉熵损失函数,但是在进行求导推导时,google了很多的课件以及教程都是直接使用的,这个问题困扰了很久 ...

  8. error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. 的解决方法

    vs2013编译出错信息:错误    1    error C4996: 'fopen': This function or variable may be unsafe. Consider usin ...

  9. c++11 function

    是代指返回值为void型的函数指针. function 最大的功能是表达匿名函数,特别是 [] 里面捕捉了当前上下文变量的匿名函数 类模版 std::function是一种通用.多态的函数封装.std ...

最新文章

  1. 为了追求更快,CPU、内存、I/O都做了哪些努力?
  2. 50条大牛C++编程开发学习建议
  3. 性能测试之JMeter配置元件【计数器】
  4. 移动电话之父第一个电话打给对手,起底现代移动通信崛起之路!
  5. 分布式系统负载均衡策略分析与研究
  6. MEGA视频目标检测
  7. mac安装chromedriver谷歌浏览器驱动
  8. java 判断对象的属性是否为空,如何判断一个对象里的属性是否都为空的
  9. PostgreSQL-Docker创建PostgreSQL数据库并导入矢量数据
  10. Java数值型表现形式
  11. Vibosoft ePub Converter(ePub转换器)v2.1.24官方版
  12. 《Genesis-3D开源游戏引擎--横版格斗游戏制作教程03:碰撞检测》
  13. vero visi 2021中文版
  14. 迷你无人机 FPV WIFI CAMERA图传破解,mini drone WIFI camera
  15. 绝地求生无盘服务器,无盘网吧里绝地求生进不去?他们是这么解决的
  16. OVS使用GRE隧道连接VMs
  17. 华科网安学院和计算机学院,武大华科顶尖网络高手聚集到一起,国家网安学院迎来首批学子入学...
  18. win10 docker 数据可以不放在C盘吗_深度技术 WIN10 极速纯净版(64位)ISO镜像
  19. unity 光照烘焙效果很虚的问题
  20. cf服务器不显示名字,cf服务器冠名之战介绍_cf怎么给服务器取名字_游戏堡

热门文章

  1. UMLChina建模竞赛第3赛季第6轮:随身老印医
  2. 开源软件和开源社区的反思
  3. fastreport 上一行_市、县人大常委会领导一行对公司环保工作进行督查
  4. Java实现-数字组合1
  5. linux dd copy all partitions,dd 命令详解
  6. 【网页设计】期末大作业html+css(我的音乐网站)
  7. html 填表模板,WEB前端开发简历自我评价填写样本
  8. 红海or蓝海?数据分析告诉你:在线教育的井喷与未来
  9. 王道数据结构2021年课件PPT分享
  10. 计算机学院开学标语,新学期开学宣传标语大全