From all the tutorials I've read, there is a lot to take in, and I was just wondering if you need to memorise all that stuff to make the window appear? Or do you just need to understand what all the functions do?
Thanks
From all the tutorials I've read, there is a lot to take in, and I was just wondering if you need to memorise all that stuff to make the window appear? Or do you just need to understand what all the functions do?
Thanks
The hard part of programming is knowing how to apply what you know. Memorising every last detail of every API call doesn't help you.
But knowing the APIs of the most frequently used stuff, and having a good (and fast) local reference certainly helps to keep things moving along when you're programming.
For example, to get a basic window, I'd just copy/paste some previous code, or maybe have a prepared template or two ready to go.
Several IDEs for example come with preset project templates, so by saying "empty GUI project", you get all the stuff to display a blank window with a few mouse clicks. The hard part is then for you to make it do what you want.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
You should know the steps involved in achieving this. For example, you should know that you must register a class, and then create a window and you need a message callback function, and you need a message loop to make your window work.
It's good to remember the APIs and how to use them, but I don't think you'll be able to remember that. The best idea is to create simplified helper functions or classes to do all the work for you while you easily specify just enough information that you can easily remember (or document the function or class).
So to create a window, and you'd have to do is call function CreateWindow which returns HWND, which also registers the class, create the window according to your preferences, registers its own message callback function and starts a message loop.
Simple and easy. There are lots of APIs that takes these annoying structs of information and you have to set the correct mask to indicate what information you're providing. Believe me when I say you get frustrated because it doesn't work and you have no idea why. So... create helper functions and classes and look at tutorials and code snipets to get your work done.
You dont need to memorize all the functions, just be aware of what is available and keep the help file handy. Other than a few extremely common functions like CreateThread() I dont bother with most of the API.
You should make a basic template application.
I made one for dev, it creates a centered window with a menu, and has a timer drawing to a double buffer, and helper functions for creating child windows.
no programmer on earth can do WinAPI32 applications without a book beside him to look at
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg."-Bjarne Stroustrup
Nearing the end of finishing my 2D card game! I have to work on its 'manifesto' though <_<
If it's a simple program, sure you can. If not, well I'd bookmark MSDN.