📄 mainwin.h
字号:
/* static char *fastcopy_id =
"@(#)Copyright (C) H.Shirouzu 2004-2008 mainwin.h Ver1.70"; */
/* ========================================================================
Project Name : Fast Copy file and directory
Create : 2004-09-15(Wed)
Update : 2008-02-02(Sat)
Copyright : H.Shirouzu
Reference :
======================================================================== */
#ifndef MAINWIN_H
#define MAINWIN_H
#include "tlib.h"
#include "fastcopy.h"
#include "cfg.h"
#include "miscdlg.h"
#include <stddef.h>
#define FASTCOPY "FastCopy"
#define FASTCOPY_CLASS "fastcopy_class"
#define WM_FASTCOPY_MSG (WM_USER + 100)
#define WM_FASTCOPY_NOTIFY (WM_USER + 101)
#define WM_FASTCOPY_HIDDEN (WM_USER + 102)
#define WM_FASTCOPY_RUNAS (WM_USER + 103)
#define FASTCOPY_TIMER 100
#define FASTCOPY_NIM_ID 100
#define FASTCOPYLOG_MUTEX "FastCopyLogMutex"
#define MAX_HISTORY_BUF 8192
#define MAX_HISTORY_CHAR_BUF (MAX_HISTORY_BUF * 4)
#define SHELLEXT_MIN_ALLOC (16 * 1024)
#define SHELLEXT_MAX_ALLOC (4 * 1024 * 1024)
struct CopyInfo {
UINT resId;
char *list_str;
UINT cmdline_resId;
void *cmdline_name;
FastCopy::Mode mode;
FastCopy::OverWrite overWrite;
};
struct DlgItem {
HWND hWnd;
WINPOS wpos;
};
#define MAX_NORMAL_FASTCOPY_ICON 4
#define FCNORMAL_ICON_INDEX 0
#define FCWAIT_ICON_INDEX MAX_NORMAL_FASTCOPY_ICON
#define MAX_FASTCOPY_ICON MAX_NORMAL_FASTCOPY_ICON + 1
#define SPEED_FULL 11
#define SPEED_AUTO 10
#define SPEED_SUSPEND 0
class TMainDlg : public TDlg {
protected:
enum AutoCloseLevel { NO_CLOSE, NOERR_CLOSE, FORCE_CLOSE };
enum { NORMAL_EXEC=1, LISTING_EXEC=2, CMDLINE_EXEC=4 };
enum { RUNAS_IMMEDIATE=1, RUNAS_SHELLEXT=2, RUNAS_AUTOCLOSE=4 };
FastCopy fastCopy;
FastCopy::Info info;
Cfg cfg;
HICON hMainIcon[MAX_FASTCOPY_ICON];
/* share to runas */
AutoCloseLevel autoCloseLevel;
BOOL isTaskTray;
BOOL speedLevel;
BOOL noConfirmDel;
UINT diskMode;
BOOL isRegExp;
BOOL isShellExt;
BOOL isNetPlaceSrc;
int skipEmptyDir;
int forceStart;
WCHAR logFile[MAX_PATH];
BOOL isErrLog;
BOOL isUtf8Log;
BOOL isReparse;
/* end of share to runas */
BOOL isRunAsStart;
BOOL isRunAsParent;
void *RunasShareData() { return (void*)&autoCloseLevel; }
DWORD RunasShareSize() { return offsetof(TMainDlg, isRunAsStart) - offsetof(TMainDlg, autoCloseLevel); }
RECT orgRect;
enum { srcbutton_item=0, dstbutton_item, srccombo_item, dstcombo_item,
status_item, mode_item, bufstatic_item, bufedit_item, help_item,
ignore_item, estimate_item, top_item, list_item, ok_item, atonce_item,
owdel_item, acl_item, stream_item, speed_item, speedstatic_item,
samedrv_item, incstatic_item, excstatic_item, inccombo_item, exccombo_item,
filter_item, path_item, errstatic_item, errstatus_item, erredit_item, max_dlgitem };
DlgItem dlgItems[max_dlgitem];
int listBufOffset;
int errBufOffset;
UINT TaskBarCreateMsg;
int miniHeight;
int normalHeight;
BOOL isErrEditHide;
UINT curIconIndex;
BOOL isDelay;
UINT timerID;
SYSTEMTIME startTm;
DWORD endTick;
char *pathLogBuf;
HANDLE hErrLogFile;
HANDLE hErrLogMutex;
TransInfo ti;
// for detect autoslow status
DWORD timerCnt;
POINT curPt;
HWND curForeWnd;
DWORD curPriority;
TAboutDlg aboutDlg;
TSetupDlg setupDlg;
TShellExtDlg shellExtDlg;
TJobDlg jobDlg;
protected:
BOOL MoveCenter(BOOL isShow);
BOOL SetupWindow();
BOOL ExecCopy(DWORD exec_flags);
BOOL ExecCopyCore(void);
BOOL EndCopy(void);
BOOL CancelCopy(void);
void SetItemEnable(BOOL is_delete);
FastCopy::Mode GetCopyMode(void);
void ReflectFilterCheck(BOOL is_invert=FALSE);
void SetDlgItem(UINT ctl_id, DlgItem *item);
void SetSize(void);
void UpdateMenu();
void SetJob(int idx);
BOOL IsListing() { return (info.flags & FastCopy::LISTING_ONLY) ? TRUE : FALSE; }
void SetPriority(DWORD new_class);
DWORD UpdateSpeedLevel(BOOL is_timer=FALSE);
public:
TMainDlg();
virtual ~TMainDlg();
virtual BOOL EvCreate(LPARAM lParam);
virtual BOOL EvCommand(WORD wNotifyCode, WORD wID, LPARAM hwndCtl);
virtual BOOL EvNcDestroy(void);
virtual BOOL EvTimer(WPARAM timerID, TIMERPROC proc);
virtual BOOL EvSysCommand(WPARAM uCmdType, POINTS pos);
virtual BOOL EvSize(UINT fwSizeType, WORD nWidth, WORD nHeight);
virtual BOOL EvDropFiles(HDROP hDrop);
virtual BOOL EventScroll(UINT uMsg, int nCode, int nPos, HWND scrollBar);
/*
virtual BOOL EvEndSession(BOOL nSession, BOOL nLogOut);
virtual BOOL EvQueryOpen(void);
virtual BOOL EvHotKey(int hotKey);
virtual BOOL EventButton(UINT uMsg, int nHitTest, POINTS pos);
virtual BOOL EventInitMenu(UINT uMsg, HMENU hMenu, UINT uPos, BOOL fSystemMenu);
*/
virtual BOOL EventUser(UINT uMsg, WPARAM wParam, LPARAM lParam);
virtual void Show(int mode = SW_SHOWDEFAULT);
BOOL RunAsAdmin(DWORD flg = 0);
BOOL EnableLogFile(BOOL on);
BOOL CommandLineExecV(int argc, void **argv);
BOOL RunasSync(HWND hOrg);
BOOL SetMiniWindow(void);
BOOL SetNormalWindow(void);
void RefreshWindow(BOOL is_start_stop=FALSE);
BOOL SetWindowTitle(char *fmt,...);
BOOL IsDestDropFiles(HDROP hDrop);
BOOL SetInfo(BOOL is_task_tray=FALSE, BOOL is_finish_status=FALSE);
void SetComboBox(int item, void **history, BOOL set_edit);
void SetPathHistory(BOOL set_edit);
void SetFilterHistory(BOOL set_edit);
BOOL TaskTray(int nimMode, HICON hSetIcon=NULL, LPCSTR tip=NULL);
};
class TFastCopyApp : public TApp {
public:
TFastCopyApp(HINSTANCE _hI, LPSTR _cmdLine, int _nCmdShow);
virtual ~TFastCopyApp();
virtual void InitWindow(void);
};
void SetVersionStr(BOOL is_runas=FALSE);
const char *GetVersionStr(void);
void DBGWrite(char *fmt,...);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -