通过Win32进行无模式对话框类注册 [英] Modeless Dialog Class Registration Via Win32

查看:112
本文介绍了通过Win32进行无模式对话框类注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

因此,我创建了一个无模式对话框来显示一些定期更新(通过资源脚本)的结果.我知道可以通过FindWindow(#32772","Results")获取对话框的句柄.但是,我想使我的无模式对话框的类名唯一.我尝试将CLASS"MyClassName"添加到我的资源文件中,然后通过填充WNDCLASS结构(具有所需的wc.cbWndExtra = 30)并调用RegisterClass来重新注册该类,然后使用新的类名调用CreateDialog.但是,这总是返回NULL句柄.否则,我可以保留默认的类名称并调用:

hwndDlg =(HWND)CreateDialog(hInst,MAKEINTRESOURCE(IDRESULTS),
hwnd,DlgResultsProc),

可以正常工作(没有CLASS"MyClassName").
有人可以提出使用C语言解决方案吗?

谢谢,

John

Hello all,

so I created a modeless dialog to display some results that update periodically (via resource script). I know that I can get the handle of the dialog by FindWindow("#32772","Results"). But, I want to make the class name to my modeless dialog box unique. I tried adding CLASS "MyClassName" to my resource file and then re-register the class by filling the WNDCLASS structure (with the needed wc.cbWndExtra = 30) and calling RegisterClass and them call CreateDialog with the new class name. However, this always returns the NULL handle. Otherwise, I can keep the default class name and call:

hwndDlg = (HWND)CreateDialog(hInst, MAKEINTRESOURCE(IDRESULTS),
hwnd, DlgResultsProc),

which works fine (absent the CLASS "MyClassName").
Could someone present a solution doing this in C?

Thanks,

John

推荐答案

请参阅此 ^ ]创建自定义对话框.
See this MSDN Documentation[^] on creating custom dialog boxes.


这篇关于通过Win32进行无模式对话框类注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆