|
#include <windows.h>
#include <windowsx.h>
#include <commdlg.h>
#include <ole2.h>
#include <stdio.h>
#include <oleauto.h>
#include <conio.h>
#include <comdef.h>
#include <shlobj.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <tlhelp32.h>
#include <winsvc.h>
#include <commctrl.h>
#include <activeds.h>
#include <atlbase.h>
#include <wininet.h>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <mbstring.h>
#include <string.h>
#include <malloc.h>
#include <stdarg.h>
#ifndef _LIGHTBOX
#define _LIGHTBOX
#define FNAME_MAX32 512
#define M_INIT_FILE_USE 0x00000001L /* レジストリの設定を使用 */
#define M_REGARDLESS_INIT_FILE 0x00000002L /* 〃 を使用しない */
#define M_NO_BACKGROUND_MODE 0x00000004L /* バックグラウンドを禁止 */
#define M_NOT_USE_TIME_STAMP 0x00000008L
#define M_EXTRACT_REPLACE_FILE 0x00000010L
#define M_EXTRACT_NEW_FILE 0x00000020L
#define M_EXTRACT_UPDATE_FILE 0x00000040L
#define M_CHECK_ALL_PATH 0x00000100L /* 厳格なファイル名サーチ */
#define M_CHECK_FILENAME_ONLY 0x00000200L /* 〃を行わない */
#define M_CHECK_DISK_SIZE 0x00000400L
#define M_REGARDLESS_DISK_SIZE 0x00000800L
#define M_USE_DRIVE_LETTER 0x00001000L /* ドライブ名から格納 */
#define M_NOT_USE_DRIVE_LETTER 0x00002000L /* 〃 を格納しない */
#define M_INQUIRE_DIRECTORY 0x00004000L
#define M_NOT_INQUIRE_DIRECTORY 0x00008000L
#define M_INQUIRE_WRITE 0x00010000L
#define M_NOT_INQUIRE_WRITE 0x00020000L
#define M_CHECK_READONLY 0x00040000L
#define M_REGARDLESS_READONLY 0x00080000L
#define M_REGARD_E_COMMAND 0x00100000L
#define M_REGARD_X_COMMAND 0x00200000L
#define M_ERROR_MESSAGE_ON 0x00400000L /* エラーメッセージを表示 */
#define M_ERROR_MESSAGE_OFF 0x00800000L /* 〃を表示しない */
#define M_BAR_WINDOW_ON 0x01000000L
#define M_BAR_WINDOW_OFF 0x02000000L
#define M_CHECK_PATH 0x04000000L
#define M_RECOVERY_ON 0x08000000L /* 破損ヘッダの読み飛ばし */
#define M_MAKE_INDEX_FILE 0x10000000L
#define M_NOT_MAKE_INDEX_FILE 0x20000000L
typedef HGLOBAL HARC;
typedef struct {
DWORD dwOriginalSize; /* ファイルのサイズ */
DWORD dwCompressedSize; /* 圧縮後のサイズ */
DWORD dwCRC; /* 格納ファイルのチェックサム */
UINT uFlag; /* 処理結果 */
/* Status flag */
UINT uOSType; /* 書庫作成に使われた OS */
WORD wRatio; /* 圧縮率 */
WORD wDate; /* 格納ファイルの日付(DOS 形式) */
WORD wTime; /* 格納ファイルの時刻(〃) */
char szFileName[FNAME_MAX32 + 1]; /* 書庫名 */
char dummy1[3];
char szAttribute[8]; /* 格納ファイルの属性(書庫固有) */
char szMode[8]; /* 格納ファイルの格納モード(〃) */
} INDIVIDUALINFO, *LPINDIVIDUALINFO;
typedef HARC (WINAPI *LPFUNC_OPEN_ARC)
(const HWND _hwnd, LPCSTR _szFileName,const DWORD _dwMode);
typedef int (WINAPI *LPFUNC_CLOSE_ARC)
(HARC _harc);
typedef int (WINAPI *LPFUNC_FIND_FIRST)
(HARC _harc, LPCSTR _szWildName,INDIVIDUALINFO FAR *lpSubInfo);
typedef int (WINAPI *LPFUNC_FIND_NEXT)
(HARC _harc,INDIVIDUALINFO FAR *_lpSubInfo);
typedef int (WINAPI *LPFUNC_UNLHA)
(const HWND _hwnd,LPCSTR _szCmdLine,LPSTR _szOutput,const DWORD _dwSize);
int LboxListCount( HWND hWnd );
void LboxListReset( HWND hWnd );
void LboxListSelect( HWND hWnd, int nIndex );
int LboxListAdd( HWND hWnd, LPCTSTR pszBuffer );
int LboxListInsert( HWND hWnd, int nIndex, LPCTSTR pszBuffer );
int LboxListDelete( HWND hWnd, int nIndex );
int LboxListGetText( HWND hWnd, int nIndex, LPCTSTR pszBuffer, int nSize );
int LboxListSetText( HWND hWnd, int nIndex, LPCTSTR pszBuffer );
int LboxListSelectedRow( HWND hWnd );
int LboxListSelectedGetText( HWND hWnd, LPCTSTR pszBuffer, int nSize );
int LboxListSelectedSetText( HWND hWnd, LPCTSTR pszBuffer );
int LboxListSelectedDelete( HWND hWnd );
void LboxListDump( HWND hWnd, LPCTSTR pszBuffer, int nSize );
void LboxListPrintf( HWND hWnd, LPSTR FormatString, ... );
int LboxListToken( HWND hWnd, LPTSTR pszBuffer, LPTSTR pszDelimiter );
BOOL LboxListCopyClipboard( HWND hWnd, BOOL bSelect );
int LboxListTextSize( HWND hWnd );
void LboxEditLimitText( HWND hWnd, int nSize );
void LboxEditSelect( HWND hWnd );
HWND LboxEditFocus( HWND hWnd );
int LboxEditReadonly( HWND hWnd, BOOL bFlg );
int LboxMsgBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType );
void LboxMsgOk( HWND hWnd, LPCTSTR lpText );
BOOL LboxMsgOkCancel( HWND hWnd, LPCTSTR lpText );
BOOL LboxMsgYesNo( HWND hWnd, LPCTSTR lpText );
BOOL LboxOpenFileName(
HWND hwndOwner,
LPCTSTR lpstrTitle,
LPCTSTR lpstrFilter,
DWORD nFilterIndex,
LPTSTR lpstrFile,
DWORD Flags
);
BOOL LboxSaveFileName(
HWND hwndOwner,
LPCTSTR lpstrTitle,
LPCTSTR lpstrFilter,
DWORD nFilterIndex,
LPTSTR lpstrFile,
DWORD Flags
);
HINSTANCE LboxGetInstance( HWND hWnd );
DWORD LboxGetWindowStyle( HWND hWnd );
HWND LboxCreateWorkbox( HWND hWnd );
HWND LboxCreateEdit( HWND hWnd, DWORD id );
HKEY LboxRegOpen( HKEY hRoot, LPCTSTR lpSubKey );
void LboxRegClose( HKEY hKey );
BOOL LboxEnumDrive( HWND hList, int nIndex );
void LboxEnumEnvironment( HWND hList, int nIndex );
void LboxEnumRegKey( HWND hList, int nIndex, HKEY hKey, DWORD nOption );
void LboxEnumReg( HWND hList, int nIndex, HKEY hKey );
void LboxEnumWindowInfo( HWND hList, int nIndex, DWORD nOption );
BOOL LboxEnumExcelSheet( HWND hList, int nIndex, LPCTSTR szFile );
BOOL LboxEnumExcelSheetAdo( HWND hList, int nIndex, LPCTSTR szFile );
BOOL LboxEnumAccessTable( HWND hList, int nIndex, LPCTSTR szFile );
void LboxEnumProcess( HWND hList, int nIndex );
void LboxEnumService( HWND hList, int nIndex, LPCTSTR szMachine );
void LboxEnumDesktop( HWND hList, int nIndex );
void LboxEnumShellFolder( HWND hList, int nIndex, LPCTSTR szTarget );
void LboxEnumControlPanel( HWND hList, int nIndex );
void LboxEnumPrinter( HWND hList, int nIndex );
void LboxEnumFile( HWND hList, int nIndex );
void LboxEnumFile( HWND hList, LPTSTR lpOption, int nIndex );
BOOL LboxMoveWindow( HWND hWnd, int x, int y );
BOOL LboxMoveWindowTop( HWND hWnd );
BOOL LboxChangeWindowSize( HWND hWnd, int w, int h );
BOOL LboxCopyClipboard( LPTSTR szData );
BOOL LboxExecute( LPTSTR szCommand, LPTSTR szCurDirectory );
DWORD LboxExecuteAndWaitInputIdle( LPTSTR szCommand, LPTSTR szCurDirectory );
HWND LboxExecuteAndGetWindowHandle(
LPTSTR szCommand, LPTSTR szClassName, LPTSTR szCurDirectory
);
void LboxGetProgramPath( LPTSTR szPath );
void LboxGetProgramDirectory( LPTSTR szDirectory );
void LboxGetProgramFileName( LPTSTR szFileName );
HFONT LboxCreateFont( int nType, int nSize, BOOL bBold );
void LboxAddWindowStyle( HWND hWnd, DWORD dwStyle );
void LboxRemoveWindowStyle( HWND hWnd, DWORD dwStyle );
LRESULT LboxOnlyDialog( HWND hWnd, LPCTSTR lpTemplate, DLGPROC lpFunc );
void LboxCenterWindow( HWND hWnd );
BOOL LboxStringCase( LPTSTR pszBuffer, LPCTSTR pszList );
BOOL LboxStringCaseX( LPTSTR pszBuffer, LPCTSTR pszList );
void LboxStringEnclose( LPTSTR pszBuffer, int c );
void LboxStringEnclose( LPTSTR pszBuffer, int c1, int c2 );
void LboxStringRemoveEnclose( LPTSTR pszBuffer, int c );
void LboxStringRemoveEnclose( LPTSTR pszBuffer, int c1, int c2 );
LPTSTR LboxReAlloc( LPTSTR *lpTarget, DWORD dwNewSize );
void LboxWintoolChangeStyle( HWND hWnd, DWORD dwOn, DWORD dwOff );
void LboxWintoolChangeExStyle( HWND hWnd, DWORD dwOn, DWORD dwOff );
void LboxEditNumberonly( HWND hWnd, BOOL bFlg );
void LboxEditAlign( HWND hWnd, int nType );
void LboxEditPassword( HWND hWnd, LPTSTR lpPassChar );
void LboxEditCase( HWND hWnd, int nType );
int LboxListFindString( HWND hWnd, LPTSTR lpFind );
HWND LboxWintoolTopWindow( HWND hTarget );
BOOL LboxButtonIsCheck( HWND hWnd );
void LboxButtonCheck( HWND hWnd, BOOL bFlg );
int LboxComboAdd( HWND hWnd, LPCTSTR pszBuffer );
int LboxComboInsert( HWND hWnd, int nIndex, LPCTSTR pszBuffer );
int LboxComboDelete( HWND hWnd, int nIndex );
int LboxComboGetText( HWND hWnd, int nIndex, LPCTSTR pszBuffer, int nSize );
int LboxComboSetText( HWND hWnd, int nIndex, LPCTSTR pszBuffer );
int LboxComboSelectedRow( HWND hWnd );
int LboxComboSelectedGetText( HWND hWnd, LPCTSTR pszBuffer, int nSize );
int LboxComboSelectedSetText( HWND hWnd, LPCTSTR pszBuffer );
int LboxComboSelectedDelete( HWND hWnd );
int LboxComboCount( HWND hWnd );
void LboxComboSelect( HWND hWnd, int nIndex );
void LboxComboReset( HWND hWnd );
HWND LboxCreateDropdownListbox( HWND hWnd, DWORD id );
int LboxComboFindString( HWND hWnd, LPTSTR lpFind );
void LboxComboSetHeight( HWND hWnd, int nHeight );
void LboxComboSetWidth( HWND hWnd, int nWidth );
BOOL LboxCallRundll(
HWND hOwner, LPTSTR lpDll, LPTSTR lpEntryPoint, LPTSTR lpParam );
typedef struct _LBOXLISTVIEWINFO {
int nCurVisibleTopIndex;
int nVisibleCountPerPage;
int nSelectedCount;
COLORREF cBkColor;
COLORREF cTextBkColor;
COLORREF cTextColor;
} LBOXLISTVIEWINFO;
typedef struct _LBOXLISTVIEWSORT {
HWND hWnd;
int nColumn;
int nOrder;
} LBOXLISTVIEWSORT;
// *********************************************************
// 文字列
// *********************************************************
class LboxString
{
public:
BOOL IsNumeric( void );
BOOL IsNotDBCS( void );
BOOL IsDBCS( void );
BOOL IsNum( void );
BOOL IsGroup( LboxString *LGroup );
BOOL IsGroup( LPTSTR lpGroup );
BOOL Dayofweek( void );
int DateDiff( LboxString *LDate );
int DateDiff( LPTSTR lpDate );
BOOL ToSystemTime( LPSYSTEMTIME lpSystemTime );
BOOL ToFileTime( LPFILETIME lpFileTime );
BOOL ToDosDate( LPWORD lpFatDate, LPWORD lpFatTime );
BOOL IsDate( void );
void NumberFormat( LboxString *LString );
void Substr( int nPos, int nLen, LboxString *LString );
void Right( int nLen, LboxString *LString );
void Left( int nLen, LboxString *LString );
void Repeat( LboxString *LString, int nCount );
void Repeat( LPTSTR lpData, int nCount );
void Fzero( LboxString *LString, int nLen );
void Fzero( LPTSTR lpData, int nLen );
void Fzero( int nData, int nLen );
LPTSTR Insert( LPTSTR lpBuffer, int nPos );
int Length( void );
void RemoveLastchar( void );
void RemoveLastchar( LPTSTR pszBuffer );
void RemoveTopchar( void );
void RemoveTopchar( LPTSTR pszBuffer );
LPTSTR Search( LboxString *LString );
LPTSTR SearchX( LboxString *LString );
LPTSTR Insert( LboxString *LString );
LPTSTR ReplaceI( LPTSTR lpTarget, LPTSTR lpReplace );
LPTSTR Replace( LPTSTR lpTarget, LPTSTR lpReplace );
LPTSTR SetChar( DWORD nPos, DWORD nChar );
BOOL operator != ( LboxString *obj );
BOOL operator != ( LPTSTR szBuffer );
void Display( void );
LPTSTR Insert( LPTSTR lpBuffer );
BOOL operator > ( LboxString *obj );
BOOL operator > ( LPTSTR szBuffer );
BOOL operator < ( LboxString *obj );
BOOL operator < ( LPTSTR szBuffer );
int operator == ( LboxString *obj );
int operator == ( LPTSTR szBuffer );
void Enclose( LPTSTR lpStr );
void Printfcat( LPTSTR FormatString, ...);
void Printf( LPTSTR FormatString, ...);
void RemoveEnclose( LPTSTR pszBuffer, int c1, int c2 );
void RemoveEnclose( int c1, int c2 );
void Enclose( int c1, int c2 );
void Enclose( LPTSTR pszBuffer, int c1, int c2 );
LPTSTR FindExtension( void );
LPTSTR FindExtension( LPTSTR pszBuffer );
LPTSTR Resize( DWORD nSize );
void BuildPath( LPTSTR pszBuffer, LPTSTR lpDir, LPTSTR lpFile );
void BuildPath( LPTSTR lpDir, LPTSTR lpFile );
void RemoveExtension( LPTSTR pszBuffer );
void RemoveExtension( void );
void AddBackslash( LPTSTR pszBuffer );
void AddBackslash( void );
void RemoveBackslash( LPTSTR pszBuffer );
void RemoveBackslash( void );
void RemoveFileSpec( void );
void RemoveFileSpec( LPTSTR pszBuffer );
void StripPath( void );
void StripPath( LPTSTR pszBuffer );
void RemoveEnclose( int c );
void RemoveEnclose( LPTSTR pszBuffer, int c );
void Enclose( int c );
void Enclose( LPTSTR pszBuffer, int c );
BOOL CaseX( LPCTSTR pszList );
BOOL CaseX( LPTSTR pszBuffer, LPCTSTR pszList );
BOOL Case( LPCTSTR pszList );
BOOL Case( LPTSTR pszBuffer, LPCTSTR pszList );
LPTSTR SearchX( LPTSTR pszTarget );
LPTSTR SearchX( LPTSTR pszBuffer, LPTSTR pszTarget );
LPTSTR Search( LPTSTR pszTarget );
LPTSTR Search( LPTSTR pszBuffer, LPTSTR pszTarget );
void Trim( LPTSTR pszTrimChars );
void Trim( LPTSTR pszBuffer, LPTSTR pszTrimChars );
int Lower( LPTSTR pszBuffer, int nSize );
int Lower( LPTSTR pszBuffer );
int Lower( int nSize );
int Lower( void );
int Upper( LPTSTR pszBuffer, int nSize );
int Upper( LPTSTR pszBuffer );
int Upper( int nSize );
int Upper( void );
int Ahextoi( LPCTSTR pszBuffer );
int Ahextoi( void );
int Atoi( LPCTSTR pszBuffer );
int Atoi( void );
LPTSTR operator = ( LboxString *obj );
LPTSTR operator = ( LPTSTR szBuffer );
LPTSTR operator += ( LboxString *obj );
LPTSTR operator += ( LPTSTR szBuffer );
DWORD nLboxString;
LPTSTR szLboxString;
LboxString( LPTSTR lpString );
LboxString( DWORD nSize );
LboxString();
virtual ~LboxString();
};
// *********************************************************
// トークン
// *********************************************************
class LboxToken
{
public:
void CreateToken( LboxString *LString, LPCTSTR pszDelim );
void CreateToken( LPCTSTR pszBuffer, LPCTSTR pszDelim );
int nCount;
LPTSTR * Token;
DWORD nMemSize;
LPTSTR pszLboxToken;
LboxToken();
virtual ~LboxToken();
};
void LboxListCreateToken( HWND hWnd, LboxToken *Ltoken );
// *********************************************************
// 初期化ファイル
// *********************************************************
class LboxInifile
{
public:
void WritePrintf(
LPTSTR lpSection, LPTSTR lpEntry, LPSTR FormatString, ... );
void WriteString(
LPTSTR lpSection, LPTSTR lpEntry, LboxString * LString );
BOOL GetString(
LPTSTR lpSection, LPTSTR lpEntry, LboxString *LString );
BOOL GetString(
LPTSTR lpSection, LPTSTR lpEntry, LPTSTR lpValue, DWORD nSize );
void GetEntryNamesX( LPTSTR lpSection, HWND hTarget, int nIndex );
void GetEntryNamesX( LPTSTR lpSection, LboxToken *obj );
void GetEntryNames( LPTSTR lpSection, HWND hTarget, int nIndex );
void GetEntryNames( LPTSTR lpSection, LboxToken *obj );
void GetSectionNames( HWND hTarget, int nIndex );
void GetSectionNames( LboxToken *obj );
void RemoveSection( LPTSTR lpSection );
void RemoveEntry( LPTSTR lpSection, LPTSTR lpEntry );
void GetString(
LPTSTR lpSection,
LPTSTR lpEntry,
LPTSTR lpDefault,LPTSTR lpValue,DWORD nSize);
void WriteString( LPTSTR lpSection, LPTSTR lpEntry, LPTSTR lpValue );
LPTSTR szIniFilePath;
LboxInifile( LPTSTR lpPath, LPTSTR lpName );
LboxInifile( LPTSTR lpName );
LboxInifile();
virtual ~LboxInifile();
};
// *********************************************************
// イメージリスト
// *********************************************************
class LboxImagelist
{
public:
void CreateSystemFile( void );
BOOL bSystem;
void Remove( int i );
void RemoveAll( void );
void Add( HWND hWnd, int nID, int r, int g, int b );
void Create(int cx,int cy);
HIMAGELIST hImgList;
LboxImagelist();
virtual ~LboxImagelist();
};
// *********************************************************
// ウインドウ汎用
// *********************************************************
class LboxWintool
{
public:
LRESULT SendCommand( WORD wID, WORD wNotifyCode, DWORD lParam );
LRESULT SendCommand( WORD wID, WORD wNotifyCode );
LRESULT SendCommand( WORD wID );
LRESULT SendMsg( UINT Msg );
LRESULT SendMsg( UINT Msg, WPARAM wParam );
LRESULT PostMsg( UINT Msg );
LRESULT PostMsg( UINT Msg, WPARAM wParam );
LRESULT PostCommand( WORD wID, WORD wNotifyCode, DWORD lParam );
LRESULT PostCommand( WORD wID, WORD wNotifyCode );
LRESULT PostCommand( WORD wID );
BOOL MsgYesNo( LboxString *LString );
BOOL MsgOkCancel( LboxString *LString );
BOOL IsEnabled( void );
BOOL IsEnabled( HWND hTarget );
void Redraw( void );
void ChangeCursor( LPCTSTR lpCursorName );
BOOL SetFont( int nType, int nSize, BOOL bBold );
void ParentFit( DWORD dwSizeType,int x,int y,int sub_w,int sub_h );
BOOL RestorePositonAndSize( LPTSTR lpSection, LboxInifile *obj );
void SavePositonAndSize( LPTSTR lpSection, LboxInifile *obj );
void ChangeExStyle( HWND hTarget, DWORD dwOn, DWORD dwOff );
void ChangeExStyle( DWORD dwOn, DWORD dwOff );
void ChangeStyle( HWND hTarget, DWORD dwOn, DWORD dwOff );
void ChangeStyle( DWORD dwOn, DWORD dwOff );
int DragQuery( HWND hListDrop, WPARAM wParam );
void DragAccept( BOOL bFlg );
void SetFocus( void );
void SetFocus( HWND hTarget );
BOOL Destroy( void );
BOOL Destroy( HWND hTarget );
void CreateSolidBrush( int red, int green, int blue );
BOOL ClientToScreen( LPPOINT lpPoint );
BOOL IsHandle( HWND hTarget );
LRESULT PostMsg( UINT Msg, WPARAM wParam, LPARAM lParam );
LRESULT SendMsg( UINT Msg, WPARAM wParam, LPARAM lParam );
BOOL IsVisible( void );
BOOL IsVisible( HWND hTarget );
HINSTANCE Instance( void );
HINSTANCE Instance( HWND hTarget );
HWND TopWindow( void );
HWND TopWindow( HWND hTarget );
HWND Parent( void );
HWND Parent( HWND hTarget );
void MsgOk( LboxString *LString );
void MsgOk( LPSTR FormatString, ...);
void MsgOk( LPCTSTR lpText );
void MsgOk( HWND hWnd, LPCTSTR lpText );
BOOL MsgYesNo( LPCTSTR lpText );
BOOL MsgYesNo( HWND hWnd, LPCTSTR lpText );
BOOL MsgOkCancel( LPCTSTR lpText );
BOOL MsgOkCancel( HWND hWnd, LPCTSTR lpText );
int MsgBox( LPCTSTR lpText, LPCTSTR lpCaption, UINT uType );
int MsgBox( HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType );
void Enable( void );
void Enable( HWND hTarget );
void Disable( void );
void Disable( HWND hTarget );
void Show( void );
void Show( HWND hTarget );
void Hide( void );
void Hide( HWND hTarget );
int GetClientWidth( HWND hTarget );
int GetClientHeight( HWND hTarget );
int ClientWidth( );
int ClientHeight( );
int GetWidth( HWND hTarget );
int GetHeight( HWND hTarget );
int Width( );
int Height( );
BOOL MoveWindow( int x, int y );
BOOL MoveWindow( HWND hTarget, int x, int y );
BOOL MoveWindowTop( void );
BOOL MoveWindowTop( HWND hTarget );
BOOL ChangeWindowSize( int w, int h );
BOOL ChangeWindowSize( HWND hTarget, int w, int h );
LboxWintool( HWND hTarget );
LboxWintool();
HBRUSH hSolidBrush;
HFONT hFont;
HWND hWnd;
virtual ~LboxWintool();
};
// *********************************************************
// 情報取得
// *********************************************************
class LboxInfo
{
public:
void Dayofweek( LboxString *LString );
void Dayofweek( LPTSTR lpBuffer );
int DateDiff( SYSTEMTIME *stA, SYSTEMTIME *stB );
BOOL SearchFromPath( LboxString *LFile, LboxString *LString );
BOOL SearchFromPath( LPTSTR lpFile, LboxString *LString );
int DateDiff( SYSTEMTIME *st );
void Weekday( LboxString *LString );
int VolumeName( LPCTSTR lpDrive, LboxString *LString );
int UserName( LboxString *LString );
void Time( LboxString *LString );
int TempPath( LboxString *LString );
BOOL SpecialFolderPath( int nTarget, LboxString *LString );
BOOL Executable( LboxString *LstrTarget, LboxString *LString );
void Date( LboxString *LString );
int SystemDirectory( LboxString *LString );
int WindowsDirectory( LboxString *LString );
int ComputerName( LboxString *LString );
int CurrentDirectory( LboxString *LString );
BOOL SpecialFolderPath( int nTarget, LPTSTR lpBuffer );
int TempPath( LPTSTR lpBuffer, int nSize );
BOOL VolumeName( LPCTSTR lpDrive, LPTSTR lpBuffer, int nSize );
BOOL Executable( LPCTSTR lpTarget, LPTSTR lpBuffer );
void Weekday( LPTSTR lpBuffer );
void Time( LPTSTR lpBuffer );
void Date( LPTSTR lpBuffer );
int CurrentDirectory( LPTSTR lpBuffer, int nSize );
int SystemDirectory( LPTSTR lpBuffer, int nSize );
int WindowsDirectory( LPTSTR lpBuffer, int nSize );
int UserName( LPTSTR lpBuffer, int nSize );
int ComputerName( LPTSTR lpBuffer, int nSize );
LboxInfo();
virtual ~LboxInfo();
};
// *********************************************************
// コモンダイアログ
// *********************************************************
class LboxCommdlg
{
public:
BOOL GetFolderName( LboxString *LString );
BOOL SaveFileName( LboxString *LString );
BOOL OpenFileName( LboxString *LString );
BOOL GetFolderName( LPTSTR lpstrPath );
UINT uFolderFlg;
BOOL SaveFileName( LPTSTR lpstrFile );
BOOL OpenFileName( LPTSTR lpstrFile );
LboxCommdlg( HWND hWnd );
DWORD Flags;
DWORD nFilterIndex;
LPCTSTR lpstrFilter;
LPCTSTR lpstrTitle;
LPTSTR lpstrInitialDir;
LPTSTR lpstrDefExt;
HWND hWndOwner;
LboxCommdlg();
virtual ~LboxCommdlg();
};
// *********************************************************
// レジストリ
// *********************************************************
class LboxReg
{
public:
BOOL GetDwordValue(LPCTSTR lpEntry, DWORD *Value );
BOOL SetDwordValue(LPCTSTR lpEntry, DWORD dwValue );
BOOL GetBinValue(LPCTSTR lpEntry, void *Value, int nSize );
BOOL SetBinValue(LPCTSTR lpEntry, void *Value, int nLen );
BOOL SetStrValue(LPCTSTR lpEntry, LboxString *LString);
BOOL SetStrValue(LPCTSTR lpEntry, LPTSTR lpValue);
BOOL Create( HKEY hRoot, LPCTSTR lpSubKey );
HKEY hKey;
LboxReg( HKEY hRoot, LPCTSTR lpSubKey );
BOOL GetStrValue(LPCTSTR lpEntry, LboxString *LString);
LboxReg();
virtual ~LboxReg();
};
// *********************************************************
// ファイルシステム
// *********************************************************
class LboxFileSystem
{
public:
ULONGLONG RecycleSize( LboxString *LPath );
ULONGLONG RecycleSize( LPTSTR lpPath );
ULONGLONG RecycleItem( LboxString *LPath );
ULONGLONG RecycleItem( LPTSTR lpPath );
BOOL EmptyRecycle( LboxString *LPath );
BOOL EmptyRecycle( LPTSTR lpPath );
BOOL VolumeFreeSpace( LboxString *LPath, ULONGLONG *nSize );
BOOL VolumeFreeSpace( LboxString *LPath, LboxString *LString );
BOOL VolumeFreeSpace( LPTSTR lpPath, ULONGLONG *nSize );
BOOL VolumeFreeSpace( LPTSTR lpPath, LboxString *LString );
BOOL VolumeSpace( LboxString *LPath, ULONGLONG *nSize );
BOOL VolumeSpace( LboxString *LPath, LboxString *LString );
BOOL VolumeSpace( LPTSTR lpPath, ULONGLONG *nSize );
BOOL VolumeSpace( LPTSTR lpPath, LboxString *LString );
BOOL Rename( LboxString *LPath, LboxString *LnewPath );
BOOL Rename( LPTSTR lpPath, LPTSTR lpNewPath );
BOOL CreateDirectory( LboxString *LPath );
BOOL CreateDirectory( LPTSTR lpPath );
BOOL CreateTempFile(
LboxString *LPath, LPTSTR lpPrefix, LboxString *LString
);
BOOL CreateTempFile(
LPTSTR lpCreatePath, LPTSTR lpPrefix, LboxString *LString
);
int SmallIconIndex( LboxString *LString );
int SmallIconIndex( LPCTSTR lpName );
BOOL ShellDelete( HWND hWnd, LboxString *LstrFiles );
BOOL ShellDelete( HWND hWnd, HWND hList );
BOOL ShellDelete( HWND hWnd, LPTSTR lpFiles );
BOOL GetShortPathName(
LboxString *LstrLongPath, LboxString *LstrShortPath );
BOOL GetShortPathName( LPTSTR lpLongPath, LPTSTR lpShortPath, int nSize );
BOOL ChangeDirectory( LboxString *LString );
BOOL ChangeDirectory( LPCTSTR lpPath );
BOOL IsDirectory( LboxString *LString );
BOOL IsDirectory( LPCTSTR lpPath );
BOOL Exist( LboxString *LString );
BOOL Exist( LPCTSTR lpFile );
BOOL ShellCopy( HWND hWnd, HWND hList, LboxString *LstrDir );
BOOL ShellCopy(HWND hWnd, LboxString *LstrFiles, LboxString *LstrNew);
BOOL ShellCopy( HWND hWnd, HWND hList, LPTSTR lpDir );
BOOL ShellCopy( HWND hWnd, LPTSTR lpFiles, LPTSTR lpNew );
BOOL Copy( LboxString *LstrFile, LboxString *LstrNewFile );
BOOL Copy( LPCTSTR lpFile, LPCTSTR lpNewFile );
BOOL DateUpdate( LPCTSTR lpFileName, LPTSTR lpDateTime );
BOOL DateUpdate( LboxString *LstrFileName, LboxString *LString );
BOOL Size( LboxString *LString, LPDWORD lpSize );
BOOL Size( LPCTSTR FileName, LPDWORD lpSize );
LboxFileSystem();
virtual ~LboxFileSystem();
};
// *********************************************************
// テキストファイル
// *********************************************************
class LboxTextFile
{
public:
LONG RecordCount( LboxString *LFileName, LboxString *LBuffer );
LONG RecordCount( LPTSTR lpFileName, LboxString *LBuffer );
BOOL PutPrintf( LPTSTR FormatString, ...);
void GetAll( LboxString *LString );
void Close( void );
BOOL Put( LboxString *LString );
BOOL Put( LPTSTR lpBuffer );
BOOL WriteOpen( LboxString *LString );
BOOL WriteOpen( LPCTSTR lpFileName );
BOOL Get( LboxString *LString );
BOOL ReadOpen( LboxString *LString );
BOOL Get( LPTSTR lpBuffer, int nSize );
BOOL ReadOpen( LPCTSTR lpFileName );
FILE *fp;
LboxTextFile();
virtual ~LboxTextFile();
};
// *********************************************************
// リストボックス
// *********************************************************
class LboxListbox : public LboxWintool
{
public:
int SetText( int nIndex, LboxString *LString );
int SelectedSetText( LboxString *LString );
int SelectedGetText( LboxString *LString );
int Insert( int nIndex, LboxString *LString );
int GetText( int nIndex, LboxString *LString );
int Add( LboxString *LString );
void EnumSortFile( LPCTSTR lpOption, DWORD dwOption );
int FindString( LPTSTR lpFind );
void EnumFile( LPTSTR lpOption, int nIndex );
void CreateToken( LboxToken *obj );
int TextSize( void );
void Printf( LPSTR FormatString, ...);
int Token( LPTSTR pszBuffer, LPTSTR pszDelimiter );
void Dump( LPCTSTR pszBuffer, int nSize );
void Reset( void );
void Select( int nIndex );
int SelectedDelete( void );
int SelectedSetText( LPCTSTR pszBuffer );
int SelectedGetText( LPCTSTR pszBuffer, int nSize );
int SelectedRow( void );
int Count( void );
int SetText( int nIndex, LPCTSTR pszBuffer);
int GetText( int nIndex, LPCTSTR pszBuffer, int nSize );
int Delete( int nIndex );
int Insert( int nIndex, LPCTSTR pszBuffer );
int Add( LPCTSTR pszBuffer );
BOOL CopyClipboard( BOOL bSelect );
LboxListbox( HWND hOwner, int nID );
LboxListbox( HWND hList );
LboxListbox();
BOOL bCreate;
virtual ~LboxListbox();
};
// *********************************************************
// API ツール
// *********************************************************
class LboxTool
{
public:
BOOL GetClipboardText( LboxString *LString );
void ShutdownAndPoweroff( void );
void Reboot( void );
void Shutdown( void );
void Logoff( void );
BOOL URLDownload( LboxString *LUrl, LboxString *LPath );
BOOL URLDownload( LPTSTR lpUrl, LPTSTR lpPath );
void ShellReboot( void );
HWND ExecuteAndGetWindowHandle(
LPTSTR szCommand, LPTSTR szClassName, LPTSTR szCurDirectory
);
void Sleep( DWORD dwMilliseconds );
void PrintScreenKey( BOOL bActive );
void TabKey( void );
void WaitCursor( BOOL bFlg );
BOOL Execute( LboxString *LstrCommand, LboxString *LstrCurDir );
void ProgramFileName( LboxString *LString );
void ProgramPath( LboxString *LString );
void ProgramDirectory( LboxString *LString );
DWORD ExecuteAndWaitInputIdle(
LboxString *LstrCommand, LboxString *LstrCurDir
);
DWORD ExecuteAndWaitInputIdle(
LPTSTR szCommand, LPTSTR szCurDirectory
);
BOOL CopyClipboard( LboxString *LString );
BOOL IsAlt( void );
BOOL IsCtrl( void );
BOOL IsShift( void );
BOOL CopyClipboard( LPTSTR szData );
int DesktopHeight( void );
int DesktopWidth( void );
HWND Desktop( void );
LRESULT OnlyDialog( HWND hWnd, LPCTSTR lpTemplate, DLGPROC lpFunc );
void ProgramPath( LPTSTR szPath );
void ProgramDirectory( LPTSTR szDirectory );
void ProgramFileName( LPTSTR szFileName );
BOOL Execute( LPTSTR szCommand, LPTSTR szCurDirectory );
LboxTool();
virtual ~LboxTool();
};
// *********************************************************
// メインウインドウ
// *********************************************************
class LboxWin : public LboxWintool,public LboxInfo
{
public:
void SendSizeMessage( void );
void Foreground( void );
void DrawMenuBar( void );
void StatusGetText( LboxString *LString );
void StatusGetText( LPTSTR szText, int nSize );
void StatusSetText( LboxString *LString );
void GetTitle( LboxString *LString );
void SetTitle( LboxString *LString );
void ChangeIcon( int nID );
void StatusPrintf( LPSTR FormatString, ...);
void SetTitle( LPTSTR lpString );
void GetTitle( LPTSTR lpString, int nSize );
BOOL IsMaximize( void );
BOOL IsMinimize( void );
LRESULT Close( void );
void Restore( void );
void Maximize( void );
void Minimize( void );
void CenterWindow( void );
void StatusFit( WPARAM wParam, LPARAM lParam );
void StatusCreate( int nID );
void StatusGetText( LPTSTR szText );
void StatusSetText( LPTSTR szText );
void ScreenFit( void );
LboxWin( HWND hWindow );
LboxWin();
HWND hStatus;
virtual ~LboxWin();
};
// *********************************************************
// ダイアログ
// *********************************************************
class LboxDlg : public LboxWin
{
public:
void ButtonState( int nID, BOOL bFlg );
void EditChangeFzero(int nID, int nLen );
BOOL EditIsReadonly( int nID );
BOOL IsControlVisible( int nID );
BOOL IsControlEnabled( int nID );
int ListSetText(int nID, int nIndex, LboxString *LString);
int ListSelectedSetText( int nID, LboxString *LString );
int ListSelectedGetText(int nID, LboxString *LString );
int ListInsert(int nID, int nIndex, LboxString *LString );
int ListGetText(int nID, int nIndex, LboxString *LString );
int ListAdd(int nID, LboxString *LString );
int ListFindString( int nID, LboxString *LString );
HWND GetHandle( int nID );
int ListFindString( int nID, LPTSTR lpFind );
int EditSetText(int nID, LboxString *LString );
int EditGetText(int nID, LboxString *LString );
void EditPrintf( int nID, LPSTR FormatString, ...);
void Enable( void );
void Disable( void );
void Show( void );
void Hide( void );
void ButtonCheck( int nID, BOOL bFlg );
BOOL ButtonIsCheck( int nID );
int FindString( int nID, LPTSTR lpFind );
void EditCase( int nID, int nType );
void EditPassword( int nID, LPTSTR lpPassChar );
void EditAlign( int nID, int nType );
void EditNumberonly( int nID, BOOL bFlg );
void ListCreateToken( int nID, LboxToken *obj );
int ListTextSize( int nID );
BOOL ListCopyClipboard( int nID, BOOL bSelect );
void End( int nResult );
void Show(int nID );
void Hide(int nID );
void Enable(int nID );
void Disable(int nID );
int EditReadonly(int nID, BOOL bFlg );
HWND EditFocus(int nID );
void EditSelect(int nID );
void EditLimitText(int nID, int nSize );
int EditGetText(int nID, LPSTR pszBuffer, int nSize );
int EditSetText(int nID, LPCTSTR pszBuffer );
int EditSetInt(int nID, int nValue );
void ListPrintf( int nID, LPSTR FormatString, ... );
void ListDump( int nID, LPCTSTR pszBuffer, int nSize );
int ListToken(int nID, LPTSTR pszBuffer, LPTSTR pszDelimiter );
int ListDelete(int nID, int nIndex);
int ListSelectedRow(int nID );
int ListSelectedGetText( int nID, LPCTSTR pszBuffer, int nSize );
int ListSelectedSetText( int nID, LPCTSTR pszBuffer );
int ListSelectedDelete( int nID );
void ListSelect(int nID, int nIndex );
void ListReset( int nID );
int ListCount( int nID );
int ListGetText( int nID, int nIndex, LPCTSTR pszBuffer, int nSize );
int ListSetText( int nID, int nIndex, LPCTSTR pszBuffer );
int ListInsert( int nID, int nIndex, LPCTSTR pszBuffer );
int ListAdd( int nID, LPCTSTR pszBuffer );
LboxDlg( HWND hWnd );
LboxDlg();
HWND hDlg;
virtual ~LboxDlg();
};
// *********************************************************
// リストビュー
// *********************************************************
class LboxListview : public LboxWintool,public LboxToken
{
public:
void GetColumnTextPrevious(
int *pRow, int *pCol, int *pType, int *pSize );
void Scroll( int nColOffset );
BOOL GetColumnPosition(int nRow, int nCol, LPRECT lpRect );
int GetVisibleRows( void );
int LboxListview::GetVisibleTopRow( void );
int GetColumnUserType( int nCol );
void GetColumnType( int nCol, int *pType, int *pSize );
void SetColumnUserType( LPTSTR lpType );
void CopyRow( int nStart, int nFrom, int nTo, LboxListview *Lview );
BOOL CopyClipboard(int nStart, BOOL bSelect, BOOL bTitle, int nType );
BOOL CopyString( int nStart,
BOOL bSelect, BOOL bTitle, int nType, LboxString *LString );
void InsertColumn( int nCol, LboxString *LString );
void InsertColumn( int nCol, LPTSTR szTitle );
void AddColumn( LboxString *LString );
void AddColumn( LPTSTR szTitle );
int GetImage(int nTargetRow, int nTargetCol );
void DestroyPopup( void );
void SetColumnFmt( int nCol, int nFmt );
BOOL FindPreviousSelectedRow( int *nRow );
BOOL FindPreviousRow( int *nRow );
void GetColumnTextNext(int *pRow, int *pCol, int *pType, int *pSize );
void SetComboData( LboxString *LString );
void SetColumnPrintf( int nCol, LPTSTR FormatString, ... );
BOOL CopyString(BOOL bSelect,BOOL bTitle,int nType,LboxString *LString );
void AddColumn(
int nFmt, int nWidth, LboxString *LString
);
void InsertColumn(
int nCol, int nFmt, int nWidth, LboxString *LString
);
void SetColumnType( LPTSTR lpType );
void SetColumnSize( LPTSTR lpSize );
void LoadColumnText( int nRow, int nCol, int nType, int nSize );
void SetBkColor( COLORREF clrBk );
void GetColumnTitle( int nCol, LboxString *LString );
void SetColumnTitle( int nCol, LboxString *LString );
void SetColumnText( int nCol, LboxString *LString );
void GetColumnText( int nCol, LboxString *LString );
void ApplyCheckbox( BOOL bFlg );
BOOL GetCheck( int nIndex );
void SetCheck( int nIndex, BOOL bFlg );
void Fit( int nCol );
void SetComboData( LPTSTR lpData );
void SetComboWidth( int nWidth );
void LoadColumnTextCombo( int nRow, int nCol );
void Sort( int nColumn, int nOrder );
void LoadColumnTextNext( void );
void SetSkipColumn( LPTSTR lpTarget );
void HideEdit( void );
UINT Notify( HWND hTarget, LPARAM lParam );
void SetImage(int nTargetRow, int nTargetCol, int nImage );
void SetImageList( LboxImagelist *obj );
void Scroll( int nRow, int nCol );
void ShowColumnHeader( BOOL bShow );
void SetSelectAll( BOOL bFlg );
BOOL SetFont( int nType, int nSize, BOOL bBold );
void Fit( void );
BOOL CopyClipboard( BOOL bSelect, BOOL bTitle, int nType );
BOOL FindNextRow( int *nRow );
void SetSelect( int nRow, BOOL bFlg );
BOOL FindNextSelectedRow( int *nRow );
void Initialize( void );
BOOL IsState( int nRow, UINT uFlg );
LBOXLISTVIEWINFO *GetInfo( void );
void SelectPopup( int nPos );
void CreatePopup( DWORD mId, int nPos );
void LoadColumnText( int nRow, int nCol );
UINT Notify( LPARAM lParam );
void Grid( void );
void Reset( void );
void DeleteColumn( int nCol );
void DeleteRow( int nRow );
int GetColumnWidth( int nCol );
void SetColumnWidth( int nCol, int nSize );
void GetColumnTitle( int nCol, LPTSTR szBuffer, int nSize );
void SetColumnTitle( int nCol, LPTSTR szBuffer );
void GetColumnText( int nCol, LPTSTR szBuffer, int nSize );
void SetColumnText( int nCol, LPTSTR szBuffer );
void SetCurrentRow( int nRow );
void AddColumn(int nFmt,int nWidth,LPTSTR szTitle);
void InsertColumn(int nCol,int nFmt,int nWidth,LPTSTR szTitle);
int ColumnCount( void );
int AddRow( void );
int InsertRow( int nRow );
int Count( void );
LboxListview( HWND hList, DWORD dwFlag );
LboxListview( HWND hList );
LboxListview();
HWND hCombo;
HWND hHeader;
LBOXLISTVIEWINFO llvi;
DWORD dwInitFlag;
DWORD nID;
int nCurrentPopup;
HMENU hMenu;
HWND hEdit;
HWND hCurrent;
UINT nCurrentId;
UINT Action;
int nCurrentCol;
int nCurrentRow;
LboxString *ColumnType;
LboxString *ColumnSize;
LboxString *ColumnUserType;
int nEditFocusType;
virtual ~LboxListview();
private:
int Rowid;
LboxString *Buffer;
LPTSTR lpSkipColumn;
static int nEditRow;
static int nEditCol;
BOOL hhkFlg;
static HHOOK hhk;
static HHOOK hhkPost;
static LRESULT CALLBACK LboxListview::CallWndRetProc
(int code,WPARAM wParam,LPARAM lParam);
static LRESULT CALLBACK LboxListview::GetMsgProc
(int code,WPARAM wParam,LPARAM lParam);
static int CALLBACK SortProc(
LPARAM lParam1,
LPARAM lParam2,
LPARAM lParamSort
);
};
#define LBOX_ENUMREGKEY_TIME 0x00000001
#define LBOX_ENUMWINDOW_CLASS 0x00000001
#define LBOX_ENUMWINDOW_TITLE 0x00000002
#define LBOX_ENUMWINDOW_PROCESS 0x00000004
#define LBOX_LISTVIEW_EDITABLE 0x00000001
#define LBOX_LISTVIEW_CREATE 0x00000002
#define LBOX_LISTBOX_FILE 1
#define LBOX_LISTBOX_DIR 2
#define LBOX_LISTBOX_ALL 0
#define LBOX_EN_LISTVIEW WM_USER + 1
#define LBOX_LV_DBLCLK WM_USER + 2
#define LBOX_LV_RCLICK WM_USER + 3
#define LBOX_LV_RDBLCLK WM_USER + 4
#define LBOX_LV_RETURN WM_USER + 5
#define LBOX_LV_SETFOCUS WM_USER + 6
#define LBOX_LV_KILLFOCUS WM_USER + 7
#define LBOX_LV_CLICK WM_USER + 8
#define LBOX_LV_EDITDONE WM_USER + 9
#define LBOX_LV_EDITENTER WM_USER + 10
#define LBOX_LV_HEADCLICK WM_USER + 11
#define LBOX_LV_HEADRCLICK WM_USER + 12
#define LBOX_LV_HEADDBLCLK WM_USER + 13
#define LBOX_LV_COMBODONE WM_USER + 14
#define LBOX_RETURN WM_USER + 15
#define LBOX_SPACE WM_USER + 16
#define LBOX_TAB WM_USER + 17
#define LBOX_KEYDOWN WM_USER + 18
#define LBOX_DROPFILES WM_USER + 19
#define LBOX_ESCAPE WM_USER + 20
#define LBOX_DTP_CHANGE WM_USER + 21
#define LBOX_DTP_KILLFOCUS WM_USER + 22
#define LBOX_DTP_SETFOCUS WM_USER + 23
#define LBOX_UP WM_USER + 24
#define LBOX_DOWN WM_USER + 25
#define LBOX_LV_EDITUP WM_USER + 26
#define LBOX_LV_EDITDOWN WM_USER + 27
#define LBOX_RBUTTONDOWN WM_USER + 100
#define LBOX_USER WM_USER + 500
#define LBOX_ID_BASE 2000
#define LVROW(a) ((short)(LOWORD(a)))
#define LVCOL(a) ((short)(HIWORD(a)))
// *********************************************************
// コンスタント
// *********************************************************
class LboxConst
{
public:
int LVIEW_FMT_RIGHT;
int LVIEW_FMT_LEFT;
int LVIEW_FMT_CENTER;
int SPFOLDER_APPDATA;
int SPFOLDER_COMMON_DESKTOP;
int SPFOLDER_COMMON_FAVORITES;
int SPFOLDER_COMMON_STARTMENU;
int SPFOLDER_COMMON_STARTUP;
int SPFOLDER_COOKIES;
int SPFOLDER_DESKTOP;
int SPFOLDER_FAVORITES;
int SPFOLDER_HISTORY;
int SPFOLDER_INTERNET_CACHE;
int SPFOLDER_NETHOOD;
int SPFOLDER_PERSONAL;
int SPFOLDER_PRINTHOOD;
int SPFOLDER_PROGRAMS;
int SPFOLDER_RECENT;
int SPFOLDER_SENDTO;
int SPFOLDER_STARTMENU;
int SPFOLDER_STARTUP;
int SPFOLDER_TEMPLATES;
LboxConst();
virtual ~LboxConst();
};
// *********************************************************
// UNLHA
// *********************************************************
class LboxUnlha
{
public:
int MeltPath( LboxListview *Lview, LboxString *LDir );
int MeltPath( LboxListview *Lview, LPTSTR lpDir );
int MeltDirect( LboxListview *Lview, LboxString *LDir );
int MeltDirect( LboxListview *Lview, LPTSTR lpDir );
int Delete( LboxListview *Lview );
int Freeze( HDROP hDrop );
int Freeze( LboxString *LPath );
int Freeze( LPTSTR lpPath );
int Unlha( LboxString *LCmdLine );
BOOL Enum( LboxListview *Lview, LPTSTR szWildName );
int Unlha(LPTSTR szCmdLine,LPTSTR szOutput,const DWORD dwSize);
BOOL EnumListbox( HWND hList, int nIndex, LPTSTR szWildName );
void CloseArchive( void );
BOOL OpenArchive( LPTSTR szFileName );
DWORD Mode;
BOOL CheckDll( void );
void Initialize( void );
LPFUNC_UNLHA UnlhaAction;
LPFUNC_FIND_NEXT UnlhaFindNext;
LPFUNC_FIND_FIRST UnlhaFindFirst;
LPFUNC_CLOSE_ARC UnlhaCloseArchive;
LPFUNC_OPEN_ARC UnlhaOpenArchive;
HINSTANCE lib;
HARC hArc;
HWND hOwner;
LboxUnlha( HWND hWnd );
LboxUnlha();
virtual ~LboxUnlha();
LboxString TargetPath;
LboxString Output;
LboxString Command;
};
// *********************************************************
// 数値文字列
// *********************************************************
class LboxNumberString
{
public:
BOOL operator == ( int nNum );
BOOL operator == ( LPTSTR lpNum );
LPTSTR Divide( int a, int b );
LPTSTR Divide( LPTSTR lpA, LPTSTR lpB );
LPTSTR Multiply( int a, int b );
LPTSTR Multiply( LPTSTR lpA, LPTSTR lpB );
LPTSTR Minus( int a, int b );
LPTSTR Minus( LPTSTR lpA, LPTSTR lpB );
LPTSTR Plus( int a, int b );
LPTSTR Plus( LPTSTR lpA, LPTSTR lpB );
LPTSTR operator -= ( int nSubtract );
LPTSTR operator -= ( LPTSTR lpSubtract );
LPTSTR operator += ( int nAdd );
LPTSTR operator += ( LPTSTR lpAdd );
LPTSTR operator = ( int nNum );
LPTSTR operator = ( LPTSTR lpNum );
LPTSTR szNumber;
LboxNumberString();
virtual ~LboxNumberString();
};
// *********************************************************
// イベントフック
// *********************************************************
class LboxEventhook
{
public:
LboxEventhook();
virtual ~LboxEventhook();
private:
static HHOOK hHook;
static LRESULT CALLBACK GetMsgProc
(int code,WPARAM wParam,LPARAM lParam);
};
// *********************************************************
// エディットコントロール
// *********************************************************
class LboxEdit : public LboxWintool
{
public:
int SetText( LboxString *LString );
int GetText( LboxString *LString );
int SetText( LPCTSTR pszBuffer );
int GetText( LPSTR pszBuffer, int nSize );
LboxEdit( HWND hOwner, int nID, int nType );
LboxEdit( HWND hTarget );
LboxEdit();
virtual ~LboxEdit();
BOOL bCreate;
};
// *********************************************************
// ツールバー
// *********************************************************
class LboxToolbar : public LboxWintool
{
public:
void AddStandardButton( int nType, DWORD nIndex, int nCommand );
void ParentFit( WPARAM wParam, LPARAM lParam );
void AddSep( void );
void AddButton( DWORD nId, int nCommand );
int AddBitmap( DWORD nId );
void Create( HWND hOwner, int nIndent );
LboxToolbar();
virtual ~LboxToolbar();
BOOL bStandard;
int offsetHist;
int offsetStd;
int offsetView;
};
// *********************************************************
// メニュー
// *********************************************************
class LboxMenu
{
public:
void SetText( LPTSTR lpTarget, LPTSTR lpPos, LPTSTR lpText );
void GetText( LPTSTR lpTarget, LboxString *LString, int nID );
void AddItem( LPTSTR lpTarget, LboxString *LString, int nID );
void Check( int nID, BOOL bCheck );
void Check( LPTSTR lpTarget, int nID, BOOL bCheck );
void Check( LPTSTR lpTarget, LPTSTR lpPos, BOOL bCheck );
void ResetItem( LPTSTR lpTarget, int nStartPos );
void AddItem( LPTSTR lpTarget, LPTSTR lpItem, int nID );
void ResetItem( LPTSTR lpTarget );
void Destroy( LPTSTR lpTarget );
void AddSeparator( LPTSTR lpTarget );
int Count( LPTSTR lpTarget );
int Count( void );
void SetSubMenu( LPTSTR lpTarget );
void Disable( LPTSTR lpTarget, LPTSTR lpPos, BOOL bDisable );
void Disable( LPTSTR lpTarget, int nID, BOOL bDisable );
void Disable( int nID, BOOL bDisable );
void ResetSubMenu( void );
void SetSubMenu( int nPos );
void SetBaseMenu( HMENU hTarget );
void SetBaseMenu( HWND hTarget );
LboxMenu( );
virtual ~LboxMenu();
HMENU hMenu;
HMENU hCurMenu;
};
// *********************************************************
// 列挙
// *********************************************************
class LboxEnum
{
public:
void ChildWindow( HWND hTarget, LboxListview *Lview );
void TopWindow( LboxListview *Lview );
LboxEnum();
virtual ~LboxEnum();
};
// *********************************************************
// カレンダー
// *********************************************************
class LboxCalendar : public LboxWintool
{
public:
void GetTodaySystemtime( SYSTEMTIME *st );
void GetTodayString( LboxString *LString );
void GetDateSystemtime( SYSTEMTIME *st );
void GetDateString( LboxString *LString );
LboxCalendar( HWND hOwner, HWND hBase );
LboxCalendar( HWND hOwner );
LboxCalendar();
virtual ~LboxCalendar();
LboxEdit *BaseEdit;
};
// *********************************************************
// コンボボックス
// *********************************************************
class LboxCombobox : public LboxWintool
{
public:
int SelectedGetData( LboxString *LString );
int SelectedDelete( HWND hWnd );
int SelectedSetText( LboxString *LString );
int SelectedSetText( LPCTSTR pszBuffer );
int SelectedGetText( LboxString *LString );
int SetText( int nIndex, LboxString *LString );
int SetText( int nIndex, LPTSTR lpString );
int GetData( int nIndex, LboxString *LString );
int GetText( int nIndex, LboxString *LString );
void SetHeight( int nHeight );
int SelectedRow( void );
int FindData( LboxString *LString );
int FindData( LPTSTR lpFind );
int FindString( LboxString *LString );
int FindString( LPTSTR lpFind );
void Select( int nIndex );
int Count( void );
void SetWidth( int nWidth );
void Reset( void );
int Delete( int nIdx );
int Insert( int nIdx, LboxString *LScode, LboxString *LString );
int Insert( int nIdx, LPTSTR pszCode, LPTSTR pszBuffer );
int Add( LboxString *LScode, LboxString *LString );
int Add( LPTSTR pszCode, LPTSTR pszBuffer );
LboxCombobox( HWND hWnd );
LboxCombobox( HWND hOwner, int nID );
LboxCombobox();
virtual ~LboxCombobox();
LboxListbox *List;
BOOL bCreate;
};
// *********************************************************
// Excel
// *********************************************************
class LboxExcel
{
public:
BOOL bError;
LboxString ComError;
BOOL SetSheetName( LboxString *LString, LboxString *LNewString );
BOOL SetSheetName( LPTSTR lpSheetName, LPTSTR lpSheetNewName );
BOOL SetSheetName( long nIndex, LboxString *LString );
BOOL SetSheetName( long nIndex, LPTSTR lpSheetName );
BOOL CopySheet( LboxString *LString );
BOOL CopySheet( LPTSTR lpSheet );
BOOL CopySheet( long nIndex );
BOOL CopySheet( long nIndex, LboxString *LNewString );
BOOL CopySheet( long nIndex, LPTSTR lpNewSheet );
BOOL CopySheet( LboxString *LString, LboxString *LNewString );
BOOL CopySheet( LPTSTR lpSheet, LPTSTR lpNewSheet );
BOOL Box( long nX1, long nY1, long nX2, long nY2 );
BOOL SetRowHeight( long nY, long nHeight );
BOOL SetColumnWidth( long nX, long nWidth );
BOOL GetCell( long nX, long nY, LboxString *LString );
BOOL SetCell( long nX, long nY, LboxString *LString );
BOOL SetCell( long nX, long nY, LPTSTR lpCell );
BOOL Delete( LboxString *LString );
BOOL Delete( LPTSTR lpSheet );
BOOL Delete( long nSheet );
BOOL GetSheetName( long nIndex, LboxString *LString );
long SheetCount( void );
BOOL Select( long nSheet );
BOOL Select( LboxString *LString );
BOOL Select( LPTSTR lpSheet );
BOOL AddSheetLast( LboxString *LString );
BOOL AddSheetLast( LPTSTR lpSheet );
BOOL AddSheetFirst( LboxString *LString );
BOOL AddSheetFirst( LPTSTR lpSheet );
BOOL SaveCopy( LboxString *LString );
BOOL SaveCopy( LPTSTR lpBook );
BOOL Save( LboxString *LString );
BOOL Save( LPTSTR lpBook );
BOOL Save( void );
void Visible( BOOL bFlg );
BOOL Open( LboxString *LString );
BOOL Open( LPTSTR lpBook );
BOOL Quit( void );
LboxExcel();
virtual ~LboxExcel();
};
// *********************************************************
// DTPicker
// *********************************************************
class LboxDTPicker : public LboxWintool
{
public:
UINT Notify( HWND hTarget, LPARAM lParam );
BOOL SetDateString( LboxString *LString, LPTSTR lpDelim );
BOOL SetDateString( LPTSTR lpDate, LPTSTR lpDelim );
BOOL SetDateSystemtime( SYSTEMTIME *st );
BOOL GetDateSystemtime( SYSTEMTIME *st );
BOOL GetDateString( LboxString *LString );
LboxDTPicker( HWND hOwner, HWND hBase, BOOL bNoData );
LboxDTPicker();
virtual ~LboxDTPicker();
LboxEdit *BaseEdit;
BOOL bNoData;
};
// *********************************************************
// Progress Bar
// *********************************************************
class LboxProgressBar : public LboxWintool
{
public:
void Reset( void );
void SetBarcolor( int r, int g, int b );
void SetBkcolor( int r, int g, int b );
void SetPos( int nPos );
void Next( void );
void SetStep( int nStep );
void SetRange( DWORD nMin, DWORD nMax );
LboxProgressBar( HWND hOwner, HWND hBase );
LboxProgressBar();
virtual ~LboxProgressBar();
LboxEdit *BaseEdit;
};
// *********************************************************
// Internet Explorer
// *********************************************************
class LboxIE
{
public:
void Preview( void );
void Reload( void );
HWND GetWindowHandle( void );
BOOL GetBusy( void );
void Visible( BOOL bFlg );
void Load( LboxString *LString );
void Load( LPTSTR lpPath );
LboxIE();
virtual ~LboxIE();
BOOL bError;
LboxString ComError;
};
// *********************************************************
// Internet Explorer 印刷支援
// *********************************************************
class LboxIEPrint : public LboxIE
{
public:
LboxString *Size( int nSize, LboxString *LString );
LboxString *Bold( LboxString *LString );
LboxString *Left( int nLeft, LboxString *LString );
BOOL IsPreview( void );
void Cr( int nCr );
void Write( LboxString *LString );
void Write( LPTSTR lpData );
void NextPage( void );
void EndDoc( void );
void StartDoc( LboxString *LString );
void StartDoc( LPTSTR lpDocName );
void ReportPreview( LboxString *LString );
void ReportPreview( LPTSTR lpDocName );
LboxIEPrint();
virtual ~LboxIEPrint();
LboxString TempPath;
int Timeout;
LboxTextFile Doc;
LboxString BaseFont;
LboxString BaseFontSize;
HWND hWndDocView;
BOOL bPreview;
};
// *********************************************************
// WinInet
// *********************************************************
class LboxWininet
{
public:
BOOL FTPEnum(LboxString *LDir, LboxString *LFile, LboxListview *Lview );
BOOL FTPEnum( LPTSTR lpDir, LPTSTR lpFile, LboxListview *Lview );
BOOL FTPGetLastWriteTime( LboxString *LFile, LboxString *LDate );
BOOL FTPGetLastWriteTime( LPTSTR lpFile, LboxString *LDate );
DWORD FTPGetFileSize( LboxString *LFile );
DWORD FTPGetFileSize( LPTSTR lpFile );
BOOL FTPDeleteFile( LboxString *LFile );
BOOL FTPDeleteFile( LPTSTR lpFile );
BOOL FTPRenameFile( LboxString *LOld, LboxString *LNew );
BOOL FTPRenameFile( LPTSTR lpOld, LPTSTR lpNew );
BOOL FTPRemoveDirectory( LboxString *LDir );
BOOL FTPRemoveDirectory( LPTSTR lpDir );
BOOL FTPCreateDirectory( LboxString *LDir );
BOOL FTPCreateDirectory( LPTSTR lpDir );
BOOL FTPGetCurrentDirectory( LboxString *LDir );
BOOL FTPSetCurrentDirectory( LboxString *LDir );
BOOL FTPSetCurrentDirectory( LPTSTR lpDir );
BOOL FTPUpload( LboxString *LRemote, LboxString *LLocal );
BOOL FTPUpload( LPTSTR lpRemote, LPTSTR lpLocal );
BOOL FTPDownload( LboxString *LRemote, LboxString *LLocal );
BOOL FTPDownload( LPTSTR lpRemote, LPTSTR lpLocal );
void Disconnect( );
BOOL FTPConnect( );
LboxWininet();
virtual ~LboxWininet();
HINTERNET hSession;
HINTERNET hConnect;
BOOL bPassive;
LboxString Agent;
LboxString Server;
LboxString User;
LboxString Password;
};
// *********************************************************
// WNet
// *********************************************************
class LboxWNet
{
public:
BOOL EnumDiskResource(
LboxString *LDomain, LboxString *LServer, LboxListview *Lview );
BOOL EnumDiskResource(
LPTSTR lpDomain, LPTSTR lpServer, LboxListview *Lview );
BOOL EnumServer( LboxString *LDomain, LboxListview *Lview );
BOOL EnumServer( LPTSTR lpDomain, LboxListview *Lview );
BOOL EnumDomain( LboxListview *Lview );
BOOL EnumConnected( LboxListview *Lview );
BOOL DialogDisConnect( HWND hOwner );
BOOL DialogConnect( HWND hOwner );
BOOL DisConnect(LboxString *LName, BOOL bKeep);
BOOL DisConnect(LPTSTR lpName, BOOL bKeep);
BOOL DisConnectForce(LboxString *LName, BOOL bKeep);
BOOL DisConnectForce(LPTSTR lpName, BOOL bKeep);
BOOL DisConnect(LboxString *LName, BOOL bKeep, BOOL bForce);
BOOL DisConnect(LPTSTR lpName, BOOL bKeep, BOOL bForce);
BOOL Connect(
HWND hOwner, LboxString *LRemote, LboxString *LLocal, BOOL bKeep
);
BOOL Connect( HWND hOwner, LPTSTR lpRemote, LPTSTR lpLocal, BOOL bKeep );
BOOL Connect( HWND hOwner, LboxString *LRemote, BOOL bKeep );
BOOL Connect( HWND hOwner, LPTSTR lpRemote, BOOL bKeep );
BOOL Connect( LboxString *LRemote, LboxString *LLocal, BOOL bKeep );
BOOL Connect( LPTSTR lpRemote, LPTSTR lpLocal, BOOL bKeep );
BOOL Connect( LboxString *LRemote, BOOL bKeep );
BOOL Connect( LPTSTR lpRemote, BOOL bKeep );
BOOL Connect(
HWND hOwner, LboxString *LRemote, LboxString *LLocal,
BOOL bPrompt, BOOL bKeep
);
BOOL Connect(
HWND hOwner, LPTSTR lpRemote, LPTSTR lpLocal,
BOOL bPrompt, BOOL bKeep
);
LboxWNet();
virtual ~LboxWNet();
HINSTANCE lib;
LboxString User;
LboxString Password;
LboxString AccessName;
LboxString ErrorDescription;
};
// *********************************************************
// Basp21
// *********************************************************
class LboxBasp
{
public:
BOOL ZenToHan( LboxString *LZen, LboxString *LHan );
BOOL ZenToHan( LPTSTR lpZen, LboxString *LHan );
BOOL HanToZen( LboxString *LHan, LboxString *LZen );
BOOL HanToZen( LPTSTR lpHan, LboxString *LZen );
BOOL StrConv(long nType, LboxString *LBase, LboxString *LOut );
BOOL StrConv(long nType, LPTSTR lpBase, LboxString *LOut );
BOOL HankanaToZen( LboxString *LHan, LboxString *LZen );
BOOL HankanaToZen( LPTSTR lpHan, LboxString *LZen );
BOOL DelMail( LboxString *LFile );
BOOL RcvData( LboxListview *Lview );
BOOL RcvList( LboxListview *Lview );
BOOL DelMail(
LboxString *LUser, LboxString *LPass, LboxString *LFile );
BOOL DelMail(
LPTSTR lpUser, LPTSTR lpPass, LPTSTR lpFile );
BOOL GetBody(
LboxString *LFile, LboxString *LBody );
BOOL GetBody(
LPTSTR lpFile, LboxString *LBody );
BOOL RcvData(
LboxString *LUser, LboxString *LPass, LboxListview *Lview );
BOOL RcvData(
LPTSTR lpUser, LPTSTR lpPass, LboxListview *Lview );
BOOL RcvList(
LPTSTR lpUser, LPTSTR lpPass, LboxListview *Lview );
BOOL SendMail(
LboxString *LTo, LboxString *LFrom,
LboxString *LSubj, LboxString *LBody
);
BOOL SendMail(
LPTSTR lpTo, LPTSTR From, LPTSTR lpSubject, LPTSTR lpBody );
LboxBasp();
virtual ~LboxBasp();
LboxString User;
LboxString Password;
LboxString SMTPServer;
LboxString POP3Server;
HINSTANCE lib;
LboxString RcvDir;
LboxString ErrorDescription;
};
// *********************************************************
// スレッド
// *********************************************************
class LboxThread
{
public:
BOOL Create( HWND hWnd, LPTHREAD_START_ROUTINE lpAddress );
BOOL Close( void );
LboxThread();
virtual ~LboxThread();
HANDLE hThread;
DWORD ThreadID;
};
// *********************************************************
// Shell ユーザーインターフェイス
// *********************************************************
#define LBOX_SHELLUI_DISPLAY_SCREENSAVER 1
#define LBOX_SHELLUI_DISPLAY_BACKGROUND 2
#define LBOX_SHELLUI_DISPLAY_SETTINGS 3
#define LBOX_SHELLUI_SYSTEM_GENERAL 11
#define LBOX_SHELLUI_ODBC 1001
class LboxShellUI
{
public:
BOOL Shell32SetTime( void );
BOOL Shell32UndoMinimizeALL( void );
BOOL Shell32TaskbarProperties( void );
BOOL Shell32ShutdownDialog( void );
BOOL Shell32MinimizeAll( void );
BOOL Shell32Help( void );
BOOL Shell32FindFiles( void );
BOOL Shell32FindComputer( void );
BOOL Shell32FileRun( void );
BOOL OpenShellUI( HWND hOwner, DWORD nType );
BOOL OpenItem( LboxString *LFolderItem );
BOOL OpenItem( LPTSTR lpFolderItem );
BOOL EnumFolder( LboxListview *Lview, LboxString *LFolder );
BOOL EnumFolder( LboxListview *Lview, LPTSTR lpFolder );
BOOL EnumDesktop( LboxListview *Lview );
LboxShellUI();
virtual ~LboxShellUI();
LboxString ErrMessage;
LPTSTR MyComputer;
LPTSTR MyNetwork;
LPTSTR RecycleBin;
LPTSTR ControlPanel;
LPTSTR Printer;
BOOL bError;
LboxString ComError;
};
#endif
| |