SDK編程中窗口ID,句柄,指針三者相互轉換函數
ID--HANDLE--HWND三者之間的互相轉換
id->句柄-----------hWnd = ::GetDlgItem(hParentWnd,id);
id->指針-----------CWnd::GetDlgItem();
句柄->id-----------id = GetWindowLong(hWnd,GWL_ID);
句柄->指針--------CWnd *pWnd=CWnd::FromHandle(hWnd);
指針->ID----------id = GetWindowLong(pWnd->GetSafeHwnd,GWL_ID);
GetDlgCtrlID();
指針->句柄--------hWnd=cWnd.GetSafeHandle() or mywnd->m_hWnd;