如何将窗口模仿成对话框

snake1234 2008-03-27 01:24:04
准备做一个小应用软件,发现对话框编辑器工具非常丰富,使用起来感觉相当方便。

之前有试过直接创建对话框,但是有一些问题,就是不建立窗口,无法使用窗口的CALLBACK FUNCTION,
虽然对话框有自己的CALLBACK FUNTION,但是感觉总有点怪怪的,好像有些功能也无法使用。

不知道创建的窗口能否也像对话框一样使用这些工具,可以介绍模拟的方法吗?先谢谢了~

...全文
108 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
peterram 2008-10-28
  • 打赏
  • 举报
回复
学习!!
laowang2 2008-03-28
  • 打赏
  • 举报
回复
up
lurel 2008-03-28
  • 打赏
  • 举报
回复
具体可以看一下msdn:CreateDialog
The CreateDialog function uses the CreateWindowEx function to create the dialog box. CreateDialog then sends a WM_INITDIALOG message to the dialog box procedure. The function displays the dialog box if the template specifies the WS_VISIBLE style. Finally, CreateDialog returns the window handle to the dialog box.

After CreateDialog returns, the application displays the dialog box (if it is not already displayed) by using the ShowWindow function. The application destroys the dialog box by using the DestroyWindow function.

Microsoft® Windows® CE does not support all styles in the DLGTEMPLATE structure. This structure is in the template identified by the lpTemplate parameter.
snake1234 2008-03-28
  • 打赏
  • 举报
回复
谢谢楼上的热心帮助,目前我已经做到这一步了,不过我看到有些地方介绍说dialog的callback和窗体的callback有不同,但不知道具体在哪儿,可以帮忙解释下吗?~分我先给一部分
lurel 2008-03-28
  • 打赏
  • 举报
回复
正常使用DialogProc就可以了,不要使用DefWindowProc函数.
LRSULT CALLBACK DiaplogProc(HWND,UINT,WPARAM,LPARAM);
snake1234 2008-03-27
  • 打赏
  • 举报
回复
对话框的CALLBACK是可以用的,但是窗口自身所使用的CALLBACK却不能使用.

我知道对话框的CALLBACK和窗口的CALLBACK是有点不一样的.但是不知道具体在哪儿不一样.

所以我希望是createdialog后,直接调用窗口的callback,而不是使用createdialog自身的.

也就是createdialog(,,,)后2个参数设置成NULL

请问要如何设置,才能够使winproc跑起来呢?~
lurel 2008-03-27
  • 打赏
  • 举报
回复
?对话框的的CALLBACK不能用?我还遇到过这种情况,是不是你的代码有问题?或者理解错误呢?

1,222

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧