Windows 创建动态数量的链接
在我的应用程序中,我将有一个链接列表,我希望用户能够单击并将它们带到某个网站。问题是,首先,可能会有很多链接,其次,链接数量是动态的,而且数量会变化。
我想到的一个想法是以某种方式使用 SS_NOTIFY 创建一堆 STATIC 窗口,但我会经常创建和销毁窗口,并且性能是一个问题在这个项目中。跟踪我有多少个窗口以及点击了哪一个窗口并不容易。
所以我正在寻找一种更简单的方法,或者至少是更好的方法来实现这一点。
我还应该注意我正在使用 C 和 Windows API。
In my application i'm going to have a list of links I would like the user to be able to click on and will take them to a certain website. The problem is, first, it's possible there is going to be alot of links, second, there is a dynamic amount of links, and the amount changes.
One idea that came to mind was to somehow create a bunch of STATIC
windows with SS_NOTIFY
, but I would be creating and destroying windows often, and performance is a bit of a concern in this project. And keeping track of how many windows I have, and which one was clicked on wouldn't be easy.
So i'm looking for a easier way, or at least better way, to implement this.
I should also note i'm using C, and the Windows API.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无需担心性能。在过去 10 年的任何机器上,用窗口控件填充屏幕都不会出现性能问题。
至于要使用的控件,我认为 SysLink 听起来是最合适的选择。
如果您正在寻找更简单的方法来管理动态 GUI,那么您可能需要考虑更高级别的框架。用 C 语言对原始 Windows API 进行编程是相当耗费人力的。
You have no need to worry about performance. On any machine from the past 10 years you will have no performance issues with filling a screen with windowed controls.
As for the control to use, I think SysLink sounds like the most appropriate choice.
If you are looking for easier ways to manage dynamic GUIs then you may want to contemplate a higher level framework. Programming the raw Windows API from C is pretty labour intensive.