Being looking at the WinMain() function examples but can't find where Windows Procedure WndProc() is called... How does WndProc() receives the handle hwnd declared in WinMain()?
Being looking at the WinMain() function examples but can't find where Windows Procedure WndProc() is called... How does WndProc() receives the handle hwnd declared in WinMain()?
Look at the initialization of the WNDCLASS(EX) structure. lpfnWndProc is assigned the address of WndProc. That's how Windows knows about the function.
Windows then calls WndProc whenever it has a message. This can be from many places - in a standard example, there's six API calls that might call WndProc: CreateWindow, ShowWindow, UpdateWindow, TranslateMessage, DispatchMessage and DestroyWindow.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Hey CornedBee thanx... Question, my development tool doesn't recognize the functions you mention. Do you know the header file for these functions and where i can get't?
Oh! was wondering if things do work like that... I mean if a development tool doesn't have a header file by default, can one easily add extra header files and use the functions with ease?
Thanks a lot
They're all in <windows.h>.
You can add libraries, but just adding header files often doesn't work. For example, if you don't have windows.h, you need to install the Microsoft Platform SDK (you can get it at their website).
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
Last question, does SDK install header files in a specific folder where i can copy from. I run a tool called QUEST (Computer Based Training tool) which has it's own includes/header file folder. How will this integrate with MS Platform SDK? Or perhaps my question should be is MS Platform SDK compatible with any development tool which uses C/C++?
You don't copy headers. You reference the folder they're in. And if QUEST doesn't let you do that, chances are it won't take kindly to you using low-level WinAPI functions either.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law