![]() |
| | #1 |
| Registered User Join Date: Dec 2008
Posts: 99
| win32 GUI components I am currently learning more in depth on how to create enriched GUI's in C using the win32 API. I am trying to avoid using any resource files, and simply create the GUI dynamically. From what I have seen, in order to add components to the GUI dynamically, I have two options; sending a specific message to the message queue (such as a TB_ADDBUTTONS message) or using the CreateWindow() function and using a predefined control class (such as BUTTON) and setting the HWND parameter to the parents' window. This brings me to these questions, 1. When using CreateWindow(), the win32 API only provides 9 predefined control classes. Does this mean that these 9 components are the only components available to add to your window when programming a GUI by using the win32 API? 2. When using the CreateWindow() alternative, and after setting the HWND parameter to the parents', are the 'x' and 'y' attributes limited to be within the parents' coordinates, or not? If so, what will happen when they are not within the parents' coordinates? Extra: I have searched for a full list of all types of messages that could be sent to the message queue, but have not found it. If someone could find it, please link me to it. Thank you, abraham2119 |
| abraham2119 is offline | |
| | #2 |
| Registered User Join Date: Jun 2008 Location: RING 0
Posts: 468
| No, there are extended styles and controls. Each one of those classes has multiple styles associated with them that you can use. I really don't know for the 2nd question because I've never needed to do it (IE why would youw ant to do this?). Most likely the control will just be undrawable. Keep in mind you are not limited to the control classes that windows defines, you can also use owner drawn controls where you can take control of the draw code explicitly. For the messages your best bet is MSDN (WM_COMMAND etc...), searching online in google for what you want to do, or buy an API bible with all the messages (probably very cheap now). And gl creating "enriched" gui's in C with pure win32 api hehe...won't be easy. |
| valaris is offline | |
| | #3 |
| int x = *((int *) NULL); Join Date: Jul 2003 Location: Banks of the River Styx
Posts: 902
| 1. No. The Win32 acutally provides much more than just 9 classes, see common controls. Look at any Win32 introduction -- when they create their base window, if they make use of WNDCLASSEX, then they're adding to that list. You can create your own controls through the same method used to create windows, basically... 2. Yes. Depends. Most likely is that the window will just get clipped, and won't be visible. The parent window might add scroll bars to allow you to see it though. @valaris: Everything in Windows in some way uses the Win32 API. If you program GUI stuff long enough, you will have to deal with Win32. MFC, C#, etc. will not get you all the way.
__________________ long time; /* know C? */ Unprecedented performance: Nothing ever ran this slow before. Any sufficiently advanced bug is indistinguishable from a feature. Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31. The best way to accelerate an IBM is at 9.8 m/s/s. recursion (re - cur' - zhun) n. 1. (see recursion) |
| Cactus_Hugger is offline | |
| | #4 | |
| train spotter Join Date: Aug 2001 Location: near a computer
Posts: 3,450
| Quote:
Use the right tool for the job.
__________________ "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter." Friedrich Nietzsche "I spent a lot of my money on booze, birds and fast cars......the rest I squandered." George Best "If you are going through hell....keep going." Winston Churchill | |
| novacain is offline | |
| | #5 |
| Registered User Join Date: Dec 2008
Posts: 99
| Thanks for all the answers, but honestly, I knew that I had the ability to create custom control classes. My real question was whether those 9 control classes are the only control classes that the win32 API provides you with. |
| abraham2119 is offline | |
| | #6 |
| I have a hat!? Join Date: Apr 2008
Posts: 178
| Those 9 are the ones provided by User32, they're all you can use unless comctl32 is loaded which then provides you with bucketloads more as well as stylized versions of the original nine (in version 6). This is why in password editboxes you sometimes see circles and sometimes asteriks, it depends on whether the app is using the comctl version of the editbox control or the user32 version. |
| adeyblue is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Win32 API GUI problems | Cha0sBG | Windows Programming | 7 | 06-05-2009 04:35 PM |
| Looking for free win32 gui (resource) editor | umen242 | Windows Programming | 1 | 05-22-2008 03:49 AM |
| Using Win32 Graphical Interface (GUI) | gadu | Windows Programming | 1 | 05-09-2008 10:46 PM |
| How can I pass arguments through a GUI (win32)? | bikr692002 | C++ Programming | 2 | 04-08-2006 05:17 PM |
| Strings in Win32 GUI | maxorator | Windows Programming | 2 | 09-26-2005 06:55 AM |