Click here to Skip to main content
13,894,445 members
Click here to Skip to main content

Stats

252.9K views
942 downloads
70 bookmarked
Posted 24 Aug 2000
Licenced CPOL

A Comprehensive CE Class Library to Replace ATL and MFC

, 4 Oct 2000
A collection of classes for CE that do not use ATL or MFC, plus an FTP client, database viewer, and sample application that solves beam deflection equations.
WinCe
BeamEx
app.ico
BeamEx.dsp
BeamEx.dsw
BeamEx.plg
bitmap1.bmp
bmp00001.bmp
bmp00002.bmp
calc.bmp
calc16.bmp
circ_cross.ico
cir_cross.ico
cross_4.ico
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico00005.ico
ico00008.ico
ico00009.ico
ico00010.ico
icon1.ico
icon2.ico
icon4.ico
id_downl.bmp
Install
BeamEx.inf
BeamEx.MIPS_PPCBW.CAB
BeamEx.MIPS_PPCColor.CAB
BeamEx.SH3_PPCColor.CAB
Setup.exe
i_cross.ico
l_cross.ico
magenic.ico
mssccprj.scc
obl_corss.ico
obl_cross.ico
options.bmp
options1.bmp
ping16.bmp
rect_cross.ico
scene_5.ico
scene_6.ico
tri_cross.ico
vssver.scc
CeLib
CeLib.aps
CeLib.dsp
CeLib.dsw
CeLib.old
CeLib.plg
CeLib.vcp
mssccprj.scc
vssver.scc
WinLib.dsp
WinLib.dsw
dbView
bitmap1.bmp
bmp00001.bmp
db5.bmp
dbView.aps
DbView.dsp
dbView.dsw
dbView.old
dbView.plg
DbView.vcp
deldb.bp2
deldb5.bmp
delrec.bp2
delrecor.bmp
help16.bmp
help4.bmp
icon1.ico
icon2.ico
Install
dbView.inf
Setup.exe
magenic.bmp
magenic.ico
mssccprj.scc
vssver.scc
ftpView
appicon.ico
bitmap1.bmp
bitmap2.bmp
bitmap3.bmp
bitmap4.bmp
bmp00001.bmp
bmp00002.bmp
db5.bmp
deldb.bp2
delrec.bp2
FtpView.dsp
ftpView.dsw
FtpView.old
ftpView.plg
FtpView.vcp
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico171.ico
ico35.ico
icon1.ico
icon2.ico
imagelis.bmp
IMAGES.bmp
Install
ftpView.inf
Setup.exe
vssver.scc
magenic.bmp
magenic.ico
mssccprj.scc
options.bmp
options1.bmp
seperato.bmp
vssver.scc
Setup
ico101.ico
Setup.aps
Setup.dsp
setup.ico
Setup.plg
WinCe.dsw
WinLib.dsw
app.ico
BeamEx.dsp
BeamEx.dsw
BeamEx.plg
BeamEx.vcp
bitmap1.bmp
bmp00001.bmp
bmp00002.bmp
calc.bmp
calc16.bmp
circ_cross.ico
cir_cross.ico
cross_4.ico
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico00005.ico
ico00008.ico
ico00009.ico
ico00010.ico
icon1.ico
icon2.ico
icon4.ico
id_downl.bmp
BeamEx.inf
Setup.exe
i_cross.ico
l_cross.ico
magenic.ico
mssccprj.scc
obl_corss.ico
obl_cross.ico
options.bmp
options1.bmp
ping16.bmp
rect_cross.ico
scene_5.ico
scene_6.ico
tri_cross.ico
vssver.scc
CeFtp.vcp
CeFtp.vcw
CeLib.aps
CeLib.dsp
CeLib.dsw
CeLib.plg
CeLib.vcp
mssccprj.scc
vssver.scc
WinLib.dsp
WinLib.dsw
bitmap1.bmp
bitmap2.bmp
bmp00001.bmp
db5.bmp
DbView.dsp
dbView.dsw
dbView.plg
DbView.vcp
deldb.bp2
deldb5.bmp
delrec.bp2
delrecor.bmp
help16.bmp
help4.bmp
icon1.ico
icon2.ico
dbView.inf
Setup.exe
magenic.bmp
magenic.ico
menu1_5.bmp
mssccprj.scc
vssver.scc
appicon.ico
bitmap1.bmp
bitmap2.bmp
bitmap3.bmp
bitmap4.bmp
bmp00001.bmp
bmp00002.bmp
db5.bmp
deldb.bp2
delrec.bp2
FtpView.dsp
ftpView.dsw
ftpView.plg
FtpView.vcp
FtpView.vcw
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico171.ico
ico35.ico
icon1.ico
icon2.ico
imagelis.bmp
IMAGES.bmp
ftpView.inf
Setup.exe
vssver.scc
magenic.bmp
magenic.ico
mssccprj.scc
newmenu.bmp
options.bmp
options1.bmp
rcdata1.bin
seperato.bmp
toolbar1.bmp
vssver.scc
WinCe.dsw
WinCe.vcw
// Binding

inline BOOL CeBaseWnd::Attach(HWND hWndNew)
	{ CHW_ASSERT(::IsWindow(hWndNew)); CHW_ASSERT(NULL == m_hWnd); if (! m_hWnd) m_hWnd = hWndNew; else return FALSE; return TRUE; }
inline HWND CeBaseWnd::Detach()
	{ CHW_ASSERT(NULL != m_hWnd); HWND hWnd = m_hWnd; m_hWnd = NULL; return hWnd; }
inline BOOL CeBaseWnd::DestroyWindow()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); if(!::DestroyWindow(m_hWnd)) return FALSE; m_hWnd = NULL; return TRUE; }

// Attributes

inline DWORD CeBaseWnd::GetStyle() const
	{ CHW_ASSERT(::IsWindow(m_hWnd));	return (DWORD)::GetWindowLong(m_hWnd, GWL_STYLE); }
inline DWORD CeBaseWnd::GetExStyle() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return (DWORD)::GetWindowLong(m_hWnd, GWL_EXSTYLE); }
inline LONG CeBaseWnd::GetWindowLong(int nIndex) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowLong(m_hWnd, nIndex); }
inline LONG CeBaseWnd::SetWindowLong(int nIndex, LONG dwNewLong)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowLong(m_hWnd, nIndex, dwNewLong); }
#ifndef _WIN32_WCE
inline WORD CeBaseWnd::GetWindowWord(int nIndex) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowWord(m_hWnd, nIndex); }
inline WORD CeBaseWnd::SetWindowWord(int nIndex, WORD wNewWord)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowWord(m_hWnd, nIndex, wNewWord); }
#endif

// Message Functions

inline LRESULT CeBaseWnd::SendMessage(UINT message, WPARAM wParam, LPARAM lParam)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd,message,wParam,lParam); }
inline BOOL CeBaseWnd::PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::PostMessage(m_hWnd,message,wParam,lParam); }
inline BOOL CeBaseWnd::SendNotifyMessage(UINT message, WPARAM wParam, LPARAM lParam)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SendNotifyMessage(m_hWnd, message, wParam, lParam); }
// support for C style macros 
inline LRESULT CeBaseWnd::SendMessage(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
	{ CHW_ASSERT(::IsWindow(hWnd)); return ::SendMessage(hWnd, message, wParam, lParam); }

// Window Text Functions

inline BOOL CeBaseWnd::SetWindowText(LPCTSTR lpszString)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowText(m_hWnd, lpszString); }
inline int CeBaseWnd::GetWindowText(LPTSTR lpszStringBuf, int nMaxCount) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowText(m_hWnd, lpszStringBuf, nMaxCount); }
inline int CeBaseWnd::GetWindowTextLength() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowTextLength(m_hWnd); }

// Font Functions

inline void CeBaseWnd::SetFont(HFONT hFont, BOOL bRedraw)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(bRedraw, 0)); }
inline HFONT CeBaseWnd::GetFont() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return (HFONT)::SendMessage(m_hWnd, WM_GETFONT, 0, 0); }

// Menu Functions (non-child windows only)

#ifndef _WIN32_WCE
inline HMENU CeBaseWnd::GetMenu() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetMenu(m_hWnd); }
inline BOOL CeBaseWnd::SetMenu(HMENU hMenu)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetMenu(m_hWnd, hMenu); }
inline HMENU CeBaseWnd::GetSystemMenu(BOOL bRevert) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetSystemMenu(m_hWnd, bRevert); }
inline BOOL CeBaseWnd::HiliteMenuItem(HMENU hMenu, UINT uItemHilite, UINT uHilite)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::HiliteMenuItem(m_hWnd, hMenu, uItemHilite, uHilite); }
#endif

inline BOOL CeBaseWnd::DrawMenuBar()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::DrawMenuBar(m_hWnd); }

#ifndef _WIN32_WCE
#endif

// Window Size and Position Functions

#ifndef _WIN32_WCE
inline BOOL CeBaseWnd::IsIconic() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::IsIconic(m_hWnd); }
inline BOOL CeBaseWnd::IsZoomed() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::IsZoomed(m_hWnd); }
#endif

inline BOOL CeBaseWnd::MoveWindow(int x, int y, int nWidth, int nHeight, BOOL bRepaint)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::MoveWindow(m_hWnd, x, y, nWidth, nHeight, bRepaint); }
inline BOOL CeBaseWnd::MoveWindow(LPCRECT lpRect, BOOL bRepaint)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::MoveWindow(m_hWnd, lpRect->left, lpRect->top, lpRect->right - lpRect->left, lpRect->bottom - lpRect->top, bRepaint); }
inline BOOL CeBaseWnd::SetWindowPos(HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowPos(m_hWnd, hWndInsertAfter, x, y, cx, cy, nFlags); }
inline BOOL CeBaseWnd::SetWindowPos(HWND hWndInsertAfter, LPCRECT lpRect, UINT nFlags)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowPos(m_hWnd, hWndInsertAfter, lpRect->left, lpRect->top, lpRect->right - lpRect->left, lpRect->bottom - lpRect->top, nFlags); }

#ifndef _WIN32_WCE
inline UINT CeBaseWnd::ArrangeIconicWindows()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ArrangeIconicWindows(m_hWnd); }
#endif

inline BOOL CeBaseWnd::BringWindowToTop()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::BringWindowToTop(m_hWnd); }
inline BOOL CeBaseWnd::GetWindowRect(LPRECT lpRect) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowRect(m_hWnd, lpRect); }
inline BOOL CeBaseWnd::GetClientRect(LPRECT lpRect) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetClientRect(m_hWnd, lpRect); }

#ifndef _WIN32_WCE
inline BOOL CeBaseWnd::GetWindowPlacement(WINDOWPLACEMENT FAR* lpwndpl) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowPlacement(m_hWnd, lpwndpl); }
inline BOOL CeBaseWnd::SetWindowPlacement(const WINDOWPLACEMENT FAR* lpwndpl)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowPlacement(m_hWnd, lpwndpl); }
#endif

// Coordinate Mapping Functions

inline BOOL CeBaseWnd::ClientToScreen(LPPOINT lpPoint) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ClientToScreen(m_hWnd, lpPoint); }
inline BOOL CeBaseWnd::ClientToScreen(LPRECT lpRect) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); if(!::ClientToScreen(m_hWnd, (LPPOINT)lpRect)) return FALSE; return ::ClientToScreen(m_hWnd, ((LPPOINT)lpRect)+1); }
inline BOOL CeBaseWnd::ScreenToClient(LPPOINT lpPoint) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ScreenToClient(m_hWnd, lpPoint); }
inline BOOL CeBaseWnd::ScreenToClient(LPRECT lpRect) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); if(!::ScreenToClient(m_hWnd, (LPPOINT)lpRect)) return FALSE; return ::ScreenToClient(m_hWnd, ((LPPOINT)lpRect)+1); }
inline int CeBaseWnd::MapWindowPoints(HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::MapWindowPoints(m_hWnd, hWndTo, lpPoint, nCount); }
inline int CeBaseWnd::MapWindowPoints(HWND hWndTo, LPRECT lpRect) const
	{ CHW_ASSERT(::IsWindow(m_hWnd));	return ::MapWindowPoints(m_hWnd, hWndTo, (LPPOINT)lpRect, 2); }

// Update and Painting Functions

inline HDC CeBaseWnd::BeginPaint(LPPAINTSTRUCT lpPaint)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::BeginPaint(m_hWnd, lpPaint); }
inline void CeBaseWnd::EndPaint(LPPAINTSTRUCT lpPaint)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::EndPaint(m_hWnd, lpPaint); }
inline HDC CeBaseWnd::GetDC()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetDC(m_hWnd); }
inline HDC CeBaseWnd::GetWindowDC()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowDC(m_hWnd); }
inline int CeBaseWnd::ReleaseDC(HDC hDC)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ReleaseDC(m_hWnd, hDC); }
inline BOOL CeBaseWnd::UpdateWindow()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::UpdateWindow(m_hWnd); }
inline void CeBaseWnd::SetRedraw(BOOL bRedraw)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_SETREDRAW, (WPARAM)bRedraw, 0); }
inline BOOL CeBaseWnd::GetUpdateRect(LPRECT lpRect, BOOL bErase)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetUpdateRect(m_hWnd, lpRect, bErase); }
inline int CeBaseWnd::GetUpdateRgn(HRGN hRgn, BOOL bErase)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetUpdateRgn(m_hWnd, hRgn, bErase); }
inline BOOL CeBaseWnd::Invalidate(BOOL bErase)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::InvalidateRect(m_hWnd, NULL, bErase); }
inline BOOL CeBaseWnd::InvalidateRect(LPCRECT lpRect, BOOL bErase)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::InvalidateRect(m_hWnd, lpRect, bErase); }
inline BOOL CeBaseWnd::ValidateRect(LPCRECT lpRect)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ValidateRect(m_hWnd, lpRect); }

#ifndef _WIN32_WCE
inline void CeBaseWnd::InvalidateRgn(HRGN hRgn, BOOL bErase)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::InvalidateRgn(m_hWnd, hRgn, bErase); }
inline BOOL CeBaseWnd::ValidateRgn(HRGN hRgn)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ValidateRgn(m_hWnd, hRgn); }
#endif

inline BOOL CeBaseWnd::ShowWindow(int nCmdShow)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ShowWindow(m_hWnd, nCmdShow); }
inline BOOL CeBaseWnd::IsWindowVisible() const
	{ return ::IsWindowVisible(m_hWnd); }

#ifndef _WIN32_WCE
inline BOOL CeBaseWnd::ShowOwnedPopups(BOOL bShow)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ShowOwnedPopups(m_hWnd, bShow); }
inline BOOL CeBaseWnd::LockWindowUpdate(BOOL bLock)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::LockWindowUpdate(bLock ? m_hWnd : NULL); }
inline BOOL CeBaseWnd::RedrawWindow(LPCRECT lpRectUpdate, HRGN hRgnUpdate, UINT flags)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::RedrawWindow(m_hWnd, lpRectUpdate, hRgnUpdate, flags); }
#endif

// Timer Functions

inline UINT CeBaseWnd::SetTimer(UINT nIDEvent, UINT nElapse)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetTimer(m_hWnd, nIDEvent, nElapse, NULL); }
inline BOOL CeBaseWnd::KillTimer(UINT nIDEvent)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::KillTimer(m_hWnd, nIDEvent); }

// Window State Functions

inline BOOL CeBaseWnd::IsWindowEnabled() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::IsWindowEnabled(m_hWnd); }
inline BOOL CeBaseWnd::EnableWindow(BOOL bEnable)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::EnableWindow(m_hWnd, bEnable); }
inline HWND CeBaseWnd::SetActiveWindow()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetActiveWindow(m_hWnd); }
inline HWND CeBaseWnd::SetCapture()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetCapture(m_hWnd); }
inline HWND CeBaseWnd::SetFocus()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetFocus(m_hWnd); }

// Dialog-Box Item Functions

inline BOOL CeBaseWnd::CheckDlgButton(int nIDButton, UINT nCheck)
#ifndef _WIN32_WCE
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::CheckDlgButton(m_hWnd, nIDButton, nCheck); }
#else
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return (BOOL) ::SendMessage(GetDlgItem(nIDButton), BM_SETCHECK, nCheck, 0); }
#endif

inline UINT CeBaseWnd::IsDlgButtonChecked(int nIDButton) const
	{ CHW_ASSERT(::IsWindow(m_hWnd));
	  HWND hwndCtl = ::GetDlgItem( m_hWnd, nIDButton );
	  return (UINT) Button_GetCheck( hwndCtl );
	}

inline BOOL CeBaseWnd::CheckRadioButton(int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::CheckRadioButton(m_hWnd, nIDFirstButton, nIDLastButton, nIDCheckButton); }
inline UINT CeBaseWnd::GetDlgItemInt(int nID, BOOL* lpTrans, BOOL bSigned) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetDlgItemInt(m_hWnd, nID, lpTrans, bSigned); }
inline UINT CeBaseWnd::GetDlgItemText(int nID, LPTSTR lpStr, int nMaxCount) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetDlgItemText(m_hWnd, nID, lpStr, nMaxCount); }
inline HWND CeBaseWnd::GetNextDlgGroupItem(HWND hWndCtl, BOOL bPrevious) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetNextDlgGroupItem(m_hWnd, hWndCtl, bPrevious); }
inline HWND CeBaseWnd::GetNextDlgTabItem(HWND hWndCtl, BOOL bPrevious) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetNextDlgTabItem(m_hWnd, hWndCtl, bPrevious); }
inline LRESULT CeBaseWnd::SendDlgItemMessage(int nID, UINT message, WPARAM wParam, LPARAM lParam)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SendDlgItemMessage(m_hWnd, nID, message, wParam, lParam); }
inline BOOL CeBaseWnd::SetDlgItemInt(int nID, UINT nValue, BOOL bSigned)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetDlgItemInt(m_hWnd, nID, nValue, bSigned); }
inline BOOL CeBaseWnd::SetDlgItemText(int nID, LPCTSTR lpszString)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetDlgItemText(m_hWnd, nID, lpszString); }

// Scrolling Functions

#ifndef _WIN32_WCE
inline int CeBaseWnd::GetScrollPos(int nBar) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetScrollPos(m_hWnd, nBar); }
inline BOOL CeBaseWnd::GetScrollRange(int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetScrollRange(m_hWnd, nBar, lpMinPos, lpMaxPos); }
inline BOOL CeBaseWnd::ScrollWindow(int xAmount, int yAmount, LPCRECT lpRect, LPCRECT lpClipRect)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ScrollWindow(m_hWnd, xAmount, yAmount, lpRect, lpClipRect); }
//inline BOOL CeBaseWnd::ShowScrollBar(UINT nBar, BOOL bShow)
//	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ShowScrollBar(m_hWnd, nBar, bShow); }
inline BOOL CeBaseWnd::EnableScrollBar(UINT uSBFlags, UINT uArrowFlags)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::EnableScrollBar(m_hWnd, uSBFlags, uArrowFlags); }
#endif

inline int CeBaseWnd::ScrollWindowEx(int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT uFlags)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ScrollWindowEx(m_hWnd, dx, dy, lpRectScroll, lpRectClip, hRgnUpdate, lpRectUpdate, uFlags); }
inline int CeBaseWnd::ScrollWindowEx(int dx, int dy, UINT uFlags, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ScrollWindowEx(m_hWnd, dx, dy, lpRectScroll, lpRectClip, hRgnUpdate, lpRectUpdate, uFlags); }
inline int CeBaseWnd::SetScrollPos(int nBar, int nPos, BOOL bRedraw)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetScrollPos(m_hWnd, nBar, nPos, bRedraw); }
inline BOOL CeBaseWnd::SetScrollRange(int nBar, int nMinPos, int nMaxPos, BOOL bRedraw)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetScrollRange(m_hWnd, nBar, nMinPos, nMaxPos, bRedraw); }

// Window Access Functions

inline HWND CeBaseWnd::ChildWindowFromPoint(POINT point) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ChildWindowFromPoint(m_hWnd, point); }

#ifndef _WIN32_WCE
inline HWND CeBaseWnd::ChildWindowFromPointEx(POINT point, UINT uFlags) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ChildWindowFromPointEx(m_hWnd, point, uFlags); }
inline HWND CeBaseWnd::GetTopWindow() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetTopWindow(m_hWnd); }
inline HWND CeBaseWnd::GetLastActivePopup() const
{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetLastActivePopup(m_hWnd); }
#endif

inline HWND CeBaseWnd::GetWindow(UINT nCmd) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindow(m_hWnd, nCmd); }
inline BOOL CeBaseWnd::IsChild(HWND hWnd) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::IsChild(m_hWnd, hWnd); }
inline HWND CeBaseWnd::GetParent() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetParent(m_hWnd); }
inline HWND CeBaseWnd::SetParent(HWND hWndNewParent)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetParent(m_hWnd, hWndNewParent); }

inline HWND CeBaseWnd::GetTopLevelWindow() const
	{ return GetTopLevelWindow(m_hWnd); }
inline HWND CeBaseWnd::GetTopLevelWindow(HWND hWnd)
	{ CHW_ASSERT(::IsWindow(hWnd));
		HWND hWndParent;
		HWND hWndTmp = hWnd;
		do {
			hWndParent = hWndTmp;
			hWndTmp = (::GetWindowLong(hWndParent, GWL_STYLE) & WS_CHILD) ? ::GetParent(hWndParent) : ::GetWindow(hWndParent, GW_OWNER);
		} while(hWndTmp != NULL);
		return hWndParent;
	}

// Window Tree Access

inline int CeBaseWnd::GetDlgCtrlID() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetDlgCtrlID(m_hWnd); }
inline int CeBaseWnd::SetDlgCtrlID(int nID)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return (int)::SetWindowLong(m_hWnd, GWL_ID, nID); }
inline HWND CeBaseWnd::GetDlgItem(int nID) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetDlgItem(m_hWnd, nID); }

// Alert Functions

#ifndef _WIN32_WCE
inline BOOL CeBaseWnd::FlashWindow(BOOL bInvert)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::FlashWindow(m_hWnd, bInvert); }
#endif

inline int CeBaseWnd::MessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption, UINT nType)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::MessageBox(m_hWnd, lpszText, lpszCaption, nType); }

// Clipboard Functions

#ifndef _WIN32_WCE
inline BOOL CeBaseWnd::ChangeClipboardChain(HWND hWndNewNext)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ChangeClipboardChain(m_hWnd, hWndNewNext); }
inline HWND CeBaseWnd::SetClipboardViewer()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetClipboardViewer(m_hWnd); }
#endif
inline BOOL CeBaseWnd::OpenClipboard()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::OpenClipboard(m_hWnd); }

// Caret Functions

inline BOOL CeBaseWnd::CreateCaret(HBITMAP hBitmap)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::CreateCaret(m_hWnd, hBitmap, 0, 0); }
inline BOOL CeBaseWnd::CreateSolidCaret(int nWidth, int nHeight)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::CreateCaret(m_hWnd, (HBITMAP)0, nWidth, nHeight); }
inline BOOL CeBaseWnd::CreateGrayCaret(int nWidth, int nHeight)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::CreateCaret(m_hWnd, (HBITMAP)1, nWidth, nHeight); }
inline BOOL CeBaseWnd::HideCaret()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::HideCaret(m_hWnd); }
inline BOOL CeBaseWnd::ShowCaret()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ShowCaret(m_hWnd); }

#if defined(_INC_SHELLAPI) && !defined(_WIN32_WCE)
// Drag-Drop Functions
inline void CeBaseWnd::DragAcceptFiles(BOOL bAccept)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::DragAcceptFiles(m_hWnd, bAccept); }
#endif

// Icon Functions

inline HICON CeBaseWnd::SetIcon(HICON hIcon, BOOL bBigIcon)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, WM_SETICON, bBigIcon, (LPARAM)hIcon); }
inline HICON CeBaseWnd::GetIcon(BOOL bBigIcon) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, WM_GETICON, bBigIcon, 0); }

// Help Functions

#ifndef _WIN32_WCE
inline BOOL CeBaseWnd::WinHelp(LPCTSTR lpszHelp, UINT nCmd, DWORD dwData)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::WinHelp(m_hWnd, lpszHelp, nCmd, dwData); }
inline BOOL CeBaseWnd::SetWindowContextHelpId(DWORD dwContextHelpId)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowContextHelpId(m_hWnd, dwContextHelpId); }
inline DWORD CeBaseWnd::GetWindowContextHelpId() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowContextHelpId(m_hWnd); }
#endif

// Hot Key Functions

#ifndef _WIN32_WCE
inline int CeBaseWnd::SetHotKey(WORD wVirtualKeyCode, WORD wModifiers)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, WM_SETHOTKEY, MAKEWORD(wVirtualKeyCode, wModifiers), 0); }
inline DWORD CeBaseWnd::GetHotKey() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SendMessage(m_hWnd, WM_GETHOTKEY, 0, 0); }
#endif

// Misc. Operations

//N new
inline BOOL CeBaseWnd::GetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetScrollInfo(m_hWnd, nBar, lpScrollInfo); }
inline BOOL CeBaseWnd::SetScrollInfo(int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetScrollInfo(m_hWnd, nBar, lpScrollInfo, bRedraw); }
inline BOOL CeBaseWnd::IsDialogMessage(LPMSG lpMsg)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::IsDialogMessage(m_hWnd, lpMsg); }
inline void CeBaseWnd::NextDlgCtrl() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 0, 0L); }
inline void CeBaseWnd::PrevDlgCtrl() const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, 1, 0L); }
inline void CeBaseWnd::GotoDlgCtrl(HWND hWndCtrl) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, WM_NEXTDLGCTL, (WPARAM)hWndCtrl, 1L); }
#ifndef _WIN32_WCE
inline int CeBaseWnd::GetWindowRgn(HRGN hRgn) const
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowRgn(m_hWnd, hRgn); }
inline int CeBaseWnd::SetWindowRgn(HRGN hRgn, BOOL bRedraw)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::SetWindowRgn(m_hWnd, hRgn, bRedraw); }
inline HDWP CeBaseWnd::DeferWindowPos(HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::DeferWindowPos(hWinPosInfo, m_hWnd, hWndInsertAfter, x, y, cx, cy, uFlags); }
#endif
inline DWORD CeBaseWnd::GetWindowThreadID()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::GetWindowThreadProcessId(m_hWnd, NULL); }
inline DWORD CeBaseWnd::GetWindowProcessID()
	{ CHW_ASSERT(::IsWindow(m_hWnd)); DWORD dwProcessID; ::GetWindowThreadProcessId(m_hWnd, &dwProcessID); return dwProcessID; }
inline BOOL CeBaseWnd::IsWindow() const
	{ return ::IsWindow(m_hWnd); }
inline BOOL CeBaseWnd::IsWindowUnicode() const
#ifndef _WIN32_WCE
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::IsWindowUnicode(m_hWnd); }
#else
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return TRUE; }
#endif
inline BOOL CeBaseWnd::IsParentDialog() const
{
	CHW_ASSERT(::IsWindow(m_hWnd)); TCHAR szBuf[8]; // "#32770" + NUL character
	GetClassName(GetParent(), szBuf, sizeof(szBuf)/sizeof(TCHAR));
	return lstrcmp(szBuf, _T("#32770")) == 0;
}

#ifndef _WIN32_WCE
inline BOOL CeBaseWnd::ShowWindowAsync(int nCmdShow)
	{ CHW_ASSERT(::IsWindow(m_hWnd)); return ::ShowWindowAsync(m_hWnd, nCmdShow); }
#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

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

Share

About the Author

Kenny G
United States United States
No Biography provided

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02 | 2.8.190306.1 | Last Updated 5 Oct 2000
Article Copyright 2000 by Kenny G
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid