WINAPI函数CreateWindowEx - >创建用户系统的风格按钮? [英] winapi CreateWindowEx -> create button with user system styles?

查看:962
本文介绍了WINAPI函数CreateWindowEx - >创建用户系统的风格按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个按钮,看起来就像OK按钮,当你去我的电脑 - >帮助 - >关于Windows。

I want to make a button that looks just like the OK button when you go My Computer -> Help -> About Windows.

我创建一个按钮是这样的:

I am creating a button like this:

hButton = CreateWindowEx(WS_EX_CLIENTEDGE, TEXT("BUTTON"), TEXT("Text"), WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 10, 10, 30, 30, hwnd, (HMENU)IDC_MAIN_BUTTON, GetModuleHandle(NULL), NULL);

但是看起来粗糙平方和不使用的用户选择了窗口样式。我想我应该用某种窗口类的,但我不能确定什么课?

But it looks like a rough square and does not use the windows styles that the user has selected. I guess I should be using some sort of window class but I am unsure what class?

推荐答案

您想要使用的通用控件库的版本6。要做到这一点,你需要应用程序清单添加到您的可执行文件。请参见如何做到这MSDN文章

You want to use version 6 of the common controls library. To do this you need to add an application manifest to your executable. See this MSDN article on how to do that.

这篇关于WINAPI函数CreateWindowEx - >创建用户系统的风格按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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