www.pudn.com > emGUI.rar > DefaultWndProc.c, change:2004-10-17,size:831b


/* 
 *  Default Window handler 
 * 
 * 
 *  COPYRIGHT (c) 2001 - 2010. 
 *  emTech System Corporation. 
 * 
 *  The license and distribution terms for this file may be 
 *  found in found in the file LICENSE. 
 */ 
 
/*	Huangf emcore@263.net 
 */ 
#include "emGUI.h" 
 
unsigned32 DefaultWndProc( 
	WndID 		wID, 
	unsigned16 	msg, 
	unsigned16  nParam, 
	unsigned32	lParam 
) 
{ 
	Window *win; 
	 
	if (wID == NULL){ 
		return 0L; 
	} 
	 
	switch (msg){ 
		case WM_DESTROY: 
			/*  Post DESTROY to all subWindow */ 
			win = (Window *)(wID->subWinList.first); 
 
			while (win != (Window *)_Chain_Tail(&wID->subWinList)){ 
				PostMessage( 
					win, 
					WNDDESTROY, 
					0, 
					0L 
				); 
 
				win = (Window *)win->node.next; 
			} 
 
			/*	free window memory */ 
			_DestroyWindow(wID); 
			 
			break; 
	} 
	return 0L; 
}