如何使用Windows API创建列表视图 [英] how to create a listview with Windows API

查看:103
本文介绍了如何使用Windows API创建列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好:
我想使用Windows api创建一个列表视图,我使用CreateWindow并将TEXT("listview")传递给第二个参数.该应用程序可以运行,但我看不到该列表视图,我应该做更多的事情来显示它,还是我的方法不对吗?我真的需要你们的帮助.
::很抱歉,我说我将第二个参数作为TEXT("listview")传递,这是第一个参数:)

hey everyone:
I want use windows api to create a listview,i use CreateWindow and pass TEXT("listview") to the second parameter.The application can run but i can''t see the listview,should i do some more to show it,or is my method wrong?I really need you guys'' help.
::i am sorry that t said i passed the second parameter as TEXT("listview"),it is the first parameterSmile | :)

推荐答案

Howdy,

诱惑是只使用字符串"listview"-好吧,毕竟人们只是简单地使用"button",对吧?这种诱惑将证明是注定的.

commctrl.h有很多定义(除其他事项外),用于在请求特定类的Windows控件时使用的字符串.

每当我使用它们时,我都只使用#defined WC_LISTVIEW.经过仔细检查,您可以看到它被定义为WC_LISTVIEWW,又被定义为"SysListView32".


因此,只需将TEXT("listview")更改为TEXT("SysListView32"),就可以开始摇滚了.
Howdy,

While the temptation is to just use the string "listview" - well, one does simply use "button" after all, right? This temptation will prove ill-fated.

commctrl.h has a whole bunch of defines for (amongst other things) the strings to be used when requesting a windows control of a particular class.

Whenever I use them, I just use the #defined WC_LISTVIEW. Upon closer inspection, one can see that this is defined as WC_LISTVIEWW, which in turn is #defined as "SysListView32".


So, simply change the TEXT("listview") to TEXT("SysListView32") and you should be ready to rock''n''roll.


这篇关于如何使用Windows API创建列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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