Need Help on making Window creating class
Hi,
I am planning to make a class for making Windows gui easily with the help of win api functions. I am doing this for learning purpose.
And i wrote code for my class. This is the pseudo code.
In my class
1. There is a Window creating method which uses CreateWindoweEx function. Name = Window_Create( )
Parameters of that method is :
Window_Title = String
Pointer of WndProc function = Pointer
Width & Height, Position = Integer
WinStyles & WinExStyles = Long
It has following steps.
a. Getting the module handle
b. Declare and fill the WNDCLASS structure.
c. Registering window class with RegisterClassEx function.
d. Calling the so called CreateWindoweEx
e. This method returns the newly created window handle.
2. A Message Pump Sub routene. Name = MessagePump( )
It contains a while loop and GetMessage, TranslateMessage, and DispatchMessage functions.
3. A Sub routene to show the window. Name = ShowForm( )
It contains ;
a. ShowWindow function
b. UpdateWindow function.
c. MessagePump Sub
So in my main file looks like this;
a. Declare a WndProc function.
b. Create the instance of the class and call the Window_Create method.
c. Write the complete WndProc function.
d. Call the ShowForm( ) Sub
With this setup, i can get almost any window Messages but i couldn't handle the second window. Can anybody guide me to make this class able to handle more than one window ? Thanks in advance.
Note - I am making this class in FreeBasic language. But i thought that this is a logic problem rather than a language problem. Correct me if i am wrong.