Click here to Skip to main content
15,879,474 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
hello,
can anybody tell me how to create a handler for MDIClient control in vc++ win32, i mean a handler like LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) which handles hWnd window Drawing, painting, destroying and etc... here is the code how i create the mdiclient control

code:
C++
HWND ChildWindowCreation(HWND hWnd, HINSTANCE hInst){
	hwndClient = CreateWindow (TEXT ("MDICLIENT"), NULL, WS_CHILD |WS_BORDER|
	             WS_CLIPCHILDREN | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL, 0, 0,  
                     0, 0, hWnd, (HMENU) 1, hInst,
                     (PSTR)&clientcreate) ;

	if(!hwndClient){
		MessageBox(NULL, "Program did not made the stuff ready for you", "Error", MB_OK|MB_ICONERROR);
	}

	return hwndClient;
}


and then i call the function in hWnd(parent window) in WM_create which creates it perfectly. so i wanted to have a handler for it either. can anybody tell me how.

Thanks in advance.
Posted
Comments
Richard MacCutchan 26-Jul-15 3:26am    
You create a message handler the same way you do for any window. There are many tutorials and samples to be found which show how it is done.
Member 11593571 26-Jul-15 10:03am    
sorry could you redirect me to a tutorial where it could show me how its done?
Member 11593571 26-Jul-15 9:58am    
anybody have any idea what to do?

1 solution

 
Share this answer
 
Comments
Member 11593571 26-Jul-15 15:16pm    
those website are really useful, but unfortunately i have to say i didn't found what i wanted, and thanks for you reply
Richard MacCutchan 27-Jul-15 4:01am    
Then I don't think you looked very hard. They all have samples and tutorials that show how to create Windows apps and handle windows messages. I know this because I have worked through most of them myself.
Member 11593571 27-Jul-15 13:39pm    
hey bro there are laterally hundreds of link on each website you give me above so its kind of hard to find it, i mean i had my research there but no luck there, so i would be owner if you give me a specific link to help me with my problem and thanks for your help i appreciate it
Richard MacCutchan 27-Jul-15 14:03pm    
Two mouse clicks took me to http://www.winprog.org/tutorial/window_click.html. Not that difficult.
Member 11593571 28-Jul-15 15:54pm    
the link is for controlling message not for creating handlers for windows controls,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900