unsafe extern "system" fn WindowProc(hWnd: HWND,uMsg: UINT,wParam: WPARAM,lParam: LPARAM)->LRESULT {
    	let mut_self = &mut *(hWnd as *mut Self);

        let mut lRes: LRESULT = 0;
        let h = mut_self.inner.GetHwnd();


		//CWindowImplBaseT< TBase, TWinTraits >* pThis = (CWindowImplBaseT< TBase, TWinTraits >*)hWnd;
		// set a ptr to this message and save the old value
		//_ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
		//const _ATL_MSG* pOldMsg = pThis->m_pCurrentMsg;
		//pThis->m_pCurrentMsg = &msg;
		// pass to the message map to process
		//LRESULT lRes = 0;
		let bRet = Self::ProcessWindowMessage(mut_self,h , uMsg, wParam, lParam, &mut lRes, 0);
		// restore saved value for the current message
		//ATLASSERT(pThis->m_pCurrentMsg == &msg);

		// do the default processing if message was not handled
		//if(!bRet)
		if bRet == winapi::shared::minwindef::FALSE {
			if uMsg != WM_NCDESTROY {
				lRes = Self::DefWindowProc(mut_self,uMsg, wParam, lParam);
			} else {
				// unsubclass, if needed
				// let pfnWndProc = um::winuser::GetWindowLongPtrW(h, GWLP_WNDPROC);
				// lRes = Self::DefWindowProc(mut_self,uMsg, wParam, lParam);
				// if let Some(p) = mut_self.super_win_proc {
				// 	if p != um::winuser::DefWindowProcW && um::winuser::GetWindowLongPtrW(h, GWLP_WNDPROC) == pfnWndProc {
				// 		um::winuser::SetWindowLongPtrW(h, GWLP_WNDPROC, mut_self.super_win_proc as LONG_PTR);
				// 	}
				// }
				// mark window as destryed
				mut_self.state |= WINSTATE_DESTROYED;
			}
		}

		// if (mut_self.m_dwState & WINSTATE_DESTROYED) && pOldMsg== NULL {
		// 	// clear out window handle
		// 	HWND hWndThis = pThis->m_hWnd;
		// 	pThis->m_hWnd = NULL;
		// 	pThis->m_dwState &= ~WINSTATE_DESTROYED;
		// 	// clean up after window is destroyed
		// 	pThis->m_pCurrentMsg = pOldMsg;
		// 	pThis->OnFinalMessage(hWndThis);
		// }else {
		// 	pThis->m_pCurrentMsg = pOldMsg;
		// }
		return lRes;
    }
// only CMDIFrameWindowImpl in wtl use virtual function GetWindowProc to override this,so skip GetWindowProc first

only CMDIFrameWindowImpl in wtl use virtual function GetWindowProc to override this,so skip GetWindowProc first
only CMDIFrameWindowImpl in wtl use virtual function GetWindowProc to override this so skip GetWindowProc first
unsafe extern "system" fn WindowProc(hWnd: HWND,uMsg: UINT,wParam: WPARAM,lParam: LPARAM)->LRESULT {
    	let mut_self = &mut *(hWnd as *mut Self);
        let mut lRes: LRESULT = 0;
        let h = mut_self.inner.GetHwnd();
		//CWindowImplBaseT< TBase, TWinTraits >* pThis = (CWindowImplBaseT< TBase, TWinTraits >*)hWnd;
		// set a ptr to this message and save the old value
		//_ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
		//const _ATL_MSG* pOldMsg = pThis->m_pCurrentMsg;
		//pThis->m_pCurrentMsg = &msg;
		// pass to the message map to process
		//LRESULT lRes = 0;
		let bRet = Self::ProcessWindowMessage(mut_self,h , uMsg, wParam, lParam, &mut lRes, 0);
		// restore saved value for the current message
		//ATLASSERT(pThis->m_pCurrentMsg == &msg);
		// do the default processing if message was not handled
		//if(!bRet)
		if bRet == winapi::shared::minwindef::FALSE {
			if uMsg != WM_NCDESTROY {
				lRes = Self::DefWindowProc(mut_self,uMsg, wParam, lParam);
			} else {
				// unsubclass, if needed
				// let pfnWndProc = um::winuser::GetWindowLongPtrW(h, GWLP_WNDPROC);
				// lRes = Self::DefWindowProc(mut_self,uMsg, wParam, lParam);
				// if let Some(p) = mut_self.super_win_proc {
				// 	if p != um::winuser::DefWindowProcW && um::winuser::GetWindowLongPtrW(h, GWLP_WNDPROC) == pfnWndProc {
				// 		um::winuser::SetWindowLongPtrW(h, GWLP_WNDPROC, mut_self.super_win_proc as LONG_PTR);
				// 	}
				// }
				// mark window as destryed
				mut_self.state |= WINSTATE_DESTROYED;
			}
		}
		// if (mut_self.m_dwState & WINSTATE_DESTROYED) && pOldMsg== NULL {
		// 	// clear out window handle
		// 	HWND hWndThis = pThis->m_hWnd;
		// 	pThis->m_hWnd = NULL;
		// 	pThis->m_dwState &= ~WINSTATE_DESTROYED;
		// 	// clean up after window is destroyed
		// 	pThis->m_pCurrentMsg = pOldMsg;
		// 	pThis->OnFinalMessage(hWndThis);
		// }else {
		// 	pThis->m_pCurrentMsg = pOldMsg;
		// }
		return lRes;
    }
unsafe extern " " fn WindowProc ( hWnd : HWND , uMsg : UINT , wParam : WPARAM , lParam : LPARAM ) -> LRESULT { let mut_self = & mut * ( hWnd as * mut Self ) ; let mut lRes : LRESULT = 0 ; let h = mut_self . inner . GetHwnd ( ) ; //CWindowImplBaseT< TBase, TWinTraits >* pThis = (CWindowImplBaseT< TBase, TWinTraits >*)hWnd;
 // set a ptr to this message and save the old value
 //_ATL_MSG msg(pThis->m_hWnd, uMsg, wParam, lParam);
 //const _ATL_MSG* pOldMsg = pThis->m_pCurrentMsg;
 //pThis->m_pCurrentMsg = &msg;
 // pass to the message map to process
 //LRESULT lRes = 0;
 let bRet = Self :: ProcessWindowMessage ( mut_self , h , uMsg , wParam , lParam , & mut lRes , 0 ) ; // restore saved value for the current message
 //ATLASSERT(pThis->m_pCurrentMsg == &msg);
 // do the default processing if message was not handled
 //if(!bRet)
 if bRet == winapi :: shared :: minwindef :: FALSE { if uMsg != WM_NCDESTROY { lRes = Self :: DefWindowProc ( mut_self , uMsg , wParam , lParam ) ; } else { // unsubclass, if needed
 // let pfnWndProc = um::winuser::GetWindowLongPtrW(h, GWLP_WNDPROC);
 // lRes = Self::DefWindowProc(mut_self,uMsg, wParam, lParam);
 // if let Some(p) = mut_self.super_win_proc {
 // 	if p != um::winuser::DefWindowProcW && um::winuser::GetWindowLongPtrW(h, GWLP_WNDPROC) == pfnWndProc {
 // 		um::winuser::SetWindowLongPtrW(h, GWLP_WNDPROC, mut_self.super_win_proc as LONG_PTR);
 // 	}
 // }
 // mark window as destryed
 mut_self . state |= WINSTATE_DESTROYED ; } } // if (mut_self.m_dwState & WINSTATE_DESTROYED) && pOldMsg== NULL {
 // 	// clear out window handle
 // 	HWND hWndThis = pThis->m_hWnd;
 // 	pThis->m_hWnd = NULL;
 // 	pThis->m_dwState &= ~WINSTATE_DESTROYED;
 // 	// clean up after window is destroyed
 // 	pThis->m_pCurrentMsg = pOldMsg;
 // 	pThis->OnFinalMessage(hWndThis);
 // }else {
 // 	pThis->m_pCurrentMsg = pOldMsg;
 // }
 return lRes ; }
only CMDIFrameWindowImpl in wtl use virtual function GetWindowProc to override this,so skip GetWindowProc first
only CMDIFrameWindowImpl in wtl use virtual function GetWindowProc to override this so skip GetWindowProc first
hWnd
HWND
uMsg
UINT
wParam
WPARAM
lParam
LPARAM
hWnd
HWND
uMsg
UINT
wParam
WPARAM
lParam
LPARAM