Skip to main content
gamedev.net
🔒 Locked

win32

Started by bikola_p 4 replies 600+ views
Original Post
bikola_p
bikola_p
Hey guys, i beentrying to learn win32 API programming latetly, and started experimenting. Now lookin at win32 programming, its as if nothing apart from dialog boxes and windows can be created, it feels like too much code for a useless thing, but yet again, you see stuff like programmed in win32 (dont know what else apart from the API) such as kazaa, and firefox etc. Why is it feel as you can only put things in your window that have been pre-made, and just reused, ie buttons, radio buttons etc, is it even posible to make your own controls.
Gardon
Gardon
... a mehr
Colin Jeanne
Colin Jeanne
It is possible to make your own controls: see this tutorial from Catch-22. Being new to Win32, a custom control might be out of your league for now, however. I encourage you to continue to play around with the standard controls and GDI in order to get a feel for how Win32 works and how you need to manage your Win32 resources before moving onto your own custom controls.

You might also want to try subclassing a control to modify its behavior before trying to create your own.

A description of subclassing
Some sample subclassing code
bikola_p
bikola_p
one thing i cant find, is how to take input from text box.
any examples?, anyone, or tutorials
Kippesoep
Kippesoep
Quote:
Original post by bikola_p
one thing i cant find, is how to take input from text box.
any examples?, anyone, or tutorials


The simplest way to get the "input" is simply to read the current text value from the edit control:
char buffer [1024];GetWindowText (hEdit, buffer, 1024);


of, if it might be of unknown length:
int size = GetWindowTextLength (hEdit) + 1;char *buffer = new char [size];GetWindowText (hEdit, buffer, size);
Kippesoep
bikola_p
bikola_p
cool thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.