Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

A comprehensive CE class library to replace ATL and MFC

, 4 Oct 2000 CPOL
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.
kgwince-old.zip
WinCe
BeamEx
app.ico
BeamEx.dsp
BeamEx.dsw
BeamEx.ini
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.ini
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
CeLabel.inl
CeLib.aps
CeLib.dsp
CeLib.dsw
CeLib.old
CeLib.plg
CeLib.vcp
CeMisc.inl
CeProperty.inl
CeTab.inl
CeWnd.inl
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
dbView.ini
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.vcl
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
ftpView.ini
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
kgwince.zip
app.ico
BeamEx.dsp
BeamEx.dsw
BeamEx.ini
BeamEx.plg
BeamEx.vcl
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
BeamEx.ini
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
CeLabel.inl
CeLib.aps
CeLib.dsp
CeLib.dsw
CeLib.plg
CeLib.vcl
CeLib.vcp
CeMisc.inl
CeProperty.inl
CeTab.inl
CeWnd.inl
mssccprj.scc
vssver.scc
WinLib.dsp
WinLib.dsw
bitmap1.bmp
bitmap2.bmp
bmp00001.bmp
db5.bmp
DbView.dsp
dbView.dsw
dbView.plg
DbView.vcl
DbView.vcp
deldb.bp2
deldb5.bmp
delrec.bp2
delrecor.bmp
help16.bmp
help4.bmp
icon1.ico
icon2.ico
dbView.inf
dbView.ini
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.vcl
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
ftpView.ini
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
// DbMainWnd.h
#include "CeLib.h"
#include <shellapi.h>
//extern CeModule theApp;

#define WM_FTPVIEW_CARDNOTIFY	(WM_USER + 200)

///////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////

#define SORTCOL_NAME	1
#define SORTCOL_SIZE	2
#define SORTCOL_TYPE	3
#define SORTCOL_DATE	4
#define SORTCOL_ATTRIB	5

typedef struct tagLISTSORTINFO
{
	tagLISTSORTINFO()
	{
		// Sort the list after adding
		hwndList = NULL;
		nColumnNo = -1;
		nColType = SORTCOL_NAME;
		bAscending = true;
	}

	HWND hwndList;
	int	 nColumnNo;
	int  nColType;
	bool bAscending;

}
LISTSORTINFO;

extern LISTSORTINFO g_sortinfo;

///////////////////////////////////////////////////////////////////////////////
//
///////////////////////////////////////////////////////////////////////////////

typedef struct tagOPTIONS
{
	bool m_bUseSysIcons;
	bool m_bCloseButton;
	bool m_bIconbar;
	bool m_bROM;
	bool m_bHidden;

	bool m_bCol_Type;
	bool m_bCol_Size;
	bool m_bCol_Date;
	bool m_bCol_Attrib;
	
	void SaveToRegistry();
	void RestoreFromRegistry();
}
OPTIONS;

extern OPTIONS g_options;


#if 0
///////////////////////////////////////////////////////////////////////////////
//
// Subclasses list and treeview controls for the sole purpose of trapping the 
// lbuttondown message to detect a tap and hold in version 3.0 and greater 
// windows ce.
//
///////////////////////////////////////////////////////////////////////////////

class CeTapAndHoldWnd: public CeWnd
{
public:
	
	void OnLButtonDown( UINT nFlags, POINT point, bool& bHandled )
	{
		bHandled = true;

		Default();

		SHRGINFO shrg;
		shrg.cbSize = sizeof (SHRGINFO);
		shrg.hwndClient = m_hWnd;
		shrg.ptDown = point;
		shrg.dwFlags = SHRG_LONGDELAY|SHRG_NOTIFYPARENT;

		TRACE( _T("Point: (%d, %d)\n"), point.x, point.y );
	}
};
#endif

///////////////////////////////////////////////////////////////////////////////
// 
// The big kahuna, the vast majority of the functionality is implemented here.
//
///////////////////////////////////////////////////////////////////////////////

class CeMainWnd: public CeSplitFrame
{
private:
	void CreateBars();

	DWORD m_dwFontSize;
	HFONT m_hFont;

	HWND m_hwndList;
	HWND m_hwndTree;

	HWND m_hwndLast;

	// quick hack, should change
	HIMAGELIST m_ilSmall;
	HIMAGELIST m_hImages;
	CeString m_strCurrentDirectory;
	bool m_bCurrentFtp;

	NOTIFYICONDATA m_nid;

private:
	void SetCtrlFont(HFONT hFont);

	void OnRun();
	void OnDelete();
	void OnRename();
	void OnNewFolder();
	void OnNewShortcut();
	void OnEmptyRecycleBin();

	void OnProperties();
	void OnAbout();
	void OnOptions();
	void OnFont();

	void OnNewSite();
	void OnRefresh();

	void RefreshTree();
	void RefreshList();

	CeFtpClient m_ftpConn;
	HTREEITEM m_hConnected;

	void StoreOptions();
	void LoadOptions();
	void AddColumns();

	CeString GetTreePath(HTREEITEM Item, bool& bFtp);
	BOOL PopulateDirectory(HTREEITEM hItem, LPCTSTR szDir, bool bFtp);
	BOOL PopulateFilelist(HTREEITEM hItem, LPCTSTR szDir, bool bFtp);
	BOOL PopulateFtpSites(HTREEITEM hItem);

	void InitTree();
	void InsertFile(LPCTSTR szDir, WIN32_FIND_DATA* pFD, bool bFtp, int iInsertItem = -1);
	BOOL Execute(LPCTSTR lpszDir, LPCTSTR lpszFile);

protected:
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam, bool& bHandled);
	virtual BOOL OnCreate(LPCREATESTRUCT lpCS, bool& bHandled);
	virtual void OnDestroy(bool& bHandled);
	virtual void OnClose(bool& bHandled);
	virtual LRESULT OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
	virtual	void OnSetFocus(HWND hWndOld);

	virtual LRESULT OnNotify(int nCtrlId, LPNMHDR pNMH, bool& bHandled);
		LRESULT OnTreeViewNotify(NMTREEVIEW* pNMTV);
		LRESULT OnListViewNotify(NMLISTVIEW* pNMLV);
		void OnColumnClick(NMLISTVIEW * pLV);

	LRESULT OnBeginDragTree(NMTREEVIEW* pNMTV);
	LRESULT OnBeginDragList(NMLISTVIEW* pNMLV);
	virtual void OnLButtonUp( UINT nFlags, POINT point, bool& bHandled );
	virtual void OnMouseMove( UINT nFlags, POINT point, bool& bHandled );
	virtual void OnSettingChange( WORD wFlag, LPCTSTR pszSection, bool& bHandled );

	HIMAGELIST m_hDragImage;
	bool m_bDragging;
	HWND m_hDropWnd;
	POINT m_ptDropPoint;
	DWORD m_dwDragItem;
	DWORD m_dwDropItem;

//

	void ShowIconBar(bool bShow);
	void OnConnect();
	void OnDisconnect();

public:
	CeMainWnd();
};

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

| Advertise | Privacy | Mobile
Web02 | 2.8.141022.2 | Last Updated 5 Oct 2000
Article Copyright 2000 by Kenny G
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid