• Welcome to Valhalla Legends Archive.
 

Control Development with C++

Started by MyndFyre, January 28, 2004, 09:11 PM

Previous topic - Next topic

MyndFyre

I primarily work with .NET, but I'm trying to develop controls that can be deployed for Windows.  Ultimately, my goal is to be able to create skinnable controls.  I've found that using .NET is extremely buggy for this kind of work, as well as a poor performer; and while I know enough C++ to get by, I'm not particularly well-versed with it.

Now, I've done a lot of reading about the Windows primitives, including buttons and that junk.  My questions are:
* if I want to create skinnable controls with similar functionality, is it necessary to create new primitives, or can I just really amalgamate existing ones?
* if I were to mess with existing ones, would I be better off working with the Windows API or MFC?
* Finally, where can I get information on how to do it?  I've spent quite a while on Google looking for information on skinning, as well as primitive control development.  I'm on a limited budget (specifically, budget <= $0), and I need to be able to do this on my own.  I have found nothing that really helps.

For clarification, I'm not developing the controls with MC++.  My intent is to develop the controls with pure C++, and then either use P/Invoke to call them straight from the DLL (if I go with strict API) or an MC++ wrapper class.

Thanks for the info.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Adron

I think that doing it without MFC or similars would be a good idea. When writing a library, using other libraries if not absolutely necessary just adds a lot of dependencies to distribute with your apps.

You should use the functionality for owner drawn controls. This means that Windows manages the messages, clicks, selection etc, while you handle redrawing.  

Look at "ms-help://ms.vscc/MS.MSDNVS/winui/controls_3mk3.htm" if you have the same version of MSDN that I do. Otherwise search for "owner drawn", and the topic "Custom Controls" should appear rather high.

Basically, you will receive the WM_DRAWITEM message whenever the control needs to change looks. Windows will tell you what to draw - selected button, pressed button, disabled button, normal button etc. Menus, buttons, list boxes etc can all be owner drawn.