PopFax.h
上传用户:looem2003
上传日期:2014-07-20
资源大小:13733k
文件大小:5k
- #pragma once
- // Modify the following defines if you have to target a platform prior to the ones specified below.
- // Refer to MSDN for the latest info on corresponding values for different platforms.
- #ifndef WINVER // Allow use of features specific to Windows XP or later.
- #define WINVER 0x0501 // Change this to the appropriate value to target other versions of Windows.
- #endif
- #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
- #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
- #endif
- #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
- #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
- #endif
- #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
- #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
- #endif
- //#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
- #define _CRT_SECURE_NO_DEPRECATE
- // Windows Header Files:
- #include <windows.h>
- // C RunTime Header Files
- #include <stdlib.h>
- #include <malloc.h>
- #include <memory.h>
- #include <tchar.h>
- #include <wininet.h>
- #include <math.h>
- #include <Commdlg.h>
- #include <commctrl.h>
- #include <atlbase.h>
- #include <msxml.h>
- #include <shellapi.h>
- #include <gdiplus.h>
- #include <commctrl.h>
- #include <string>
- // TODO: reference additional headers your program requires here
- #include "resource.h"
- #include "config.h"
- #include "lang.h"
- #include "convert.h"
- using namespace std;
- #ifdef _UNICODE
- typedef wstring _tstring;
- #else
- typedef string _tstring;
- #endif
- #define FAX_AUTHENTICATION 0
- #define FAX_TRANSFER 1
- #define FAX_STATUS 2
- extern BOOL send_fax( LPADDITIONALCONFIG aac, DWORD sendFlag = FAX_AUTHENTICATION);
- extern const char* TTOA( LPCTSTR tStr );
- extern INT_PTR CALLBACK dlg_main(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_credentials(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_send(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_preview(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_options(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_account_management(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_contact_book(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_add_contact(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_mass_fax(HWND, UINT, WPARAM, LPARAM);
- extern INT_PTR CALLBACK dlg_csv_import(HWND, UINT, WPARAM, LPARAM);
- extern BOOL browse_file( HWND hDlg, LPTSTR fileName, DWORD fnSize, LPCTSTR filter = _T("All files (*.*) *.* "), LPTSTR dir = NULL, DWORD dirSize = 0 );
- extern DWORD WINAPI send_fax_thread( LPVOID param );
- extern DWORD WINAPI send_dlg_thread( LPVOID param );
- extern DWORD parse_xml( LPCTSTR xmlData, CComBSTR varName, LPTSTR retVal, DWORD retSize, DWORD index = 0 );
- extern LPCTSTR get_err_msg( int errId );
- extern void set_foregrouwnd_window( HWND hDlg );
- extern LPCTSTR get_fax_status( LPCTSTR faxStatus );
- extern BOOL insert_str( LPTSTR str, DWORD strSize, LPCTSTR insStr, TCHAR endChar );
- extern HFONT set_control_font( HWND hDlg );
- extern void resize_control_to_text_len( HWND hDlg, LPCTSTR str );
- extern void set_lang_txt( HWND hDlg, LPADDITIONALCONFIG aac, DWORD wnd = 1 );
- extern BOOL set_conv_method( BOOL dither );
- extern void draw_item( LPADDITIONALCONFIG aac, LPDRAWITEMSTRUCT lpDrawItem );
- extern void preview( HWND hDlg, LPCTSTR sendFile );
- extern BOOL send_packet( LPADDITIONALCONFIG aac, LPCTSTR sendStr );
- extern BOOL add_multipart_data( LPTSTR str, size_t strSize, LPCTSTR name, LPCTSTR data );
- extern void add_items_mass_list_from_buffer( HWND hDlg, HWND hList, LPADDITIONALCONFIG aac, LPCTSTR csvBuff, DWORD csvNum = 0, TCHAR delim = 0);
- extern void convert_image( LPAPPCONFIG ac );
- class CURLEncode
- {
- private:
- static char csUnsafeString[];
- const char* decToHex(char num, int radix);
- bool isUnsafe(char compareChar);
- const char* convert(char val);
- public:
- CURLEncode() { };
- virtual ~CURLEncode() { };
- const char* URLEncode(const char* vData);
- };
- class CURLDecoder
- {
- public:
- static const char* decode(const char* str);
- private:
- static int convertToDec(const char* hex);
- static void getAsDec(char* hex);
- };
- using namespace Gdiplus;
- /*_____________________________________________________________________________________________________
- CGdiPlusInit declaration
- _______________________________________________________________________________________________________
- */
- class CGdiPlusInit
- {
- public:
- CGdiPlusInit();
- virtual ~CGdiPlusInit();
- BOOL Good(){ return present; }
- BOOL gdi_start();
- void gdi_stop();
- private:
- BOOL present;
- ULONG_PTR token;
- };
- extern CGdiPlusInit gdiplusInit;