Thanks quiancang, I know how create or clone controls in code.
The need of dinamically creating instances of cores comes in order to make a widget which displays information of all the drives. The fix drives aren't a problem, but removable drives such USB or firewire cannot be predefined. You should create a diskcore for every letter of the the system drives, which is highly inefficient. Right now I can do the trick using WMI queries but CPU activity is a little high, and I would rather use the diskcore, but obviously only if I can create it dinamically.
That's my need, but there are a lot of scenarios in which would be interesting create a core dinamically.
Hi,flibio, creating core in code is not the only way to meet your need
here is a widget by asia which just uses 4 diskcores but could display all your drives
the code you need is between about line 1 and line 200.
it's a old widget and some code is not necessary in current XWidget
its annotation are Chinese , hope that would not trouble you
And , vlad , some code in this widget is the rudiment of shortcutlistcore , hope it will make your work easier
asia disk.rar [472.34 KiB]
Downloaded 350 times