home *** CD-ROM | disk | FTP | other *** search
-
-
-
- #ifndef _CDLG_H_
- #define _CDLG_H_
-
-
- //application defined messages sent from Internet
- //callback function to dialog procedure
- #define WM_INTERNETCONNECT (WM_USER + 100)
- #define WM_INTERNETFILEOPENED (WM_USER + 101)
- #define WM_INTERNETFILEFOUND (WM_USER + 102)
- #define WM_INTERNETENUMERATE (WM_USER + 103)
- #define WM_INTERNETENUMCONNECT (WM_USER + 105)
- #define WM_INTERNETOPENFILE (WM_USER + 109)
-
- //request types sent from dialog procedure to Internet
- //callback function via dwContext parameter
- #define REQUEST_NEW_INTERNET_SITE 1000
- #define REQUEST_INTERNET_CONNECT 1001
- #define REQUEST_INTERNET_OPENFILE 1002
- #define REQUEST_INTERNET_ENUM_CONNECT 1003
- #define REQUEST_INTERNET_OPEN_CONNECT 1004
- #define REQUEST_FIRSTFILEFOUND 2000
- #define REQUEST_FILENOTFOUND 2001
- #define REQUEST_FILETRANSFER 2002
- #define REQUEST_INTERNETFILEREAD 2005
- #define REQUEST_INTERNETDELETEFILE 2006
-
-
- //maximum size of status editbox buffer
- #define STRMAX 50000
-
- //maximum size of file to read
- #define STRRDMAX 20000
-
-
-
- class CDlg
- {
- protected:
- HWND m_hWnd;
- HINSTANCE m_hInst;
- DWORD m_dwAccessType; //INTERNET_ACCESS* types
- TCHAR m_szPwd[20]; //password
- TCHAR m_szUser[20]; //username
- TCHAR m_szProxy[20]; //proxy name
- LPTSTR m_pszPwd;
- LPTSTR m_pszUser ;
- LPTSTR m_pszProxy;
- CCommonCtrl *m_pcctrl;
- BOOL m_anonymous; //logon type
- HMENU m_hmnu; //menu handle for right mouse click popup menus
- HINTERNET m_hSession;
- HINTERNET m_hLastHandleCreated;
- TCHAR m_filebuf[STRRDMAX];
- DWORD m_dwBytesRead;
- HANDLE m_hFileDownload;
-
-
- public:
- // Initialization methods
- CDlg(HINSTANCE); // Constructor
- virtual ~CDlg(); // Destructor
- BOOL Init(int);
- BOOL OnGoto(DWORD);
- HWND GetHWND()
- {
- return m_hWnd;
- }
- //user command to connect
- BOOL OnCommand(HWND, WPARAM, LPARAM);
-
- //internet wrapped functions
- BOOL InetDelete(TV_ITEM *);
- void InetEnumerate(LPARAM, HTREEITEM);
- void InetRead(LPARAM);
- void InetConnect(LPTSTR, LPHINTERNET, DWORD);
- void InetOpen();
- BOOL InetEnumNext(LPARAM);
-
- //utility
- BOOL AddItem(LPARAM);
- void ParseServer(LPTSTR, LPTSTR, LPTSTR);
-
- //dialog procedure
- static BOOL CALLBACK DialogProc(HWND, UINT, WPARAM, LPARAM);
- //internet callback function for asynchronous calls
- static VOID CALLBACK InternetCallback (HINTERNET hInternet, DWORD dwContext, DWORD dwInternetStatus, LPVOID lpvStatusInformation, DWORD dwStatusInformationLength);
-
- };
-
- //about box dialog procedure
- BOOL CALLBACK AboutDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);
-
- #endif
-
-