Originally posted by Silvercord
this should be moved.
I don't know a whole lot of winapi using C just enough to make a program with buttons and text boxes and menus and stuff, but when you do use winapi it's mostly C style coding anyway, the only C++ in straight winapi is setting up the WNDCLASS or WNDCLASSEX instance. C++ winapi is done with the microsoft foundation classes (MFC< you've probagbly heard of it_) and I personally prefer straight winapi using C style coding. as for actually giving the links that you asked for up coming up short
Working with the Win32 API from a C++ perspective doesn't require you to work with the MFC library... you can use other wrapper libraries, or you could create your own (which I admit is quite fun and rewarding)
[pointless example]
Code:
namespace eib
{
class WndClassEx : public WNDCLASS
{
public:
WndClassEx(HINSTANCE instance = GetModuleHandle(NULL)) {
Defaults(instance);
}
WndClassEx(LPCSTR name, WNDPROC callback, HINSTANCE instance = GetModuleHandle(NULL))
{
Defaults(instance);
lpszClassName = name;
lpfnWndProc = callback;
}
~WndClassEx() {};
inline ATOM Register() const { return ::RegisterClass(this); }
inline void Callback(WNDPROC proc) { lpfnWndProc = proc; }
inline void Name(LPCSTR clsname) { lpszClassName = clsname; }
protected:
inline void Defaults(HINSTANCE instance)
{
memset(this, 0, sizeof(*this));
hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
hInstance = instance;
hIcon = LoadIcon(NULL, IDI_APPLICATION);
hCursor = LoadCursor(NULL, IDC_ARROW);
style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
}
};
}
[/pointless example]