diff --git a/CLCLPlugin/CLCLPlugin(english).txt b/CLCLPlugin/CLCLPlugin(english).txt new file mode 100644 index 0000000..ccac4bd --- /dev/null +++ b/CLCLPlugin/CLCLPlugin(english).txt @@ -0,0 +1,313 @@ + +----[General]---------------------------- + +WM_GET_VERSION + wParam - 0 + lParam - 0 + Returned value - (int) version + Function: + Acquire the CLCL version. + +WM_GET_WORKPATH + wParam - 0 + lParam - (TCHAR *) Working directory path (OUT) + Returned value - 0 + Function: + Acquire the working directory path. + The initial path is a username directory within the directory that has the CLCL.exe file. + +WM_GET_CLIPBOARD_WATCH + wParam - 0 + lParam - 0 + Returned value - (int) 0 – No monitoring, 1 - Monitoring + Function: + Acquire the monitoring state of the clipboard. + +WM_SET_CLIPBOARD_WATCH + wParam - (int) 0 - disable monitoring, 1 - enable monitoring + lParam - 0 + Returned value - 0 + Function: + Switch the clipboard monitor on or off. + +WM_GET_FORMAT_ICON + wParam - (int) Icon size + lParam - (TCHAR *) Format name + Returned value - (HICON)Icon handle + Function: + Acquire format icon. + Please cancel after using the icon handle. + +WM_ENABLE_ACCELERATOR + wParam - (BOOL) TRUE - Enable, FALSE - Disable + lParam - 0 + Returned value - 0 + Function: + Enables or disables the accelerator. + +WM_REGIST_HOTKEY + wParam - 0 + lParam - 0 + Returned value - 0 + Function: + Registers hotkey(s). + +WM_UNREGIST_HOTKEY + wParam - 0 + lParam - 0 + Returned value - 0 + Function: + Un-registers hotkey(s). + + +----[Option]---------------------------- + +WM_OPTION_SHOW + wParam - 0 + lParam - (TCHAR *) Display tab + Returned value - 0 + Function: + Displays the option screen. + +WM_OPTION_GET + wParam - 0 + lParam - 0 + Returned value - (OPTION_INFO *) Option information + Function: + Acquires options. + +WM_OPTION_LOAD + wParam - 0 + lParam - 0 + Returned value - 0 + Function: + Reload options. + +WM_OPTION_SAVE + wParam - 0 + lParam - 0 + Returned value - 0 + Function: + Save options. + + +----[history & regist]---------------------------- + +WM_HISTORY_CHANGED + wParam - 0 + lParam - 0 + Returned value - 0 + Function: + Notifies of any history item changes. + Sending this updates the display using the viewer. + +WM_HISTORY_GET_ROOT + wParam - 0 + lParam - 0 + Returned value - (DATA_INFO *) Root history items + Function: + Acquire history items. + +WM_HISTORY_LOAD + wParam - (int) 0 – Follow option(s), 1 – Force a re-read + lParam - 0 + Returned value - (BOOL) TRUE - Success, FALSE - Failure + Function: + Clear the current history and re-read. + +WM_HISTORY_SAVE + wParam - (int) 0 - Follow option(s), 1 – Forced save + lParam - 0 + Returned value - (BOOL) TRUE - Success, FALSE - Failure + Function: + Save the history. + +WM_REGIST_CHANGED + wParam - 0 + lParam - 0 + Returned value - 0 + Function: + Registered item change notification. + Sending this updates the display using the viewer. + +WM_REGIST_GET_ROOT + wParam - 0 + lParam - 0 + Returned value - (DATA_INFO *) Root registered items + Function: + Acquire registered items. + +WM_REGIST_LOAD + wParam - 0 + lParam - 0 + Returned value - (BOOL) TRUE - Success, FALSE - Failure + Function: + Clear current registered items and re-read. + +WM_REGIST_SAVE + wParam - 0 + lParam - 0 + Returned value - (BOOL) TRUE - Success, FALSE - Failure + Function: + Save registered item(s). + + +----[Item]---------------------------- + +WM_ITEM_TO_CLIPBOARD + wParam - 0 + lParam - (DATA_INFO *) Item + Returned value - (BOOL) TRUE - Success, FALSE - Failure + Function: + Send item to clipboard. + +WM_ITEM_CREATE + wParam - (int) Type created (TYPE_DATA or TYPE_ITEM or TYPE_FOLDER) + lParam – Changes depending on the wParam + TYPE_DATA - (TCHAR *) Format name + TYPE_ITEM - (TCHAR *) Title + TYPE_FOLDER - (TCHAR *) Title + Returned value - (DATA_INFO *)Created item + Function: + Create item. + +WM_ITEM_COPY + wParam - 0 + lParam - (DATA_INFO *) Original item copy + Returned value - (DATA_INFO *) Copied item + Function: + Create an item copy. + +WM_ITEM_FREE + wParam - 0 + lParam - (DATA_INFO *) the item to be released + Returned value - 0 + Function: + Release the item. + Release an item in the list. If 'next' or 'child' are set + remove the item from the list before calling this message. + +WM_ITEM_FREE_DATA + wParam - (TCHAR *) Format name + lParam - (HANDLE)Release data + Returned value - 0 + Function: + Release data. + Is invoked when the di->data included in the item is released. + +WM_ITEM_CHECK + wParam - 0 + lParam - (DATA_INFO *) The item that checks. + Returned value - (int) -1 – doesn’t exist, 0 – exists in history, 1 - exists in recorded item. + Function: + Checks item existence. + +WM_ITEM_TO_BYTES + wParam - (DWORD *)size after change (OUT) + lParam - (DATA_INFO *) item to change + Returned value - (BYTE *)bytes after change + Function: + Changes the item to bytes. + +WM_ITEM_FROM_BYTES + wParam - (BYTE *)Bytes to be changed + lParam - (DATA_INFO *) The set item + Returned value - 0 + Function: + Creates data from the bytes and establishes the item. + +WM_ITEM_TO_FILE + wParam - (TCHAR *) File name + lParam - (DATA_INFO *) Saved item + Returned value - (BOOL) TRUE - Success, FALSE - Failure + Function: + Saves the item to a file. + +WM_ITEM_FROM_FILE + wParam - (TCHAR *) File name + lParam - (DATA_INFO *) The set item + Returned value - (BOOL) TRUE - Success, FALSE - Failure + Function: + Creates data from the file and sets the item. + +WM_ITEM_GET_PARENT + wParam - 0 + lParam - (DATA_INFO *) Item to get parent item + Returned value - (DATA_INFO *) If the parent item can’t be found return NULL. + Function: + Acquire the item’s parent item. + +WM_ITEM_GET_FORMAT_TO_ITEM + wParam - (TCHAR *) Format name + lParam - (DATA_INFO *) Item information + Returned value - (DATA_INFO *) TYPE_DATA item + Function: + Search the item for the assigned format name. + +WM_ITEM_GET_PRIORITY_HIGHEST + wParam - 0 + lParam - (DATA_INFO *) TYPE_ITEM item + Returned value - (DATA_INFO *) TYPE_DATA item + Function: + Acquire the item with the highest priority format. + +WM_ITEM_GET_TITLE + wParam - (TCHAR *) Title (OUT) + lParam - (DATA_INFO *) Item to get title + Returned value - 0 + Function: + Acquire the title of the item. + +WM_ITEM_GET_OPEN_INFO + wParam - (OPENFILENAME *)File information (OUT) + lParam - (TCHAR *) Format name + Returned value - (int) -1 – don’t display common dialogue, 0 - unset, 1 – set format + Function: + Acquire the information to open the file of each format. + +WM_ITEM_GET_SAVE_INFO + wParam - (OPENFILENAME *)File information (OUT) + lParam - (DATA_INFO )Item to get saved information + Returned value - (int) -1 - don’t display common dialogue, 0 - unset, 1 - set format + Function: + Acquire the item’s saved file information. + + +----[Viewer]---------------------------- + +WM_VIEWER_SHOW + wParam - 0 + lParam - 0 + Returned value - none + Function: + Shows the viewer. + +WM_VIEWER_GET_HWND + wParam - 0 + lParam - 0 + Returned value - +(HWND)If the viewer’s window handle isn’t shown then return NULL + Function: + Acquire the viewer’s window handle. + +WM_VIEWER_GET_MAIN_HWND + wParam - 0 + lParam - 0 + Returned value - (HWND)Main window handle + Function: + Acquire the main window handle. + +WM_VIEWER_GET_SELECTION + wParam - 0 + lParam - 0 + Returned value - (DATA_INFO *) Selected item information from the viewer + Function: + Acquire the selected item information from the viewer. + If the viewer isn’t displayed or a previously stored item isn’t selected then return NULL. + +WM_VIEWER_SELECT_ITEM + wParam - 0 + lParam - (DATA_INFO *) Select item information + Returned value - (BOOL) TRUE - Selected, FALSE – Couldn’t select + Function: + Make the item a selected condition using the viewer. diff --git a/CLCLPlugin/CLCLPlugin.h b/CLCLPlugin/CLCLPlugin.h index 4dd585a..343eadc 100644 --- a/CLCLPlugin/CLCLPlugin.h +++ b/CLCLPlugin/CLCLPlugin.h @@ -75,30 +75,33 @@ #define TYPE_ROOT 3 // ƒc[ƒ‹‚đŽŔs‚ˇ‚éƒ^ƒCƒ~ƒ“ƒO -#define CALLTYPE_MENU 1 // “Žěƒƒjƒ…[ -#define CALLTYPE_VIEWER 2 // ƒrƒ…[ƒA‚Ěƒƒjƒ…[ -#define CALLTYPE_VIEWER_OPEN 4 // ƒrƒ…[ƒA‚đŠJ‚˘‚˝Žž -#define CALLTYPE_VIEWER_CLOSE 8 // ƒrƒ…[ƒA‚đ•‚ś‚鎞 -#define CALLTYPE_ADD_HISTORY 16 // ƒf[ƒ^‚Ş—š—đ‚ɒljÁ‚ł‚ę‚鎞 -#define CALLTYPE_ITEM_TO_CLIPBOARD 32 // ƒf[ƒ^‚đƒNƒŠƒbƒvƒ{[ƒh‚É‘—‚鎞 -#define CALLTYPE_START 64 // ‹N“ŽŽž -#define CALLTYPE_END 128 // I—šŽž +// When to run the tool +#define CALLTYPE_MENU 1 // “Žěƒƒjƒ…[ / Operation menu +#define CALLTYPE_VIEWER 2 // ƒrƒ…[ƒA‚Ěƒƒjƒ…[ / Viewer menu +#define CALLTYPE_VIEWER_OPEN 4 // ƒrƒ…[ƒA‚đŠJ‚˘‚˝Žž / when viewer is opened +#define CALLTYPE_VIEWER_CLOSE 8 // ƒrƒ…[ƒA‚đ•‚ś‚鎞 / when viewer is closed +#define CALLTYPE_ADD_HISTORY 16 // ƒf[ƒ^‚Ş—š—đ‚ɒljÁ‚ł‚ę‚鎞 / when data is added to history +#define CALLTYPE_ITEM_TO_CLIPBOARD 32 // ƒf[ƒ^‚đƒNƒŠƒbƒvƒ{[ƒh‚É‘—‚鎞 / when sending data to the clipboard +#define CALLTYPE_START 64 // ‹N“ŽŽž / at startup +#define CALLTYPE_END 128 // I—šŽž / when finished // option only -#define CALLTYPE_MENU_COPY_PASTE 256 // ƒRƒs[‚Ć“\‚č•t‚Ż‚đ‘—‚é +#define CALLTYPE_MENU_COPY_PASTE 256 // ƒRƒs[‚Ć“\‚č•t‚Ż‚đ‘—‚é / send copy and paste // execute only -#define CALLTYPE_HISTORY 512 // —š—đ‚Š‚ç‚ĚŒÄ‚Ńo‚ľ -#define CALLTYPE_REGIST 1024 // “o˜^ƒAƒCƒeƒ€‚Š‚ç‚ĚŒÄ‚Ńo‚ľ +#define CALLTYPE_HISTORY 512 // —š—đ‚Š‚ç‚ĚŒÄ‚Ńo‚ľ / call from history +#define CALLTYPE_REGIST 1024 // “o˜^ƒAƒCƒeƒ€‚Š‚ç‚ĚŒÄ‚Ńo‚ľ / call from registered item // ƒc[ƒ‹–ß‚č’l -#define TOOL_ERROR 0 // ƒc[ƒ‹‚ĚƒGƒ‰[ -#define TOOL_SUCCEED 1 // ƒc[ƒ‹‚̐łíI—š -#define TOOL_CANCEL 2 // ˆČ~‚̏ˆ—‚đƒLƒƒƒ“ƒZƒ‹ -#define TOOL_DATA_MODIFIED 4 // ƒf[ƒ^•ύX‚ ‚č +// tool return value +#define TOOL_ERROR 0 // ƒc[ƒ‹‚ĚƒGƒ‰[ / tool error +#define TOOL_SUCCEED 1 // ƒc[ƒ‹‚̐łíI—š / tool successfully completed +#define TOOL_CANCEL 2 // ˆČ~‚̏ˆ—‚đƒLƒƒƒ“ƒZƒ‹ / cancel further processing +#define TOOL_DATA_MODIFIED 4 // ƒf[ƒ^•ύX‚ ‚č / data changed /* Struct */ // Œ`ŽŽŽć“žî•ń +// Format acquisition information typedef struct _FORMAT_GET_INFO { - DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY + DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY / Structure size TCHAR format_name[BUF_SIZE]; TCHAR func_header[BUF_SIZE]; @@ -106,8 +109,9 @@ typedef struct _FORMAT_GET_INFO { } FORMAT_GET_INFO; // ƒc[ƒ‹Žć“žî•ń +// Tool acquisition information typedef struct _TOOL_GET_INFO { - DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY + DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY / Structure size TCHAR title[BUF_SIZE]; TCHAR func_name[BUF_SIZE]; @@ -116,61 +120,65 @@ typedef struct _TOOL_GET_INFO { } TOOL_GET_INFO; // ƒc[ƒ‹ŽŔsî•ń +// Tool execution information typedef struct _TOOL_EXEC_INFO { - DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY + DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY / Structure size int call_type; // CALLTYPE_ - TCHAR *cmd_line; // ƒc[ƒ‹Ý’č‚ĹŽw’肾‚˝ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ - LPARAM lParam; // ƒc[ƒ‹‚ɑΉž‚ˇ‚élong’l + TCHAR *cmd_line; // ƒc[ƒ‹Ý’č‚ĹŽw’肾‚˝ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ / Command line specified in tool settings + LPARAM lParam; // ƒc[ƒ‹‚ɑΉž‚ˇ‚élong’l / long value corresponding to the tool } TOOL_EXEC_INFO; // ƒAƒCƒeƒ€î•ń +// Item information typedef struct _DATA_INFO { - DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY + DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY / Structure size int type; // TYPE_ - TCHAR *title; // ƒ^ƒCƒgƒ‹ + TCHAR *title; // ƒ^ƒCƒgƒ‹ / title - TCHAR *format_name; // Œ`ŽŽ–ź - int format_name_hash; // Œ`ŽŽ–ź‚ĚƒnƒbƒVƒ… - UINT format; // Œ`ŽŽ’l + TCHAR *format_name; // Œ`ŽŽ–ź / Format name + int format_name_hash; // Œ`ŽŽ–ź‚ĚƒnƒbƒVƒ… / format name hash + UINT format; // Œ`ŽŽ’l / Format value - HANDLE data; // ƒf[ƒ^ - DWORD size; // ƒTƒCƒY + HANDLE data; // ƒf[ƒ^ / data + DWORD size; // ƒTƒCƒY / size - FILETIME modified; // XV“úŽž - TCHAR *window_name; // ƒRƒs[‚ľ‚˝ƒEƒBƒ“ƒhƒEƒ^ƒCƒgƒ‹ + FILETIME modified; // XV“úŽž / Update date and time + TCHAR *window_name; // ƒRƒs[‚ľ‚˝ƒEƒBƒ“ƒhƒEƒ^ƒCƒgƒ‹ / Copied window title - TCHAR *plugin_string; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ + TCHAR *plugin_string; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ / Data for plugins LPARAM plugin_param; // ˆČ‰ş•Ű‘ś‚ľ‚Č‚˘î•ń - TCHAR *menu_title; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒ^ƒCƒgƒ‹ (–˘Ý’č‚Ěę‡‚ÍŒ`ŽŽ‚đ•\ŽŚ) - BOOL free_title; // ƒ^ƒCƒgƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ - HICON menu_icon; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹ - BOOL free_icon; // ƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ - HBITMAP menu_bitmap; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv - BOOL free_bitmap; // ƒrƒbƒgƒ}ƒbƒvƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ - int menu_bmp_width; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv‚ĚŒÂ•ĘƒTƒCƒY +// Information not saved below + TCHAR *menu_title; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒ^ƒCƒgƒ‹ (–˘Ý’č‚Ěę‡‚ÍŒ`ŽŽ‚đ•\ŽŚ) / Title to display on menu (if not set, display format) + BOOL free_title; // ƒ^ƒCƒgƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ / Title TRUE-Release, FALSE-Do not release + HICON menu_icon; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹ / Icon handle to display in menu + BOOL free_icon; // ƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ / TRUE - release the icon handle, FALSE - do not release the icon handle + HBITMAP menu_bitmap; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv / Bitmap to display in menu + BOOL free_bitmap; // ƒrƒbƒgƒ}ƒbƒvƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ / TRUE - release bitmap handle, FALSE - do not release + int menu_bmp_width; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv‚ĚŒÂ•ĘƒTƒCƒY / Individual size of bitmap displayed in menu int menu_bmp_height; - LPARAM param1; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ + LPARAM param1; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ / Data for plugins LPARAM param2; struct _DATA_INFO *child; struct _DATA_INFO *next; // Ver 1.0.5 - int hkey_id; // ƒzƒbƒgƒL[ + int hkey_id; // ƒzƒbƒgƒL[ / hotkey UINT op_modifiers; UINT op_virtkey; int op_paste; } DATA_INFO; // ƒc[ƒ‹—pƒAƒCƒeƒ€î•ń +// Tool item information typedef struct _TOOL_DATA_INFO { - DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY + DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY / Structure size - struct _DATA_INFO *di; // ƒAƒCƒeƒ€î•ń + struct _DATA_INFO *di; // ƒAƒCƒeƒ€î•ń / Item information struct _TOOL_DATA_INFO *child; struct _TOOL_DATA_INFO *next; diff --git a/Data.c b/Data.c index a44d0c2..3da3eb8 100644 --- a/Data.c +++ b/Data.c @@ -25,19 +25,21 @@ /* Define */ /* Global Variables */ -// ƒIƒvƒVƒ‡ƒ“ +// オプション extern OPTION_INFO option; /* Local Function Prototypes */ /* - * data_create_data - ƒf[ƒ^‚̍쐬 + * data_create_data - データの作成 + * Create data */ DATA_INFO *data_create_data(const UINT format, TCHAR *format_name, const HANDLE data, const DWORD size, const BOOL init, TCHAR *err_str) { DATA_INFO *new_item; - // ƒAƒCƒeƒ€‚ĚŠm•Ű + // アイテムの確保 + // Allocate item if ((new_item = (DATA_INFO *)mem_calloc(sizeof(DATA_INFO))) == NULL) { message_get_error(GetLastError(), err_str); return NULL; @@ -54,13 +56,15 @@ DATA_INFO *data_create_data(const UINT format, TCHAR *format_name, const HANDLE } /* - * data_create_item - ƒAƒCƒeƒ€‚̍쐬 + * data_create_item - アイテムの作成 + * Create an item */ DATA_INFO *data_create_item(const TCHAR *title, const BOOL set_date, TCHAR *err_str) { DATA_INFO *new_item; - // ƒAƒCƒeƒ€‚ĚŠm•Ű + // アイテムの確保 + // Allocate item if ((new_item = (DATA_INFO *)mem_calloc(sizeof(DATA_INFO))) == NULL) { message_get_error(GetLastError(), err_str); return NULL; @@ -75,13 +79,14 @@ DATA_INFO *data_create_item(const TCHAR *title, const BOOL set_date, TCHAR *err_ } /* - * data_create_folder - ƒtƒHƒ‹ƒ_‚̍쐬 + * data_create_folder - フォルダの作成 + * Create a folder */ DATA_INFO *data_create_folder(const TCHAR *title, TCHAR *err_str) { DATA_INFO *new_item; - // ƒAƒCƒeƒ€‚ĚŠm•Ű + // アイテムの確保 if ((new_item = (DATA_INFO *)mem_calloc(sizeof(DATA_INFO))) == NULL) { message_get_error(GetLastError(), err_str); return NULL; @@ -93,7 +98,8 @@ DATA_INFO *data_create_folder(const TCHAR *title, TCHAR *err_str) } /* - * data_item_copy - ƒAƒCƒeƒ€‚ĚƒRƒs[‚đěŹ + * data_item_copy - アイテムのコピーを作成 + * Create a copy of an item */ DATA_INFO *data_item_copy(const DATA_INFO *di, const BOOL next_copy, const BOOL move_flag, TCHAR *err_str) { @@ -123,17 +129,20 @@ DATA_INFO *data_item_copy(const DATA_INFO *di, const BOOL next_copy, const BOOL new_di->op_virtkey = di->op_virtkey; new_di->op_paste = di->op_paste; } - // ƒf[ƒ^‚ĚƒRƒs[ + // データのコピー + // copy data if (di->data != NULL && (new_di->data = format_copy_data(di->format_name, di->data, &new_di->size)) == NULL) { new_di->data = clipboard_copy_data(di->format, di->data, &new_di->size); } - // ŽqƒAƒCƒeƒ€‚ĚƒRƒs[ + // 子アイテムのコピー + // copy child item if (di->child != NULL && (new_di->child = data_item_copy(di->child, TRUE, move_flag, err_str)) == NULL) { data_free(new_di); return NULL; } - // ŽŸƒAƒCƒeƒ€‚ĚƒRƒs[ + // 次アイテムのコピー + // copy next item if (next_copy == TRUE && di->next != NULL && (new_di->next = data_item_copy(di->next, TRUE, move_flag, err_str)) == NULL) { data_free(new_di); @@ -143,7 +152,8 @@ DATA_INFO *data_item_copy(const DATA_INFO *di, const BOOL next_copy, const BOOL } /* - * data_delete - ƒAƒCƒeƒ€‚Ěíœ + * data_delete - アイテムの削除 + * Delete an item */ BOOL data_delete(DATA_INFO **root, DATA_INFO *del_di, const BOOL free_item) { @@ -162,7 +172,8 @@ BOOL data_delete(DATA_INFO **root, DATA_INFO *del_di, const BOOL free_item) } for (di = *root; di != NULL; di = di->next) { if (di->next == del_di) { - // íœ + // 削除 + // delete di->next = del_di->next; del_di->next = NULL; if (free_item == TRUE) { @@ -178,7 +189,7 @@ BOOL data_delete(DATA_INFO **root, DATA_INFO *del_di, const BOOL free_item) } /* - * data_adjust - ƒAƒCƒeƒ€‚ĚŽ— + * data_adjust - アイテムの整理 */ void data_adjust(DATA_INFO **root) { @@ -188,7 +199,8 @@ void data_adjust(DATA_INFO **root) while (di != NULL) { if (di->type == TYPE_ITEM && di->child == NULL) { wk_di = di->next; - // íœ + // 削除 + // delete data_delete(root, di, TRUE); di = wk_di; } else { @@ -201,25 +213,29 @@ void data_adjust(DATA_INFO **root) } /* - * data_menu_free - ƒAƒCƒeƒ€‚ÉŠÖ˜A•t‚Ż‚ç‚ę‚˝ƒƒjƒ…[î•ń‚đ‰đ•ú + * data_menu_free - アイテムに関連付けられたメニュー情報を解放 + * Releases the menu information associated with the item. */ void data_menu_free_item(DATA_INFO *di) { - // ƒeƒLƒXƒg‚̉đ•ú + // テキストの解放 + // text release if (di->free_title == TRUE) { mem_free(&di->menu_title); } di->menu_title = NULL; di->free_title = FALSE; - // ƒAƒCƒRƒ“‚̉đ•ú + // アイコンの解放 + // release icon if (di->free_icon == TRUE && di->menu_icon != NULL) { DestroyIcon(di->menu_icon); } di->menu_icon = NULL; di->free_icon = FALSE; - // ƒrƒbƒgƒ}ƒbƒv‚̉đ•ú + // ビットマップの解放 + // free the bitmap if (di->free_bitmap == TRUE && di->menu_bitmap != NULL) { DeleteObject((HGDIOBJ)di->menu_bitmap); } @@ -239,7 +255,8 @@ void data_menu_free(DATA_INFO *di) } /* - * data_free - ƒAƒCƒeƒ€‚̉đ•ú + * data_free - アイテムの解放 + * Release items. */ void data_free(DATA_INFO *di) { @@ -268,7 +285,8 @@ void data_free(DATA_INFO *di) } /* - * data_check - ƒAƒCƒeƒ€‚Ě‘śÝƒ`ƒFƒbƒN + * data_check - アイテムの存在チェック + * Check for existence of item. */ DATA_INFO *data_check(DATA_INFO *di, const DATA_INFO *check_di) { @@ -290,7 +308,8 @@ DATA_INFO *data_check(DATA_INFO *di, const DATA_INFO *check_di) } /* - * data_set_modified - XV“úŽž‚đÝ’č + * data_set_modified - 更新日時を設定 + * Set update date and time. */ void data_set_modified(DATA_INFO *di) { @@ -305,7 +324,8 @@ void data_set_modified(DATA_INFO *di) } /* - * data_get_modified_string - XV“úŽž•śŽš—ń‚đŽć“ž + * data_get_modified_string - 更新日時文字列を取得 + * Get the updated date string. */ BOOL data_get_modified_string(const DATA_INFO *di, TCHAR *ret) { @@ -318,18 +338,21 @@ BOOL data_get_modified_string(const DATA_INFO *di, TCHAR *ret) *ret = TEXT('\0'); return FALSE; } - // ƒtƒ@ƒCƒ‹ƒ^ƒCƒ€‚đƒVƒXƒeƒ€ƒ^ƒCƒ€‚ɕϊˇ + // ファイルタイムをシステムタイムに変換 + // Convert file time to system time if (FileTimeToSystemTime(&di->modified, &sys_time) == FALSE) { *ret = TEXT('\0'); return FALSE; } - // “ú•t•śŽš—ń‚̎擞 + // 日付文字列の取得 + // Get date string p = option.data_date_format; if (p == NULL || *p == TEXT('\0')) { p = NULL; } GetDateFormat(0, 0, &sys_time, p, str_day, BUF_SIZE - 1); - // ŽžŠÔ•śŽš—ń‚̎擞 + // 時間文字列の取得 + // Get time string p = option.data_time_format; if (p == NULL || *p == TEXT('\0')) { p = NULL; @@ -341,7 +364,8 @@ BOOL data_get_modified_string(const DATA_INFO *di, TCHAR *ret) } /* - * data_get_title - ƒAƒCƒeƒ€‚Ěƒ^ƒCƒgƒ‹‚đŽć“ž + * data_get_title - アイテムのタイトルを取得 + * Get the title of the item */ TCHAR *data_get_title(DATA_INFO *di) { diff --git a/Data.h b/Data.h index 1ca3808..34aad2e 100644 --- a/Data.h +++ b/Data.h @@ -22,42 +22,44 @@ /* Struct */ // ƒAƒCƒeƒ€î•ń +// Item information typedef struct _DATA_INFO { - DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY + DWORD struct_size; // \‘˘‘Ě‚ĚƒTƒCƒY / Structure size int type; // TYPE_ - TCHAR *title; // ƒ^ƒCƒgƒ‹ + TCHAR *title; // ƒ^ƒCƒgƒ‹ / title - TCHAR *format_name; // Œ`ŽŽ–ź - int format_name_hash; // Œ`ŽŽ–ź‚ĚƒnƒbƒVƒ… - UINT format; // Œ`ŽŽ’l + TCHAR *format_name; // Œ`ŽŽ–ź / format name + int format_name_hash; // Œ`ŽŽ–ź‚ĚƒnƒbƒVƒ… / format name hash + UINT format; // Œ`ŽŽ’l / format value - HANDLE data; // ƒf[ƒ^ - DWORD size; // ƒTƒCƒY + HANDLE data; // ƒf[ƒ^ / data + DWORD size; // ƒTƒCƒY / size - FILETIME modified; // XV“úŽž - TCHAR *window_name; // ƒRƒs[‚ľ‚˝ƒEƒBƒ“ƒhƒEƒ^ƒCƒgƒ‹ + FILETIME modified; // XV“úŽž / timestamp of last update + TCHAR *window_name; // ƒRƒs[‚ľ‚˝ƒEƒBƒ“ƒhƒEƒ^ƒCƒgƒ‹ / copy of window title - TCHAR *plugin_string; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ + TCHAR *plugin_string; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ / data for plugins LPARAM plugin_param; // ˆČ‰ş•Ű‘ś‚ľ‚Č‚˘î•ń - TCHAR *menu_title; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒ^ƒCƒgƒ‹ (–˘Ý’č‚Ěę‡‚ÍŒ`ŽŽ‚đ•\ŽŚ) - BOOL free_title; // ƒ^ƒCƒgƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ - HICON menu_icon; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹ - BOOL free_icon; // ƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ - HBITMAP menu_bitmap; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv - BOOL free_bitmap; // ƒrƒbƒgƒ}ƒbƒvƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ - int menu_bmp_width; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv‚ĚŒÂ•ĘƒTƒCƒY +// not persistent Information below + TCHAR *menu_title; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒ^ƒCƒgƒ‹ (–˘Ý’č‚Ěę‡‚ÍŒ`ŽŽ‚đ•\ŽŚ) / title to display on menu (if not set, display format) + BOOL free_title; // ƒ^ƒCƒgƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ / title TRUE: release, FALSE: do not release + HICON menu_icon; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹ / icon handle to display in menu + BOOL free_icon; // ƒAƒCƒRƒ“ƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ / TRUE: release the icon handle, FALSE: do not release the icon handle + HBITMAP menu_bitmap; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv / bitmap to display in menu + BOOL free_bitmap; // ƒrƒbƒgƒ}ƒbƒvƒnƒ“ƒhƒ‹‚đ TRUE-‰đ•ú‚ˇ‚é FALSE-‰đ•ú‚ľ‚Č‚˘ / TRUE: release bitmap handle, FALSE: do not release + int menu_bmp_width; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv‚ĚŒÂ•ĘƒTƒCƒY / individual size of bitmap displayed in menu int menu_bmp_height; - LPARAM param1; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ + LPARAM param1; // ƒvƒ‰ƒOƒCƒ“—pƒf[ƒ^ / data for plugins LPARAM param2; struct _DATA_INFO *child; struct _DATA_INFO *next; // Ver 1.0.5 - int hkey_id; // ƒzƒbƒgƒL[ + int hkey_id; // ƒzƒbƒgƒL[ / hotkey UINT op_modifiers; UINT op_virtkey; int op_paste; diff --git a/Memory.c b/Memory.c index c0238b0..d162da5 100644 --- a/Memory.c +++ b/Memory.c @@ -59,7 +59,7 @@ void *mem_alloc(const DWORD size) } /* - * mem_calloc - ‰Šú‰ť‚ľ‚ăoƒbƒtƒ@‚đŠm•Ű + * mem_calloc - ‰Šú‰ť‚ľ‚ăoƒbƒtƒ@‚đŠm•Ű / initialize and secure buffer */ void *mem_calloc(const DWORD size) { @@ -85,7 +85,7 @@ void *mem_calloc(const DWORD size) } /* - * mem_free - ƒoƒbƒtƒ@‚đ‰đ•ú + * mem_free - ƒoƒbƒtƒ@‚đ‰đ•ú / free buffer */ void mem_free(void **mem) { @@ -111,7 +111,7 @@ void mem_free(void **mem) } /* - * mem_debug - ƒƒ‚ƒŠî•ń‚Ě•\ŽŚ + * mem_debug - ƒƒ‚ƒŠî•ń‚Ě•\ŽŚ / show memory information */ #ifdef _DEBUG void mem_debug(void) @@ -141,7 +141,7 @@ void mem_debug(void) #endif // _DEBUG /* - * mem_cmp - ƒƒ‚ƒŠ‚Ě”äŠr + * mem_cmp - ƒƒ‚ƒŠ‚Ě”äŠr / compare memory */ int mem_cmp(const BYTE *mem1, const DWORD size1, const BYTE *mem2, const DWORD size2) { @@ -152,7 +152,7 @@ int mem_cmp(const BYTE *mem1, const DWORD size1, const BYTE *mem2, const DWORD s } /* - * alloc_copy - ƒoƒbƒtƒ@‚đŠm•Ű‚ľ‚Ä•śŽš—ń‚đƒRƒs[‚ˇ‚é + * alloc_copy - ƒoƒbƒtƒ@‚đŠm•Ű‚ľ‚Ä•śŽš—ń‚đƒRƒs[‚ˇ‚é / allocate buffer and copy the string */ TCHAR *alloc_copy(const TCHAR *buf) { @@ -169,7 +169,7 @@ TCHAR *alloc_copy(const TCHAR *buf) } /* - * alloc_copy_n - ƒoƒbƒtƒ@‚đŠm•Ű‚ľ‚ÄŽw’č’ˇ‚ł•Ş‚Ě•śŽš—ń‚đƒRƒs[‚ˇ‚é + * alloc_copy_n - ƒoƒbƒtƒ@‚đŠm•Ű‚ľ‚ÄŽw’č’ˇ‚ł•Ş‚Ě•śŽš—ń‚đƒRƒs[‚ˇ‚é / allocate buffer and copy string of specified length */ TCHAR *alloc_copy_n(const TCHAR *buf, const int size) { @@ -204,7 +204,7 @@ char *alloc_tchar_to_char(const TCHAR *str) #endif /* - * alloc_char_to_tchar - ƒƒ‚ƒŠ‚đŠm•Ű‚ľ‚Ä char ‚đ TCHAR ‚ɕϊˇ‚ˇ‚é + * alloc_char_to_tchar - ƒƒ‚ƒŠ‚đŠm•Ű‚ľ‚Ä char ‚đ TCHAR ‚ɕϊˇ‚ˇ‚é / allocate memory and convert char to TCHAR */ #ifdef UNICODE TCHAR *alloc_char_to_tchar(const char *str) diff --git a/Menu.c b/Menu.c index fc704f3..b30239c 100644 --- a/Menu.c +++ b/Menu.c @@ -41,7 +41,7 @@ extern HINSTANCE hInst; extern HICON icon_menu_default; extern HICON icon_menu_folder; -// ƒIƒvƒVƒ‡ƒ“ +// オプション extern OPTION_INFO option; /* Local Function Prototypes */ @@ -62,7 +62,7 @@ static BOOL menu_draw_ckeck(const HDC draw_dc, const int left, const int top, co static TCHAR menu_get_accelerator(TCHAR *str); /* - * menu_item_free - ƒƒjƒ…[î•ń‚̉đ•ú + * menu_item_free - メニュー情報の解放 */ static void menu_item_free(MENU_ITEM_INFO *mii, int cnt) { @@ -85,7 +85,7 @@ static void menu_item_free(MENU_ITEM_INFO *mii, int cnt) } /* - * menu_free - ƒƒjƒ…[î•ń‚̉đ•ú + * menu_free - メニュー情報の解放 */ void menu_free(void) { @@ -95,7 +95,7 @@ void menu_free(void) } /* - * menu_show - ƒ}ƒEƒX‚ĚˆĘ’u‚Ƀƒjƒ…[‚đ•\ŽŚ‚ˇ‚é + * menu_show - マウスの位置にメニューを表示する */ int menu_show(const HWND hWnd, const HMENU hMenu, const POINT *mpos) { @@ -121,7 +121,7 @@ int menu_show(const HWND hWnd, const HMENU hMenu, const POINT *mpos) } /* - * menu_id_to_menuitem - ƒƒjƒ…[ID‚Š‚çƒƒjƒ…[î•ń‚đŒŸő + * menu_id_to_menuitem - メニューIDからメニュー情報を検索 */ static MENU_ITEM_INFO *menu_id_to_menuitem(MENU_ITEM_INFO *mii, const int mcnt, const UINT id) { @@ -146,7 +146,7 @@ static MENU_ITEM_INFO *menu_id_to_menuitem(MENU_ITEM_INFO *mii, const int mcnt, } /* - * menu_get_info - ƒƒjƒ…[ID‚Š‚çƒƒjƒ…[î•ń‚đŽć“ž + * menu_get_info - メニューIDからメニュー情報を取得 */ MENU_ITEM_INFO *menu_get_info(const UINT id) { @@ -154,7 +154,7 @@ MENU_ITEM_INFO *menu_get_info(const UINT id) } /* - * menu_read_icon - ƒAƒCƒRƒ“Žć“ž + * menu_read_icon - アイコン取得 */ static HICON menu_read_icon(const TCHAR *file_name, const int index, const int icon_size) { @@ -166,7 +166,7 @@ static HICON menu_read_icon(const TCHAR *file_name, const int index, const int i if (file_name == NULL || *file_name == TEXT('\0')) { return NULL; } - // ƒtƒ@ƒCƒ‹‚Š‚çƒAƒCƒRƒ“Žć“ž + // ファイルからアイコン取得 ExtractIconEx(file_name, index, &hIcon, &hsIcon, 1); if (icon_size >= LICONSIZE) { DestroyIcon(hsIcon); @@ -175,7 +175,8 @@ static HICON menu_read_icon(const TCHAR *file_name, const int index, const int i hIcon = hsIcon; } if (hIcon == NULL) { - // ŠÖ˜A•t‚݂ЂçƒAƒCƒRƒ“Žć“ž + // 関連付けからアイコン取得 + // get icon from file association icon_flag = SHGFI_ICON | ((icon_size == SICONSIZE) ? SHGFI_SMALLICON : SHGFI_LARGEICON); SHGetFileInfo(file_name, SHGFI_USEFILEATTRIBUTES, &shfi, sizeof(SHFILEINFO), icon_flag); hIcon = shfi.hIcon; @@ -184,7 +185,7 @@ static HICON menu_read_icon(const TCHAR *file_name, const int index, const int i } /* - * menu_create_font - ƒƒjƒ…[—pƒtƒHƒ“ƒg‚̍쐬 + * menu_create_font - メニュー用フォントの作成 */ static HFONT menu_create_font(void) { @@ -204,7 +205,7 @@ static HFONT menu_create_font(void) } /* - * menu_get_item_size - ƒI[ƒi[ƒhƒ[ƒƒjƒ…[€–Ú‚ĚƒTƒCƒY‚đŽć“ž + * menu_get_item_size - オーナードローメニュー項目のサイズを取得 */ static int menu_get_item_size(const MENU_ITEM_INFO *mii, int *width) { @@ -216,12 +217,12 @@ static int menu_get_item_size(const MENU_ITEM_INFO *mii, int *width) text_y = mii->text_y; if (mii->flag & MF_SEPARATOR) { - // ‹ćŘ‚č + // 区切り ret_x = 0; ret_y = option.menu_separator_height; } else if (option.menu_show_icon != 1) { - // ƒeƒLƒXƒg‚Ě‚Ý + // テキストのみ text_x += (option.menu_icon_margin + option.menu_icon_size + option.menu_text_margin_left + option.menu_text_margin_right); ret_x = (text_x > option.menu_max_width) ? option.menu_max_width : text_x; @@ -229,7 +230,7 @@ static int menu_get_item_size(const MENU_ITEM_INFO *mii, int *width) ret_y = text_y; } else if (mii->show_bitmap == TRUE) { - // ƒrƒbƒgƒ}ƒbƒv•\ŽŚ + // ビットマップ表示 if (mii->show_di->menu_bmp_width == 0 && mii->show_di->menu_bmp_height == 0) { bmp_x = option.menu_bitmap_width; bmp_y = option.menu_bitmap_height; @@ -245,7 +246,7 @@ static int menu_get_item_size(const MENU_ITEM_INFO *mii, int *width) ? bmp_y + (option.menu_icon_margin * 2) : text_y; } else { - // ƒAƒCƒRƒ“•\ŽŚ + // アイコン表示 text_x += (option.menu_icon_margin + option.menu_icon_size + option.menu_text_margin_left + option.menu_text_margin_right); ret_x = (text_x > option.menu_max_width) ? option.menu_max_width : text_x; @@ -260,7 +261,7 @@ static int menu_get_item_size(const MENU_ITEM_INFO *mii, int *width) } /* - * menu_create_text - ƒAƒNƒZƒ‰ƒŒ[ƒ^•t‚Ť•śŽš•śŽš—ń‚̍쐬 + * menu_create_text - アクセラレータ付き文字文字列の作成 */ static void menu_create_text(const int index, const TCHAR *buf, TCHAR *ret) { @@ -292,7 +293,7 @@ static void menu_create_text(const int index, const TCHAR *buf, TCHAR *ret) r = p; p++; - // ƒx[ƒX’l + // ベース値 if (*p >= TEXT('0') && *p <= TEXT('9')) { base = _ttoi(p); for (; *p >= TEXT('0') && *p <= TEXT('9'); p++) @@ -305,20 +306,20 @@ static void menu_create_text(const int index, const TCHAR *buf, TCHAR *ret) switch (*p) { case TEXT('d'): case TEXT('D'): - // ”Žš (10i”) + // 数字 (10進数) _itot_s(num, ret, BUF_SIZE, 10); ret += lstrlen(ret); break; case TEXT('x'): - // ”Žš (16i”) (Ź•śŽš) + // 数字 (16進数) (小文字) _itot_s(num, ret, BUF_SIZE, 16); CharLower(ret); ret += lstrlen(ret); break; case TEXT('X'): - // ”Žš (16i”) + // 数字 (16進数) _itot_s(num, ret, BUF_SIZE, 16); CharUpper(ret); ret += lstrlen(ret); @@ -326,47 +327,47 @@ static void menu_create_text(const int index, const TCHAR *buf, TCHAR *ret) case TEXT('n'): case TEXT('N'): - // ‚PŒ…‚̐”Žš + // 1桁の数字 *(ret++) = TEXT('0') + num % 10; break; case TEXT('a'): - // ƒAƒ‹ƒtƒ@ƒxƒbƒg (Ź•śŽš) + // アルファベット (小文字) *(ret++) = TEXT('a') + num % 26; break; case TEXT('A'): - // ƒAƒ‹ƒtƒ@ƒxƒbƒg + // アルファベット *(ret++) = TEXT('A') + num % 26; break; case TEXT('b'): - // ƒAƒ‹ƒtƒ@ƒxƒbƒg + ”Žš (Ź•śŽš) + // アルファベット + 数字 (小文字) i = num % (26 + 10); *(ret++) = (i < 26) ? TEXT('a') + i : TEXT('0') + i - 26; break; case TEXT('B'): - // ƒAƒ‹ƒtƒ@ƒxƒbƒg + ”Žš + // アルファベット + 数字 i = num % (26 + 10); *(ret++) = (i < 26) ? TEXT('A') + i : TEXT('0') + i - 26; break; case TEXT('c'): - // ”Žš + ƒAƒ‹ƒtƒ@ƒxƒbƒg (Ź•śŽš) + // 数字 + アルファベット (小文字) i = num % (26 + 10); *(ret++) = (i < 10) ? TEXT('0') + i : TEXT('a') + i - 10; break; case TEXT('C'): - // ”Žš + ƒAƒ‹ƒtƒ@ƒxƒbƒg + // 数字 + アルファベット i = num % (26 + 10); *(ret++) = (i < 10) ? TEXT('0') + i : TEXT('A') + i - 10; break; case TEXT('t'): case TEXT('T'): - // ƒ^ƒCƒgƒ‹ + // タイトル lstrcpyn(ret, buf, BUF_SIZE); ret += lstrlen(ret); break; @@ -391,7 +392,7 @@ static void menu_create_text(const int index, const TCHAR *buf, TCHAR *ret) } /* - * menu_get_keyname - ƒL[–ź‚đŽć“ž + * menu_get_keyname - キー名を取得 */ TCHAR *menu_get_keyname(const UINT modifiers, const UINT virtkey) { @@ -413,7 +414,7 @@ TCHAR *menu_get_keyname(const UINT modifiers, const UINT virtkey) lstrcat(buf, TEXT("Win+")); } if (virtkey == 0 || (scan_code = MapVirtualKey(virtkey, 0)) <= 0) { - // ‚Č‚ľ + // なし return NULL; } if (virtkey == VK_APPS || @@ -435,7 +436,7 @@ TCHAR *menu_get_keyname(const UINT modifiers, const UINT virtkey) } /* - * menu_create_datainfo - ƒƒjƒ…[î•ń‚Ƀf[ƒ^‚đ“WŠJ + * menu_create_datainfo - メニュー情報にデータを展開 */ static BOOL menu_create_datainfo(DATA_INFO *set_di, MENU_ITEM_INFO *mii, int menu_index, int *id, @@ -451,16 +452,16 @@ static BOOL menu_create_datainfo(DATA_INFO *set_di, int i, j; int m, n; - // ‰ŠúˆĘ’uˆÚ“Ž + // 初期位置移動 for (m = 0; set_di != NULL && min > 0 && m < min - 1; set_di = set_di->next, m++) ; if (step < 0) { - // ~‡ + // 降順 for (di = set_di, i = 0, n = m; di != NULL && (max <= 0 || n < max); di = di->next, i++, n++) ; i += menu_index - 1; } else { - // ¸‡ + // 昇順 i = menu_index; } @@ -471,13 +472,13 @@ static BOOL menu_create_datainfo(DATA_INFO *set_di, switch (di->type) { case TYPE_FOLDER: - // ŠK‘w•\ŽŚ + // 階層表示 (mii + i)->flag = MF_POPUP | MF_OWNERDRAW; (mii + i)->show_di = di; for (cdi = di->child, cnt = 0; cdi != NULL; cdi = cdi->next, cnt++) ; - // ƒƒjƒ…[€–ڏî•ń‚ĚŠm•Ű + // メニュー項目情報の確保 if ((cmi = mem_calloc(sizeof(MENU_ITEM_INFO) * cnt)) == NULL) { return FALSE; } @@ -487,24 +488,24 @@ static BOOL menu_create_datainfo(DATA_INFO *set_di, break; case TYPE_ITEM: - // ƒAƒCƒeƒ€ + // アイテム (mii + i)->flag = MF_OWNERDRAW; (mii + i)->show_di = format_get_priority_highest(di); break; case TYPE_DATA: - // ƒf[ƒ^ + // データ (mii + i)->flag = MF_OWNERDRAW; (mii + i)->show_di = di; break; } - // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒ^ƒCƒgƒ‹‚đŽć“ž + // メニューに表示するタイトルを取得 format_get_menu_title((mii + i)->show_di); - // ƒ^ƒCƒgƒ‹‚đÝ’č + // タイトルを設定 if (di->title != NULL) { if (lstrcmp(di->title, TEXT("-")) == 0) { - // ‹ćŘ‚č + // 区切り (mii + i)->id = 0; (mii + i)->flag = MF_SEPARATOR | MF_OWNERDRAW; (mii + i)->item = (LPCTSTR)(mii + i); @@ -521,7 +522,7 @@ static BOOL menu_create_datainfo(DATA_INFO *set_di, (mii + i)->text = alloc_copy(buf); } else if ((mii + i)->show_di->format_name != NULL) { - // Œ`ŽŽ–ź + // 形式名 p = tmp; *(p++) = TEXT('('); lstrcpyn(p, (mii + i)->show_di->format_name, BUF_SIZE - 3); @@ -537,12 +538,12 @@ static BOOL menu_create_datainfo(DATA_INFO *set_di, } if (option.menu_show_hotkey == 1) { - // ƒzƒbƒgƒL[Žć“ž + // ホットキー取得 (mii + i)->hkey = menu_get_keyname(di->op_modifiers, di->op_virtkey); } if (option.menu_show_icon == 1) { - // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“‚đŽć“ž + // メニューに表示するアイコンを取得 format_get_menu_icon((mii + i)->show_di); if ((mii + i)->show_di->menu_icon == NULL) { (mii + i)->icon = (di->type == TYPE_FOLDER) ? icon_menu_folder : icon_menu_default; @@ -551,7 +552,7 @@ static BOOL menu_create_datainfo(DATA_INFO *set_di, } (mii + i)->free_icon = FALSE; - // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv‚đŽć“ž + // メニューに表示するビットマップを取得 if (option.menu_show_bitmap == 1) { format_get_menu_bitmap((mii + i)->show_di); } @@ -563,7 +564,7 @@ static BOOL menu_create_datainfo(DATA_INFO *set_di, } /* - * menu_create_info - ƒƒjƒ…[î•ń‚̍쐬 + * menu_create_info - メニュー情報の作成 */ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt, DATA_INFO *history_di, DATA_INFO *regist_di, @@ -574,7 +575,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt int i, j, t; int cnt; - // ƒƒjƒ…[€–ڐ”‚̎擞 + // メニュー項目数の取得 for (i = 0, *ret_cnt = 0; i < menu_cnt; i++) { switch ((menu_info + i)->content) { case MENU_CONTENT_SEPARATOR: @@ -619,17 +620,17 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt } } - // ƒƒjƒ…[€–ڏî•ń‚ĚŠm•Ű + // メニュー項目情報の確保 if ((mii = mem_calloc(sizeof(MENU_ITEM_INFO) * (*ret_cnt))) == NULL) { *ret_cnt = 0; return NULL; } - // ƒƒjƒ…[€–ڏî•ń‚̍쐬 + // メニュー項目情報の作成 for (i = 0, j = 0; i < menu_cnt; i++) { switch ((menu_info + i)->content) { case MENU_CONTENT_SEPARATOR: - // ‹ćŘ‚č + // 区切り (mii + j)->id = 0; (mii + j)->flag = MF_SEPARATOR | MF_OWNERDRAW; (mii + j)->item = (LPCTSTR)(mii + j); @@ -637,7 +638,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_HISTORY: - // —š—đ (¸‡) + // 幼歴 (昇順) if (menu_create_datainfo(history_di, mii, j, id, 1, (menu_info + i)->min, (menu_info + i)->max) == TRUE) { for (di = history_di, cnt = 0; di != NULL && (menu_info + i)->min > 0 && cnt < (menu_info + i)->min - 1; di = di->next, cnt++); @@ -647,7 +648,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_HISTORY_DESC: - // —š—đ (~‡) + // 幼歴 (降順) if (menu_create_datainfo(history_di, mii, j, id, -1, (menu_info + i)->min, (menu_info + i)->max) == TRUE) { for (di = history_di, cnt = 0; di != NULL && (menu_info + i)->min > 0 && cnt < (menu_info + i)->min - 1; di = di->next, cnt++) @@ -659,7 +660,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_REGIST: - // “o˜^ƒAƒCƒeƒ€ (¸‡) + // 登録アイテム (昇順) di = regist_path_to_item(regist_di, (menu_info + i)->path); if (di != NULL && menu_create_datainfo(di, mii, j, id, 1, 0, 0) == TRUE) { for (; di != NULL; di = di->next, j++) @@ -668,7 +669,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_REGIST_DESC: - // “o˜^ƒAƒCƒeƒ€ (~‡) + // 登録アイテム (降順) di = regist_path_to_item(regist_di, (menu_info + i)->path); if (di != NULL && menu_create_datainfo(di, mii, j, id, -1, 0, 0) == TRUE) { for (; di != NULL; di = di->next, j++) @@ -677,7 +678,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_POPUP: - // ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[ + // ポップアップメニュー (mii + j)->flag = MF_POPUP | MF_OWNERDRAW; (mii + j)->item = (LPCTSTR)(mii + j); (mii + j)->text = alloc_copy((menu_info + i)->title); @@ -690,7 +691,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_VIEWER: - // ƒrƒ…[ƒA + // ビューア (mii + j)->id = ID_MENUITEM_VIEWER; (mii + j)->flag = MF_OWNERDRAW; (mii + j)->item = (LPCTSTR)(mii + j); @@ -702,7 +703,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_OPTION: - // ƒIƒvƒVƒ‡ƒ“ + // オプション (mii + j)->id = ID_MENUITEM_OPTION; (mii + j)->flag = MF_OWNERDRAW; (mii + j)->item = (LPCTSTR)(mii + j); @@ -714,7 +715,8 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_CLIPBOARD_WATCH: - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹Ř‚č‘Ö‚Ś + // クリップボード監視切り替え + // toggle clipboard monitoring (mii + j)->id = ID_MENUITEM_CLIPBOARD_WATCH; (mii + j)->flag = MF_OWNERDRAW | ((option.main_clipboard_watch == 1) ? MF_CHECKED : 0); (mii + j)->item = (LPCTSTR)(mii + j); @@ -726,7 +728,8 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_TOOL: - // ƒc[ƒ‹ + // ツール + // Tools if ((menu_info + i)->path != NULL && *(menu_info + i)->path != TEXT('\0')) { if ((t = tool_title_to_index((menu_info + i)->path)) != -1) { (mii + j)->id = ID_MENUITEM_DATA + ((*id)++); @@ -770,7 +773,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_APP: - // ƒAƒvƒŠƒP[ƒVƒ‡ƒ“ŽŔs + // アプリケーション実行 (mii + j)->id = ID_MENUITEM_DATA + ((*id)++); (mii + j)->flag = MF_OWNERDRAW; (mii + j)->item = (LPCTSTR)(mii + j); @@ -781,13 +784,13 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt (mii + j)->icon = menu_read_icon((menu_info + i)->path, 0, option.menu_icon_size); } (mii + j)->free_icon = TRUE; - // ƒƒjƒ…[î•ń‚đÝ’č + // メニュー情報を設定 (mii + j)->mi = menu_info + i; j++; break; case MENU_CONTENT_CANCEL: - // ƒLƒƒƒ“ƒZƒ‹ + // キャンセル (mii + j)->id = IDCANCEL; (mii + j)->flag = MF_OWNERDRAW; (mii + j)->item = (LPCTSTR)(mii + j); @@ -799,7 +802,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt break; case MENU_CONTENT_EXIT: - // I—š + // 終了 (mii + j)->id = ID_MENUITEM_EXIT; (mii + j)->flag = MF_OWNERDRAW; (mii + j)->item = (LPCTSTR)(mii + j); @@ -815,7 +818,7 @@ static MENU_ITEM_INFO *menu_create_info(MENU_INFO *menu_info, const int menu_cnt } /* - * menu_set_item - ƒƒjƒ…[‚ɍ€–Ú‚đÝ’č + * menu_set_item - メニューに項目を設定 */ static BOOL menu_set_item(const HDC hdc, const HMENU hMenu, MENU_ITEM_INFO *mii, const int cnt) { @@ -826,9 +829,9 @@ static BOOL menu_set_item(const HDC hdc, const HMENU hMenu, MENU_ITEM_INFO *mii, int menu_flag; int i; - // ƒƒjƒ…[€–ڂ̒ljÁ + // メニュー項目の追加 for (i = 0; i < cnt; i++) { - // ƒƒjƒ…[‚̍‚‚ł‚đŽć“ž + // メニューの高さを取得 if ((mii + i)->flag & MF_SEPARATOR) { item_height = option.menu_separator_height; } else if ((mii + i)->flag & MF_OWNERDRAW) { @@ -845,7 +848,7 @@ static BOOL menu_set_item(const HDC hdc, const HMENU hMenu, MENU_ITEM_INFO *mii, } else { item_height = GetSystemMetrics(SM_CYMENU); } - // Ü‚č•Ô‚ľÝ’č + // 折り返し設定 menu_flag = 0; height += item_height; if (option.menu_break == 1 && height >= GetSystemMetrics(SM_CYSCREEN)) { @@ -856,10 +859,10 @@ static BOOL menu_set_item(const HDC hdc, const HMENU hMenu, MENU_ITEM_INFO *mii, if ((mii + i)->flag & MF_POPUP) { hPopupMenu = CreatePopupMenu(); menu_set_item(hdc, hPopupMenu, (mii + i)->mii, (mii + i)->mii_cnt); - // ƒƒjƒ…[€–ڂ̒ljÁ + // メニュー項目の追加 AppendMenu(hMenu, (mii + i)->flag | menu_flag, (UINT)hPopupMenu, (mii + i)->item); } else { - // ƒƒjƒ…[€–ڂ̒ljÁ + // メニュー項目の追加 AppendMenu(hMenu, (mii + i)->flag | menu_flag, (mii + i)->id, (mii + i)->item); } } @@ -867,7 +870,7 @@ static BOOL menu_set_item(const HDC hdc, const HMENU hMenu, MENU_ITEM_INFO *mii, } /* - * menu_create - ƒƒjƒ…[‚̍쐬 + * menu_create - メニューの作成 */ HMENU menu_create(const HWND hWnd, MENU_INFO *menu_info, const int menu_cnt, DATA_INFO *history_di, DATA_INFO *regist_di) @@ -877,7 +880,7 @@ HMENU menu_create(const HWND hWnd, MENU_INFO *menu_info, const int menu_cnt, HFONT hFont, hRetFont; int id = 0; - // ƒƒjƒ…[ěŹ + // メニュー作成 if ((hMenu = CreatePopupMenu()) == NULL) { return NULL; } @@ -887,10 +890,10 @@ HMENU menu_create(const HWND hWnd, MENU_INFO *menu_info, const int menu_cnt, DestroyMenu(hMenu); return NULL; } - // ƒtƒHƒ“ƒgÝ’č + // フォント設定 hFont = menu_create_font(); hRetFont = SelectObject(hdc, hFont); - // ƒƒjƒ…[‚ɍ€–Ú‚đÝ’č + // メニューに項目を設定 menu_set_item(hdc, hMenu, menu_item_info, menu_item_cnt); SelectObject(hdc, hRetFont); DeleteObject(hFont); @@ -899,7 +902,7 @@ HMENU menu_create(const HWND hWnd, MENU_INFO *menu_info, const int menu_cnt, } /* - * menu_destory - ƒƒjƒ…[‚Ě”jŠü + * menu_destory - メニューの破棄 */ void menu_destory(HMENU hMenu) { @@ -917,7 +920,7 @@ void menu_destory(HMENU hMenu) } /* - * menu_set_drawitem - ƒƒjƒ…[•`‰ćÝ’č + * menu_set_drawitem - メニュー描画設定 */ BOOL menu_set_drawitem(MEASUREITEMSTRUCT *ms) { @@ -926,7 +929,7 @@ BOOL menu_set_drawitem(MEASUREITEMSTRUCT *ms) } /* - * menu_draw_bitmap - ƒƒjƒ…[‚Ƀrƒbƒgƒ}ƒbƒv‚đ•`‰ć + * menu_draw_bitmap - メニューにビットマップを描画 */ static int menu_draw_bitmap(const HDC draw_dc, const DATA_INFO *di, const int height) { @@ -963,7 +966,7 @@ static int menu_draw_bitmap(const HDC draw_dc, const DATA_INFO *di, const int he } /* - * menu_draw_ckeck - ƒƒjƒ…[‚Ěƒ`ƒFƒbƒNƒ}[ƒN‚đ•`‰ć + * menu_draw_ckeck - メニューのチェックマークを描画 */ static BOOL menu_draw_ckeck(const HDC draw_dc, const int left, const int top, const int right, const int bottom) { @@ -974,7 +977,7 @@ static BOOL menu_draw_ckeck(const HDC draw_dc, const int left, const int top, co HANDLE hBrush; RECT draw_rect; - // ě‹Ć—pDC‚̍쐬 + // 作業用DCの作成 if ((hdc = CreateCompatibleDC(draw_dc)) == NULL) { return FALSE; } @@ -1001,12 +1004,12 @@ static BOOL menu_draw_ckeck(const HDC draw_dc, const int left, const int top, co SetRect(&draw_rect, 0, 0, right - left, bottom - top); - // ƒ}ƒXƒN‚Ě•`‰ć + // マスクの描画 DrawFrameControl(hdc, &draw_rect, DFC_MENU, DFCS_MENUCHECK); BitBlt(hdc, 0, 0, right - left, bottom - top, hdc, 0, 0, DSTINVERT); BitBlt(draw_dc, left, top, right, bottom, hdc, 0, 0, SRCPAINT); - // ƒ`ƒFƒbƒNƒ}[ƒN‚Ě•`‰ć + // チェックマークの描画 hBrush = CreateSolidBrush(GetTextColor(draw_dc)); FillRect(hdc, &draw_rect, hBrush); DeleteObject(hBrush); @@ -1024,7 +1027,7 @@ static BOOL menu_draw_ckeck(const HDC draw_dc, const int left, const int top, co } /* - * menu_drawitem - ƒƒjƒ…[€–Ú‚đ•`‰ć + * menu_drawitem - メニュー項目を描画 */ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) { @@ -1065,7 +1068,7 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) width = ds->rcItem.right - ds->rcItem.left; height = ds->rcItem.bottom - ds->rcItem.top; - // •`‰ć—pDC‚̍쐬 + // 描画用DCの作成 if ((draw_dc = CreateCompatibleDC(ds->hDC)) == NULL) { return FALSE; } @@ -1075,7 +1078,7 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) } hrBmp = SelectObject(draw_dc, hDrawBmp); - // ”wŒi + // 背景 SetRect(&draw_rect, 0, 0, width, height); if (ds->itemState & ODS_SELECTED) { hBrush = CreateSolidBrush(menu_color_highlight); @@ -1101,11 +1104,11 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) left_margin = -1; if (mii->show_bitmap == TRUE && mii->show_di->menu_bitmap != NULL) { - // ƒrƒbƒgƒ}ƒbƒv + // ビットマップ left_margin = menu_draw_bitmap(draw_dc, mii->show_di, height); } if (left_margin == -1) { - // ƒAƒCƒRƒ“ + // アイコン if (mii->icon != NULL) { DrawIconEx(draw_dc, option.menu_icon_margin, height / 2 - option.menu_icon_size / 2, mii->icon, @@ -1126,7 +1129,7 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) } if (mii->text != NULL) { - // ƒeƒLƒXƒg + // テキスト hFont = menu_create_font(); hRetFont = SelectObject(draw_dc, hFont); @@ -1142,7 +1145,7 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) DrawText(draw_dc, mii->text, lstrlen(mii->text), &draw_rect, DT_VCENTER | DT_SINGLELINE | DT_NOCLIP | DT_WORD_ELLIPSIS); - // ƒzƒbƒgƒL[•\ŽŚ + // ホットキー表示 if (!(ds->itemState & ODS_SELECTED) && mii->show_format == TRUE) { SetTextColor(draw_dc, menu_color_text); } @@ -1155,7 +1158,7 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) DeleteObject(hFont); } else if (mii->flag & MF_SEPARATOR) { - // ‹ćŘ‚č + // 区切り hPen = CreatePen(PS_SOLID, 1, menu_color_3d_shadow); hRetPen = SelectObject(draw_dc, hPen); MoveToEx(draw_dc, option.menu_separator_margin_left, @@ -1175,7 +1178,7 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) DeleteObject(hPen); } - // ƒƒjƒ…[‚É•`‰ć + // メニューに描画 BitBlt(ds->hDC, ds->rcItem.left, ds->rcItem.top, ds->rcItem.right, ds->rcItem.bottom, @@ -1188,7 +1191,7 @@ BOOL menu_drawitem(const DRAWITEMSTRUCT *ds) } /* - * menu_get_accelerator - ƒƒjƒ…[‚ĚƒAƒNƒZƒ‰ƒŒ[ƒ^ƒL[‚đŽć“ž + * menu_get_accelerator - メニューのアクセラレータキーを取得 */ static TCHAR menu_get_accelerator(TCHAR *str) { @@ -1208,7 +1211,7 @@ static TCHAR menu_get_accelerator(TCHAR *str) if (*(p + 1) == TEXT('&')) { p++; } else { - // ƒAƒNƒZƒ‰ƒŒ[ƒ^ƒL[ + // アクセラレータキー ret = *(p + 1); } } @@ -1216,7 +1219,7 @@ static TCHAR menu_get_accelerator(TCHAR *str) } /* - * menu_accelerator - ƒƒjƒ…[ƒAƒNƒZƒ‰ƒŒ[ƒ^ + * menu_accelerator - メニューアクセラレータ */ LRESULT menu_accelerator(const HMENU hMenu, const TCHAR key) { @@ -1228,7 +1231,7 @@ LRESULT menu_accelerator(const HMENU hMenu, const TCHAR key) cnt = GetMenuItemCount(hMenu); - // ‘I‘đˆĘ’uŽć“ž + // 選択位置取得 for (sel = 0; sel < cnt; sel++) { if (GetMenuState(hMenu, sel, MF_BYPOSITION) & MF_HILITE) { break; @@ -1238,7 +1241,7 @@ LRESULT menu_accelerator(const HMENU hMenu, const TCHAR key) sel = -1; } - // ƒAƒNƒZƒ‰ƒŒ[ƒ^ˆĘ’uŽć“ž + // アクセラレータ位置取得 for (i = sel + 1; i < cnt; i++) { ZeroMemory(&mii, sizeof(mii)); mii.cbSize = sizeof(mii); @@ -1253,7 +1256,7 @@ LRESULT menu_accelerator(const HMENU hMenu, const TCHAR key) continue; } if (ret != -1) { - // ‘I‘đ + // 選択 return MAKELRESULT(ret, MNC_SELECT); } ret = i; @@ -1272,7 +1275,7 @@ LRESULT menu_accelerator(const HMENU hMenu, const TCHAR key) continue; } if (ret != -1) { - // ‘I‘đ + // 選択 return MAKELRESULT(ret, MNC_SELECT); } ret = i; diff --git a/Menu.h b/Menu.h index cd9832b..407e54e 100644 --- a/Menu.h +++ b/Menu.h @@ -35,53 +35,72 @@ /* Struct */ // menu item typedef struct _MENU_ITEM_INFO { - UINT id; // ƒƒjƒ…[ID - UINT flag; // ƒƒjƒ…[ƒtƒ‰ƒO - LPCTSTR item; // ƒƒjƒ…[€–Ú‚Ě“ŕ—e + UINT id; // メニューID / MenuID + UINT flag; // メニューフラグ / MenuFlag + LPCTSTR item; // メニュー項目の内容 / Menu item content - TCHAR *text; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒeƒLƒXƒg - int text_x; // ƒeƒLƒXƒg‚ĚˆĘ’u + TCHAR *text; // メニューに表示するテキスト / menu item text + int text_x; // テキストの位置 / text position int text_y; - HICON icon; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“ + HICON icon; // メニューに表示するアイコン / menu item icon BOOL free_icon; TCHAR *hkey; - BOOL show_format; // Œ`ŽŽ•\ŽŚ - BOOL show_bitmap; // ƒrƒbƒgƒ}ƒbƒv•\ŽŚ + BOOL show_format; // 形式表示 / whether to show format + BOOL show_bitmap; // ビットマップ表示 / wether to show bitmap - DATA_INFO *set_di; // ƒf[ƒ^î•ń - DATA_INFO *show_di; // •\ŽŚ‚ˇ‚éƒf[ƒ^î•ń + DATA_INFO *set_di; // データ情報 / data information + DATA_INFO *show_di; // 表示するデータ情報 / data information to display - TOOL_INFO *ti; // ƒc[ƒ‹î•ń + TOOL_INFO *ti; // ツール情報 / tool information - struct _MENU_INFO *mi; // Œł‚ƂȂéMENU_INFO\‘˘‘Ě + struct _MENU_INFO *mi; // 元となるMENU_INFO構造体 / original MENU_INFO structure // popup - struct _MENU_ITEM_INFO *mii; // ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ĚŽqƒAƒCƒeƒ€ - int mii_cnt; // ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ĚŽqƒAƒCƒeƒ€‚̐” + struct _MENU_ITEM_INFO *mii; // ポップアップメニューの子アイテム / Popup menu child items + int mii_cnt; // ポップアップメニューの子アイテムの数 / Number of child items in popup menu } MENU_ITEM_INFO; // menu info typedef struct _MENU_INFO { - int content; // MENU_CONTENT_ - TCHAR *title; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒ^ƒCƒgƒ‹ + // MENU_CONTENT_ + int content; + // メニューに表示するタイトル + // menu title + TCHAR *title; // icon - TCHAR *icon_path; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“‚ĚƒpƒX (‹ó‚Ěę‡‚Í–{‘Ě) - int icon_index; // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“‚ĚƒCƒ“ƒfƒbƒNƒX - - // path - TCHAR *path; // ƒpƒX (MENU_CONTENT_REGIST, MENU_CONTENT_APP) - TCHAR *cmd; // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ (MENU_CONTENT_APP) - - int min; // —š—đ‚Ě•\ŽŚŠJŽn’l (MENU_CONTENT_HISTORY) - int max; // —š—đ‚Ě•\ŽŚI—š’l (MENU_CONTENT_HISTORY) + // メニューに表示するアイコンのパス (空の場合は本体) + // Path of icon to be displayed in menu (body if empty) + TCHAR *icon_path; + // メニューに表示するアイコンのインデックス + // index of the icon to be displayed in the menu + int icon_index; + + // content + // パス (MENU_CONTENT_REGIST, MENU_CONTENT_APP) + // Path (MENU_CONTENT_REGIST, MENU_CONTENT_APP) + TCHAR *path; + // コマンドライン (MENU_CONTENT_APP) + // Command line (MENU_CONTENT_APP) + TCHAR *cmd; + + // 履歴の表示開始値 (MENU_CONTENT_HISTORY) + // Value of first history display (MENU_CONTENT_HISTORY) + int min; + // 履歴の表示終了値 (MENU_CONTENT_HISTORY) + // Value of last history display (MENU_CONTENT_HISTORY) + int max; // popup - struct _MENU_INFO *mi; // ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ĚŽqƒAƒCƒeƒ€ (MENU_CONTENT_POPUP) - int mi_cnt; // ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚ĚŽqƒAƒCƒeƒ€‚̐” + // ポップアップメニューの子アイテム (MENU_CONTENT_POPUP) + // Popup menu child items (MENU_CONTENT_POPUP) + struct _MENU_INFO *mi; + // ポップアップメニューの子アイテムの数 + // Number of child items in the popup menu + int mi_cnt; } MENU_INFO; /* Function Prototypes */ diff --git a/String.c b/String.c index e358c66..f1d2032 100644 --- a/String.c +++ b/String.c @@ -22,7 +22,7 @@ /* Local Function Prototypes */ /* - * a2i - ”Žš‚Ě•śŽš—ń‚𐔒l(int)‚ɕϊˇ‚ˇ‚é + * a2i - ”Žš‚Ě•śŽš—ń‚𐔒l(int)‚ɕϊˇ‚ˇ‚é / convert a string of digits to a number (int) */ int a2i(const char *str) { @@ -43,7 +43,7 @@ int a2i(const char *str) } /* - * x2i - 16i•śŽš—ń‚𐔒l(int)‚ɕϊˇ‚ˇ‚é + * x2i - 16i•śŽš—ń‚𐔒l(int)‚ɕϊˇ‚ˇ‚é / convert a hexadecimal string to a number */ int x2i(const char *str) { @@ -77,7 +77,7 @@ int x2i(const char *str) } /* - * tx2i - 16i•śŽš—ń(UNICODE)‚𐔒l(int)‚ɕϊˇ‚ˇ‚é + * tx2i - 16i•śŽš—ń(UNICODE)‚𐔒l(int)‚ɕϊˇ‚ˇ‚é / convert hexadecimal UNICODE string to a number (int) */ #ifdef UNICODE int tx2i(const TCHAR *str) @@ -94,7 +94,7 @@ int tx2i(const TCHAR *str) #endif /* - * str2hash - •śŽš—ń‚ĚƒnƒbƒVƒ…’l‚đŽć“ž + * str2hash - •śŽš—ń‚ĚƒnƒbƒVƒ…’l‚đŽć“ž / get the hash value of a string */ int str2hash(const TCHAR *str) { @@ -109,7 +109,7 @@ int str2hash(const TCHAR *str) } /* - * str_match - ‚Q‚‚̕śŽš—ń‚đƒƒCƒ‹ƒhƒJ[ƒh(*)‚đŽg‚Á‚Ä”äŠr‚đs‚¤ + * str_match - ‚Q‚‚̕śŽš—ń‚đƒƒCƒ‹ƒhƒJ[ƒh(*)‚đŽg‚Á‚Ä”äŠr‚đs‚¤ / compare two strings using wildcard (*) */ BOOL str_match(const TCHAR *Ptn, const TCHAR *Str) { @@ -132,14 +132,14 @@ BOOL Trim(TCHAR *buf) { TCHAR *p, *r; - // ‘OŒă‚Ě‹ó”’‚đœ‚˘‚˝ƒ|ƒCƒ“ƒ^‚đŽć“ž + // ‘OŒă‚Ě‹ó”’‚đœ‚˘‚˝ƒ|ƒCƒ“ƒ^‚đŽć“ž / get pointer without leading and trailing spaces for (p = buf; (*p == TEXT(' ') || *p == TEXT('\t')) && *p != TEXT('\0'); p++) ; for (r = buf + lstrlen(buf) - 1; r > p && (*r == TEXT(' ') || *r == TEXT('\t')); r--) ; *(r + 1) = TEXT('\0'); - // Œł‚Ě•śŽš—ń‚ɃRƒs[ + // Œł‚Ě•śŽš—ń‚ɃRƒs[ / copy to original string buffer lstrcpy(buf, p); return TRUE; } diff --git a/main.c b/main.c index abec18f..72536e4 100644 --- a/main.c +++ b/main.c @@ -51,14 +51,14 @@ #define ERROR_TITLE TEXT("CLCL - Error") #define MUTEX TEXT("_CLCL_Mutex_") -#define WM_TRAY_NOTIFY (WM_APP + 1000) // ƒ^ƒXƒNƒgƒŒƒC -#define WM_KEY_HOOK (WM_APP + 1001) // ƒtƒbƒN +#define WM_TRAY_NOTIFY (WM_APP + 1000) // タスクトレイ +#define WM_KEY_HOOK (WM_APP + 1001) // フック #define SICONSIZE Scale(16) -#define TRAY_ID 1 // ƒ^ƒXƒNƒgƒŒƒCID +#define TRAY_ID 1 // タスクトレイID -#define ID_HISTORY_TIMER 1 // ƒ^ƒCƒ}[ID +#define ID_HISTORY_TIMER 1 // タイマーID #define ID_RECHAIN_TIMER 2 #define ID_TOOL_TIMER 3 #define ID_PASTE_TIMER 4 @@ -106,7 +106,8 @@ DATA_INFO history_data; DATA_INFO regist_data; static DATA_INFO *paste_di; -// ƒc[ƒ‹ƒƒjƒ…[î•ń +// ツールメニュー情報 +// Tool menu information typedef struct _TOOL_MENU_INFO { BOOL enable; TOOL_INFO *ti; @@ -114,7 +115,8 @@ typedef struct _TOOL_MENU_INFO { } TOOL_MENU_INFO; static TOOL_MENU_INFO tmi; -// ƒtƒH[ƒJƒXî•ń +// フォーカス情報 +// focus information typedef struct _FOCUS_INFO { HWND active_wnd; HWND focus_wnd; @@ -123,7 +125,8 @@ typedef struct _FOCUS_INFO { } FOCUS_INFO; static FOCUS_INFO focus_info; -// ƒIƒvƒVƒ‡ƒ“ +// オプション +// option information extern OPTION_INFO option; /* Local Function Prototypes */ @@ -158,7 +161,7 @@ static BOOL init_application(const HINSTANCE hInstance); static HWND init_instance(const HINSTANCE hInstance, const int CmdShow); /* - * theme_open - XPƒe[ƒ}‚đŠJ‚­ + * theme_open - XPテーマを開く */ #ifdef OP_XP_STYLE HTHEME theme_open(const HWND hWnd) @@ -180,7 +183,7 @@ HTHEME theme_open(const HWND hWnd) #endif /* - * theme_close - XPƒe[ƒ}‚đ•‚ś‚é + * theme_close - XPテーマを閉じる */ #ifdef OP_XP_STYLE void theme_close(const HTHEME hTheme) @@ -200,7 +203,7 @@ void theme_close(const HTHEME hTheme) #endif /* - * theme_free - XPƒe[ƒ}‚̉đ•ú + * theme_free - XPテーマの解放 */ #ifdef OP_XP_STYLE void theme_free(void) @@ -213,7 +216,7 @@ void theme_free(void) #endif /* - * theme_draw - XPƒe[ƒ}‚Ĺ•`‰ć + * theme_draw - XPテーマで描画 */ #ifdef OP_XP_STYLE BOOL theme_draw(const HWND hWnd, const HRGN draw_hrgn, const HTHEME hTheme) @@ -233,7 +236,8 @@ BOOL theme_draw(const HWND hWnd, const HRGN draw_hrgn, const HTHEME hTheme) if (_DrawThemeBackground == NULL) { return FALSE; } - // ó‘Ԃ̐ݒč + // 状態の設定 + // set the state if (IsWindowEnabled(hWnd) == 0) { stats = ETS_DISABLED; } else if (GetFocus() == hWnd) { @@ -241,7 +245,8 @@ BOOL theme_draw(const HWND hWnd, const HRGN draw_hrgn, const HTHEME hTheme) } else { stats = ETS_NORMAL; } - // ƒEƒBƒ“ƒhƒE˜g‚Ě•`‰ć + // ウィンドウ枠の描画 + // draw window frame hdc = GetDCEx(hWnd, draw_hrgn, DCX_WINDOW | DCX_INTERSECTRGN); if (hdc == NULL) { hdc = GetWindowDC(hWnd); @@ -254,7 +259,8 @@ BOOL theme_draw(const HWND hWnd, const HRGN draw_hrgn, const HTHEME hTheme) _DrawThemeBackground(hTheme, hdc, EP_EDITTEXT, stats, &rect, &clip_rect); ReleaseDC(hWnd, hdc); - // ƒXƒNƒ[ƒ‹ƒo[‚Ě•`‰ć + // スクロールバーの描画 + // draw the scrollbar GetWindowRect(hWnd, (LPRECT)&rect); hrgn = CreateRectRgn(rect.left + GetSystemMetrics(SM_CXEDGE), rect.top + GetSystemMetrics(SM_CYEDGE), rect.right - GetSystemMetrics(SM_CXEDGE), rect.bottom - GetSystemMetrics(SM_CYEDGE)); @@ -266,7 +272,7 @@ BOOL theme_draw(const HWND hWnd, const HRGN draw_hrgn, const HTHEME hTheme) #endif /* - * set_menu_layerer - ƒƒjƒ…[‚𔟓§–ž‚É‚ˇ‚é (Windows2000`) + * set_menu_layerer - メニューを半透明にする - Make menu semi-transparent (Windows2000~) */ #ifdef MENU_LAYERER static BOOL set_menu_layerer(const HWND hWnd, const int alpha) @@ -288,7 +294,8 @@ static BOOL set_menu_layerer(const HWND hWnd, const int alpha) return TRUE; } - // ”ź“§–ž—pAPIŽć“ž + // 半透明用API取得 + // Get translucent API user32_lib = LoadLibrary(TEXT("user32.dll")); if (user32_lib == NULL) { return FALSE; @@ -301,14 +308,16 @@ static BOOL set_menu_layerer(const HWND hWnd, const int alpha) lStyle = GetWindowLong(hWnd, GWL_EXSTYLE); if (lStyle & WS_EX_LAYERED) { - // Šů‚ɔꓧ–žĎ‚Ý + // 既に半透明済み + // Already semi-transparent FreeLibrary(user32_lib); return TRUE; } lStyle |= WS_EX_LAYERED; SetWindowLong(hWnd, GWL_EXSTYLE, lStyle); - // ”ź“§–ž + // 半透明 + // translucent SetLayeredWindowAttributes(hWnd, 0, alpha, LWA_ALPHA); FreeLibrary(user32_lib); return TRUE; @@ -316,7 +325,8 @@ static BOOL set_menu_layerer(const HWND hWnd, const int alpha) #endif /* - * _SetForegroundWindow - ƒEƒBƒ“ƒhƒE‚đƒAƒNƒeƒBƒu‚É‚ˇ‚é + * _SetForegroundWindow - ウィンドウをアクティブにする + * Activate window */ BOOL _SetForegroundWindow(const HWND hWnd) { @@ -346,15 +356,17 @@ BOOL _SetForegroundWindow(const HWND hWnd) } /* - * get_focus_info - ƒtƒH[ƒJƒXî•ń‚đŽć“ž + * get_focus_info - フォーカス情報を取得 */ static void get_focus_info(FOCUS_INFO *fi) { - // ƒtƒH[ƒJƒX‚đŽ‚ÂƒEƒBƒ“ƒhƒE‚̎擞 + // フォーカスを持つウィンドウの取得 + // get the window with focus fi->active_wnd = GetForegroundWindow(); AttachThreadInput(GetWindowThreadProcessId(fi->active_wnd, NULL), GetCurrentThreadId(), TRUE); fi->focus_wnd = GetFocus(); - // ƒLƒƒƒŒƒbƒgˆĘ’uŽć“ž + // キャレット位置取得 + // get caret position if (GetCaretPos(&fi->cpos) == TRUE && (fi->cpos.x > 0 || fi->cpos.y > 0)) { ClientToScreen(fi->focus_wnd, &fi->cpos); fi->caret = TRUE; @@ -365,7 +377,7 @@ static void get_focus_info(FOCUS_INFO *fi) } /* - * set_focus_info - ƒEƒBƒ“ƒhƒE‚ĚƒtƒH[ƒJƒX‚đÝ’č + * set_focus_info - ウィンドウのフォーカスを設定 */ static void set_focus(const HWND active_wnd, const HWND focus_wnd) { @@ -379,17 +391,19 @@ static void set_focus(const HWND active_wnd, const HWND focus_wnd) } static void set_focus_info(const FOCUS_INFO *fi) { - // ƒAƒNƒeƒBƒuƒEƒBƒ“ƒhƒE‚̐ݒč + // アクティブウィンドウの設定 + // set the active window _SetForegroundWindow(fi->active_wnd); SendMessage(fi->active_wnd, WM_NCACTIVATE, (WPARAM)TRUE, 0); - // ƒtƒH[ƒJƒX‚̐ݒč + // フォーカスの設定 + // set the focus if (window_focus_check(fi->active_wnd) == TRUE) { set_focus(fi->active_wnd, fi->focus_wnd); } } /* - * tray_message - ƒ^ƒXƒNƒgƒŒƒC‚ĚƒAƒCƒRƒ“‚̐ݒč + * tray_message - タスクトレイのアイコンの設定 */ static BOOL tray_message(const HWND hWnd, const DWORD dwMessage, const UINT uID, const HICON hIcon, const TCHAR *pszTip) { @@ -406,7 +420,7 @@ static BOOL tray_message(const HWND hWnd, const DWORD dwMessage, const UINT uID, } /* - * set_tray_icon - ƒ^ƒXƒNƒgƒŒƒC‚ɃAƒCƒRƒ“‚đÝ’股‚é + * set_tray_icon - タスクトレイにアイコンを設定する */ static void set_tray_icon(const HWND hWnd, const HICON hIcon, const TCHAR *buf) { @@ -414,10 +428,12 @@ static void set_tray_icon(const HWND hWnd, const HICON hIcon, const TCHAR *buf) return; } if (tray_message(hWnd, NIM_MODIFY, TRAY_ID, hIcon, buf) == FALSE) { - // •ύX‚Ĺ‚Ť‚ȂЂÁ‚˝ę‡‚͒ljÁ‚đs‚¤ + // 変更できなかった場合は追加を行う + // if modification failed, add it int i; for (i = 0; i < 5; i++) { - // ’ljÁ‚Ĺ‚Ť‚ȂЂÁ‚˝ę‡‚ÍƒŠƒgƒ‰ƒC‚ˇ‚é + // 追加できなかった場合はリトライする + // if add failed, retry if (tray_message(hWnd, NIM_ADD, TRAY_ID, hIcon, buf)) { break; } @@ -427,7 +443,7 @@ static void set_tray_icon(const HWND hWnd, const HICON hIcon, const TCHAR *buf) } /* - * set_tray_tooltip - ƒ^ƒXƒNƒgƒŒƒC‚Ěƒc[ƒ‹ƒ`ƒbƒv‚đÝ’č + * set_tray_tooltip - タスクトレイのツールチップを設定 */ static void set_tray_tooltip(const HWND hWnd) { @@ -442,7 +458,7 @@ static void set_tray_tooltip(const HWND hWnd) } /* - * show_menu_tooltip - ƒƒjƒ…[‚Ěƒc[ƒ‹ƒ`ƒbƒv•\ŽŚ + * show_menu_tooltip - メニューのツールチップ表示 */ static BOOL show_menu_tooltip(const HWND tooltip_wnd, const HMENU hMenu, const UINT id, const BOOL mouse) { @@ -450,7 +466,7 @@ static BOOL show_menu_tooltip(const HWND tooltip_wnd, const HMENU hMenu, const U DATA_INFO *di; TCHAR *buf; - // ID‚Š‚çƒƒjƒ…[î•ń‚đŽć“ž + // IDからメニュー情報を取得 mii = menu_get_info(id); if (mii == NULL) { tooltip_hide(tooltip_wnd); @@ -461,25 +477,26 @@ static BOOL show_menu_tooltip(const HWND tooltip_wnd, const HMENU hMenu, const U tooltip_hide(tooltip_wnd); return FALSE; } - // ƒc[ƒ‹ƒ`ƒbƒv‚É•\ŽŚ‚ˇ‚éƒeƒLƒXƒg‚đŽć“ž + // ツールチップに表示するテキストを取得 buf = format_get_tooltip_text(di); if (buf == NULL) { tooltip_hide(tooltip_wnd); return FALSE; } if (mouse == TRUE) { - // ƒ}ƒEƒXˆĘ’u + // マウス位置 menu_sel_pt.x = menu_sel_pt.y = 0; menu_sel_top = 0; } - // ƒc[ƒ‹ƒ`ƒbƒv•\ŽŚ + // ツールチップ表示 tooltip_show(tooltip_wnd, buf, menu_sel_pt.x, menu_sel_pt.y, menu_sel_top); mem_free(&buf); return TRUE; } /* - * show_tool_menu - ƒc[ƒ‹ƒƒjƒ…[‚đ•\ŽŚ + * show_tool_menu - ツールメニューを表示 + * Show Tools menu */ static BOOL show_tool_menu(const HWND hWnd, DATA_INFO *di, const int paste) { @@ -490,7 +507,8 @@ static BOOL show_tool_menu(const HWND hWnd, DATA_INFO *di, const int paste) if (popup_menu != NULL) { return FALSE; } - // ƒƒjƒ…[ěŹ + // メニュー作成 + // create menu ZeroMemory(&mi, sizeof(MENU_INFO)); mi.content = MENU_CONTENT_TOOL; popup_menu = menu_create(hWnd, &mi, 1, NULL, NULL); @@ -504,7 +522,8 @@ static BOOL show_tool_menu(const HWND hWnd, DATA_INFO *di, const int paste) menu_free(); return FALSE; } - // ƒƒjƒ…[•\ŽŚ + // メニュー表示 + // show menu _SetForegroundWindow(hWnd); ret = menu_show(hWnd, popup_menu, NULL); menu_destory(popup_menu); @@ -516,14 +535,16 @@ static BOOL show_tool_menu(const HWND hWnd, DATA_INFO *di, const int paste) return FALSE; } if (mii->ti->copy_paste == 1) { - // ƒNƒŠƒbƒvƒ{[ƒh‚É‘—‚Á‚ĂЂçƒc[ƒ‹‚đŽŔs + // クリップボードに送ってからツールを実行 + // send to clipboard and execute tool tmi.enable = TRUE; tmi.ti = mii->ti; tmi.paste = (GetKeyState(VK_SHIFT) >= 0) ? paste : 0; menu_free(); return TRUE; } - // ƒc[ƒ‹‚ĚŽŔs + // ツールの実行 + // execute tool if (tool_execute(hWnd, mii->ti, CALLTYPE_MENU, di, NULL) & TOOL_DATA_MODIFIED) { if (data_check(&history_data, di) != NULL) { SendMessage(hWnd, WM_HISTORY_CHANGED, 0, 0); @@ -536,7 +557,7 @@ static BOOL show_tool_menu(const HWND hWnd, DATA_INFO *di, const int paste) } /* - * show_popup_menu - ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[‚đ•\ŽŚ + * show_popup_menu - ポップアップメニューを表示 */ static BOOL show_popup_menu(const HWND hWnd, const ACTION_INFO *ai, const BOOL caret) { @@ -546,23 +567,27 @@ static BOOL show_popup_menu(const HWND hWnd, const ACTION_INFO *ai, const BOOL c BOOL caret_flag = caret; if (popup_menu != NULL) { - // ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[•\ŽŚ’† + // ポップアップメニュー表示中 + // Pop-up menu is displayed _SetForegroundWindow(hWnd); return FALSE; } CopyMemory(&fi, &focus_info, sizeof(FOCUS_INFO)); if (caret == TRUE || fi.active_wnd == NULL) { - // ƒtƒH[ƒJƒXî•ńŽć“ž + // フォーカス情報取得 + // Get focus information get_focus_info(&fi); } if (ai->caret == 0 || fi.caret == FALSE) { caret_flag = FALSE; } - // ƒL[‰Šú‰ť + // キー初期化 + // key initialization GetAsyncKeyState(VK_RBUTTON); - // ƒƒjƒ…[ěŹ + // メニュー作成 + // Create menu popup_menu = menu_create(hWnd, ai->menu_info, ai->menu_cnt, history_data.child, regist_data.child); if (popup_menu == NULL) { menu_free(); @@ -574,7 +599,8 @@ static BOOL show_popup_menu(const HWND hWnd, const ACTION_INFO *ai, const BOOL c menu_free(); return FALSE; } - // ƒƒjƒ…[•\ŽŚ + // メニュー表示 + // Display menu _SetForegroundWindow(hWnd); ShowWindow(hWnd, SW_HIDE); ret = menu_show(hWnd, popup_menu, (caret_flag == TRUE) ? &fi.cpos : NULL); @@ -583,18 +609,21 @@ static BOOL show_popup_menu(const HWND hWnd, const ACTION_INFO *ai, const BOOL c mii = menu_get_info(ret); if (ret <= 0 || ret == IDCANCEL || mii == NULL) { - // ƒLƒƒƒ“ƒZƒ‹ + // キャンセル + // cancel if (GetForegroundWindow() == hWnd) { set_focus_info(&fi); } } else if (mii->set_di != NULL) { - // ƒAƒCƒeƒ€ + // アイテム + // item if ((GetAsyncKeyState(VK_RBUTTON) == 1 || GetKeyState(VK_CONTROL) < 0) && option.menu_show_tool_menu == 1) { DATA_INFO *di = mii->set_di; menu_free(); - // ƒc[ƒ‹ƒƒjƒ…[•\ŽŚ + // ツールメニュー表示 + // Display tool menu if (show_tool_menu(hWnd, di, ai->paste) == TRUE) { set_focus_info(&fi); SendMessage(hWnd, WM_ITEM_TO_CLIPBOARD, 0, (LPARAM)di); @@ -603,34 +632,43 @@ static BOOL show_popup_menu(const HWND hWnd, const ACTION_INFO *ai, const BOOL c } return TRUE; } - // ƒNƒŠƒbƒvƒ{[ƒh‚Ƀf[ƒ^‚đÝ’č + // クリップボードにデータを設定 + // Set the data on the clipboard set_focus_info(&fi); SendMessage(hWnd, WM_ITEM_TO_CLIPBOARD, 0, (LPARAM)mii->set_di); if (ai->paste == 1 && GetKeyState(VK_SHIFT) >= 0) { - // ƒL[‚đ—Ł‚ˇ‚܂őҋ@ + // キーを離すまで待機 + // Wait until key is released key_wait(); - // ƒzƒbƒgƒL[‚Ě‰đœ + // ホットキーの解除 + // Cancel hotkey unregist_hotkey(hWnd); - // “\‚č•t‚Ż + // 貼り付け + // paste sendkey_paste(fi.active_wnd); - // ƒzƒbƒgƒL[‚Ě“o˜^ + // ホットキーの登録 + // Register the hotkey regist_hotkey(hWnd, FALSE); } } else if (mii->ti != NULL) { - // ƒc[ƒ‹ + // ツール + // tool set_focus_info(&fi); if (mii->ti->copy_paste == 1) { tmi.enable = TRUE; tmi.ti = mii->ti; tmi.paste = (GetKeyState(VK_SHIFT) >= 0) ? ai->paste : 0; - // ƒL[‚đ—Ł‚ˇ‚܂őҋ@ + // キーを離すまで待機 + // Wait until key is released key_wait(); SetTimer(hWnd, ID_TOOL_TIMER, option.tool_valid_interval, NULL); - // ƒRƒs[ + // コピー + // Copy sendkey_copy(fi.active_wnd); } else { - // ƒc[ƒ‹ŽŔs + // ツール実行 + // Execute the tool if (tool_execute(hWnd, mii->ti, CALLTYPE_MENU, history_data.child, NULL) & TOOL_DATA_MODIFIED) { SendMessage(hWnd, WM_HISTORY_CHANGED, 0, 0); SendMessage(hWnd, WM_ITEM_TO_CLIPBOARD, 0, (LPARAM)history_data.child); @@ -638,20 +676,23 @@ static BOOL show_popup_menu(const HWND hWnd, const ACTION_INFO *ai, const BOOL c } } else if (mii->mi != NULL) { - // ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚Ě‹N“Ž + // アプリケーションの起動 + // launch the application shell_open(mii->mi->path, mii->mi->cmd); } else { - // ƒRƒ}ƒ“ƒh + // コマンド + // command SendMessage(hWnd, WM_COMMAND, ret, 0); } - // ƒƒjƒ…[î•ń‚̉đ•ú + // メニュー情報の解放 + // Release menu information menu_free(); return TRUE; } /* - * action_execute - Action‚ĚŽŔs + * action_execute - Actionの実行 */ static BOOL action_execute(const HWND hWnd, const int type, const int id, const BOOL caret) { @@ -661,7 +702,8 @@ static BOOL action_execute(const HWND hWnd, const int type, const int id, const ZeroMemory(&tmi, sizeof(TOOL_MENU_INFO)); - // “Žě‚ĚŒŸő + // 動作の検索 + // Search for behavior for (i = 0; i < option.action_cnt; i++) { if (type == (option.action_info + i)->type && (option.action_info + i)->enable != 0) { if (type == ACTION_TYPE_HOTKEY && id != (option.action_info + i)->id) { @@ -670,7 +712,8 @@ static BOOL action_execute(const HWND hWnd, const int type, const int id, const break; } } - // ƒc[ƒ‹‚ĚŒŸő + // ツールの検索 + //Search for tools if (i >= option.action_cnt && type == ACTION_TYPE_HOTKEY) { for (i = 0; i < option.tool_cnt; i++) { if (id != (option.tool_info + i)->id) { @@ -680,13 +723,15 @@ static BOOL action_execute(const HWND hWnd, const int type, const int id, const tmi.enable = TRUE; tmi.ti = option.tool_info + i; tmi.paste = 1; - // ƒL[‚đ—Ł‚ˇ‚܂őҋ@ + // キーを離すまで待機 + // Wait until key is released key_wait(); SetTimer(hWnd, ID_TOOL_TIMER, option.tool_valid_interval, NULL); - // ƒRƒs[ + // コピー sendkey_copy(GetForegroundWindow()); } else { - // ƒc[ƒ‹ŽŔs + // ツール実行 + // Execute the tool if (tool_execute(hWnd, option.tool_info + i, CALLTYPE_MENU, history_data.child, NULL) & TOOL_DATA_MODIFIED) { SendMessage(hWnd, WM_HISTORY_CHANGED, 0, 0); SendMessage(hWnd, WM_ITEM_TO_CLIPBOARD, 0, (LPARAM)history_data.child); @@ -695,7 +740,8 @@ static BOOL action_execute(const HWND hWnd, const int type, const int id, const return TRUE; } if (i >= option.tool_cnt) { - // “o˜^ƒAƒCƒeƒ€‚𒟐ړ\‚č•t‚Ż + // 登録アイテムを直接貼り付け + // Paste registered items directly di = regist_hotkey_to_item(regist_data.child, id); if (di != NULL) { paste_di = di; @@ -708,31 +754,37 @@ static BOOL action_execute(const HWND hWnd, const int type, const int id, const return TRUE; } - // “Žě‚đŽŔs + // 動作を実行 + // Perform the action switch ((option.action_info + i)->action) { case ACTION_POPUPMEMU: - // ƒ|ƒbƒvƒAƒbƒvƒƒjƒ…[ + // ポップアップメニュー + // popup menu ret = show_popup_menu(hWnd, option.action_info + i, caret); ZeroMemory(&focus_info, sizeof(FOCUS_INFO)); return ret; case ACTION_VIEWER: - // ƒrƒ…[ƒA•\ŽŚ + // ビューア表示 + // Display Viewer SendMessage(hWnd, WM_COMMAND, ID_MENUITEM_VIEWER, 0); break; case ACTION_OPTION: - // ƒIƒvƒVƒ‡ƒ“ + // オプション + // Options SendMessage(hWnd, WM_COMMAND, ID_MENUITEM_OPTION, 0); break; case ACTION_CLIPBOARD_WATCH: - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹Ř‚č‘Ö‚Ś + // クリップボード監視切り替え + // Toggle clipboard monitoring SendMessage(hWnd, WM_COMMAND, ID_MENUITEM_CLIPBOARD_WATCH, 0); break; case ACTION_EXIT: - // I—š + // 終了 + // EXIT SendMessage(hWnd, WM_COMMAND, ID_MENUITEM_EXIT, 0); break; } @@ -740,13 +792,14 @@ static BOOL action_execute(const HWND hWnd, const int type, const int id, const } /* - * action_check - Action‚Ěƒ`ƒFƒbƒN + * action_check - Actionのチェック */ static BOOL action_check(const int type) { int i; - // “Žě‚ĚŒŸő + // 動作の検索 + // Search for behavior for (i = 0; i < option.action_cnt; i++) { if (type == (option.action_info + i)->type && (option.action_info + i)->enable != 0) { return TRUE; @@ -756,7 +809,7 @@ static BOOL action_check(const int type) } /* - * clipboard_to_history - ƒNƒŠƒbƒvƒ{[ƒh‚Ě“ŕ—e‚đ—š—đ‚ɒljÁ + * clipboard_to_history - クリップボードの内容を履歴に追加 */ static BOOL clipboard_to_history(const HWND hWnd) { @@ -766,7 +819,8 @@ static BOOL clipboard_to_history(const HWND hWnd) CopyMemory(&cp_tmi, &tmi, sizeof(TOOL_MENU_INFO)); - // œŠOƒEƒBƒ“ƒhƒE‚Ěƒ`ƒFƒbƒN + // 除外ウィンドウのチェック + // check for windows to be excluded if (window_ignore_check(GetForegroundWindow()) == FALSE) { KillTimer(hWnd, ID_HISTORY_TIMER); KillTimer(hWnd, ID_TOOL_TIMER); @@ -775,7 +829,8 @@ static BOOL clipboard_to_history(const HWND hWnd) } if (OpenClipboard(hWnd) == FALSE) { - // ƒNƒŠƒbƒvƒ{[ƒh‚Ş—˜—p‰Â”\‚ɂȂé‚܂őҋ@ + // クリップボードが利用可能になるまで待機 + // wait until the clipboard is available SetTimer(hWnd, ID_HISTORY_TIMER, RECLIP_INTERVAL, NULL); if (tmi.enable == TRUE) { SetTimer(hWnd, ID_TOOL_TIMER, option.tool_valid_interval, NULL); @@ -786,7 +841,8 @@ static BOOL clipboard_to_history(const HWND hWnd) KillTimer(hWnd, ID_TOOL_TIMER); ZeroMemory(&tmi, sizeof(TOOL_MENU_INFO)); - // ƒNƒŠƒbƒvƒ{[ƒh‚Š‚çƒAƒCƒeƒ€‚đěŹ + // クリップボードからアイテムを作成 + // create an item from the clipboard *err_str = TEXT('\0'); if ((di = clipboard_to_item(err_str)) == NULL) { CloseClipboard(); @@ -798,49 +854,61 @@ static BOOL clipboard_to_history(const HWND hWnd) } CloseClipboard(); - // —š—đ‚ɒljÁ + // 履歴に追加 + // add to history if (history_add(&history_data.child, di, (cp_tmi.enable == TRUE) ? FALSE : TRUE) == FALSE) { data_free(di); return TRUE; } - // —š—đ‚ɒljÁ‚ł‚ę‚˝Žž‚ÉŽŔs‚ˇ‚éƒc[ƒ‹ + // 履歴に追加された時に実行するツール + // tools to be executed when added to history tool_execute_all(hWnd, CALLTYPE_ADD_HISTORY, di); - // ƒƒjƒ…[‚Š‚çƒc[ƒ‹ŽŔs + // メニューからツール実行 + // execute tool from menu if (cp_tmi.enable == TRUE && (!(tool_execute(hWnd, cp_tmi.ti, CALLTYPE_MENU, di, NULL) & TOOL_CANCEL) || window_paste_check(GetForegroundWindow()) == TRUE) && data_check(&history_data, di) != NULL) { data_delete(&history_data.child, di, FALSE); - // ƒNƒŠƒbƒvƒ{[ƒh‚Ƀf[ƒ^‚đ‘—‚é + // クリップボードにデータを送る + // send data to clipboard SendMessage(hWnd, WM_ITEM_TO_CLIPBOARD, 0, (LPARAM)di); data_free(di); if (cp_tmi.paste != 0 && cp_tmi.ti != NULL && cp_tmi.ti->copy_paste == 1) { - // ƒL[‚đ—Ł‚ˇ‚܂őҋ@ + // キーを離すまで待機 + // wait until the key is released key_wait(); - // ƒzƒbƒgƒL[‚Ě‰đœ + // ホットキーの解除 + // unregister hotkey unregist_hotkey(hWnd); - // “\‚č•t‚Ż + // 貼り付け + // paste sendkey_paste(GetForegroundWindow()); - // ƒzƒbƒgƒL[‚Ě“o˜^ + // ホットキーの登録 + // register hotkey regist_hotkey(hWnd, FALSE); } } - // ƒ^ƒXƒNƒgƒŒƒC‚Ěƒc[ƒ‹ƒ`ƒbƒvÝ’č + // タスクトレイのツールチップ設定 + // Tooltip tray settings set_tray_tooltip(hWnd); if (option.history_save == 1 && option.history_always_save == 1) { - // —š—đ‚̕ۑś + // 履歴の保存 + // Save history SendMessage(hWnd, WM_HISTORY_SAVE, 0, 0); } - // —š—đ‚̕ωť‚đ’Ę’m + // 履歴の変化を通知 + // Notify history has changed SendMessage(hWnd, WM_HISTORY_CHANGED, 0, 0); return TRUE; } /* - * item_to_clipboard - ƒAƒCƒeƒ€‚đƒNƒŠƒbƒvƒ{[ƒh‚É‘—‚é + * item_to_clipboard - アイテムをクリップボードに送る + * Send an item to the clipboard */ static BOOL item_to_clipboard(const HWND hWnd, DATA_INFO *from_di, const BOOL delete_flag) { @@ -848,7 +916,8 @@ static BOOL item_to_clipboard(const HWND hWnd, DATA_INFO *from_di, const BOOL de TCHAR err_str[BUF_SIZE]; int call_type = CALLTYPE_ITEM_TO_CLIPBOARD; - // ƒf[ƒ^‚ĚƒRƒs[ + // データのコピー + // Copy data if ((di = data_item_copy(from_di, FALSE, FALSE, err_str)) == NULL) { if (*err_str != TEXT('\0')) { _SetForegroundWindow(hWnd); @@ -861,18 +930,18 @@ static BOOL item_to_clipboard(const HWND hWnd, DATA_INFO *from_di, const BOOL de call_type |= CALLTYPE_HISTORY; } else if (data_check(®ist_data, from_di) != NULL) { call_type |= CALLTYPE_REGIST; - // “o˜^ƒAƒCƒeƒ€‚đ—š—đ‚É“ü‚ę‚Č‚˘ + // 登録アイテムを履歴に入れない if (option.history_ignore_regist_item == 1) { clip_flag = TRUE; } } - // ƒf[ƒ^‚đƒNƒŠƒbƒvƒ{[ƒh‚É‘—‚鎞‚ÉŽŔs‚ˇ‚éƒc[ƒ‹ + // データをクリップボードに送る時に実行するツール if (tool_execute_all(hWnd, call_type, di) & TOOL_CANCEL) { data_free(di); return FALSE; } - // ƒNƒŠƒbƒvƒ{[ƒh‚É‘—‚é + // クリップボードに送る *err_str = TEXT('\0'); if (clipboard_set_datainfo(hWnd, di, err_str) == FALSE && *err_str != TEXT('\0')) { @@ -887,16 +956,16 @@ static BOOL item_to_clipboard(const HWND hWnd, DATA_INFO *from_di, const BOOL de if (clip_flag == TRUE) { clip_flag = FALSE; if (hViewerWnd != NULL) { - // ƒNƒŠƒbƒvƒ{[ƒh‚̕ωť‚đ’Ę’m + // クリップボードの変化を通知 SendMessage(hViewerWnd, WM_VIEWER_CHANGE_CLIPBOARD, 0, 0); } } if ((call_type & CALLTYPE_HISTORY) && delete_flag == TRUE && option.history_delete == 1 && from_di->type == TYPE_ITEM && window_ignore_check(GetForegroundWindow()) == TRUE) { - // —š—đíœ + // 履歴削除 if (data_delete(&history_data.child, from_di, TRUE) == TRUE) { - // —š—đ‚̕ωť‚đ’Ę’m + // 履歴の変化を通知 SendMessage(hWnd, WM_HISTORY_CHANGED, 0, 0); } } @@ -904,7 +973,7 @@ static BOOL item_to_clipboard(const HWND hWnd, DATA_INFO *from_di, const BOOL de } /* - * load_history - —š—đ‚Ě“Ç‚Ýž‚Ý + * load_history - 幼歴ぎ読み螟み */ static BOOL load_history(const HWND hWnd, const int load_flag) { @@ -913,7 +982,7 @@ static BOOL load_history(const HWND hWnd, const int load_flag) history_data.type = TYPE_ROOT; - // —š—đ‚Ě“Ç‚Ýž‚Ý + // 幼歴ぎ読み螟み if (load_flag != 0 || option.history_save == 1) { wsprintf(path, TEXT("%s\\%s"), work_path, HISTORY_FILENAME); *err_str = TEXT('\0'); @@ -929,7 +998,7 @@ static BOOL load_history(const HWND hWnd, const int load_flag) } /* - * load_regist - “o˜^ƒAƒCƒeƒ€‚Ě“Ç‚Ýž‚Ý + * load_regist - 登録アイテムの読み込み */ static BOOL load_regist(const HWND hWnd) { @@ -938,7 +1007,7 @@ static BOOL load_regist(const HWND hWnd) regist_data.type = TYPE_ROOT; - // “o˜^ƒAƒCƒeƒ€‚Ě“Ç‚Ýž‚Ý + // 登録アイテムの読み込み wsprintf(path, TEXT("%s\\%s"), work_path, REGIST_FILENAME); *err_str = TEXT('\0'); if (file_read_data(path, ®ist_data.child, err_str) == FALSE && *err_str != TEXT('\0')) { @@ -952,7 +1021,7 @@ static BOOL load_regist(const HWND hWnd) } /* - * save_history - —š—đ‚̕ۑś + * save_history - 履歴の保存 */ static BOOL save_history(const HWND hWnd, const int save_flag) { @@ -961,17 +1030,17 @@ static BOOL save_history(const HWND hWnd, const int save_flag) TCHAR err_str[BUF_SIZE + MAX_PATH]; if (save_flag == 0 && option.history_save == 0) { - // —š—đ‚đ•Ű‘ś‚ľ‚Č‚˘ + // 履歴を保存しない wsprintf(path, TEXT("%s\\%s"), work_path, HISTORY_FILENAME); DeleteFile(path); return TRUE; } - // •Ű‘śƒtƒBƒ‹ƒ^‚Ěƒ`ƒFƒbƒN + // 保存フィルタのチェック if (filter_list_save_check(history_data.child) == FALSE) { di = history_data.child; } else { - // •Ű‘śƒtƒBƒ‹ƒ^‚đ‚Š‚Ż‚˝ƒAƒCƒeƒ€ƒŠƒXƒg‚đěŹ + // 保存フィルタをかけたアイテムリストを作成 if ((di = filter_list_copy(history_data.child, err_str)) == NULL) { if (*err_str != TEXT('\0')) { _SetForegroundWindow(hWnd); @@ -981,7 +1050,7 @@ static BOOL save_history(const HWND hWnd, const int save_flag) } } - // —š—đ‚̕ۑś + // 履歴の保存 wsprintf(path, TEXT("%s\\%s"), work_path, HISTORY_FILENAME); *err_str = TEXT('\0'); if (file_write_data(path, di, err_str) == FALSE) { @@ -1003,14 +1072,14 @@ static BOOL save_history(const HWND hWnd, const int save_flag) } /* - * save_regist - “o˜^ƒAƒCƒeƒ€‚̕ۑś + * save_regist - 登録アイテムの保存 */ static BOOL save_regist(const HWND hWnd) { TCHAR path[MAX_PATH]; TCHAR err_str[BUF_SIZE + MAX_PATH]; - // “o˜^ƒAƒCƒeƒ€‚̕ۑś + // 登録アイテムの保存 wsprintf(path, TEXT("%s\\%s"), work_path, REGIST_FILENAME); *err_str = TEXT('\0'); if (file_write_data(path, regist_data.child, err_str) == FALSE) { @@ -1026,7 +1095,7 @@ static BOOL save_regist(const HWND hWnd) } /* - * regist_hotkey - ƒzƒbƒgƒL[‚Ě“o˜^ + * regist_hotkey - ホットキーの登録 */ static void regist_hotkey(const HWND hWnd, const BOOL show_err) { @@ -1058,13 +1127,13 @@ static void regist_hotkey(const HWND hWnd, const BOOL show_err) } if (hk_err == TRUE && option.action_show_hotkey_error == 1 && show_err == TRUE) { - // “o˜^ƒGƒ‰[ + // 登録エラー MessageBox(hWnd, message_get_res(IDS_ERROR_HOTKEY), ERROR_TITLE, MB_ICONERROR); } } /* - * unregist_hotkey - ƒzƒbƒgƒL[‚Ě‰đœ + * unregist_hotkey - ホットキーの解除 */ static void unregist_hotkey(const HWND hWnd) { @@ -1087,7 +1156,7 @@ static void unregist_hotkey(const HWND hWnd) } /* - * regist_hook - ƒtƒbƒN‚Ě“o˜^ + * regist_hook - フックの登録 */ static void regist_hook(const HWND hWnd) { @@ -1095,7 +1164,7 @@ static void regist_hook(const HWND hWnd) TCHAR err_str[BUF_SIZE]; int i; - // ƒtƒbƒN‚Ě“o˜^ + // フックの登録 for (i = 0; i < option.action_cnt; i++) { if ((option.action_info + i)->enable != 0 && ((option.action_info + i)->type == ACTION_TYPE_CTRL_CTRL || @@ -1128,13 +1197,13 @@ static void regist_hook(const HWND hWnd) } /* - * unregist_hook - ƒtƒbƒN‚Ě‰đœ + * unregist_hook - フックの解除 */ static void unregist_hook(void) { FARPROC UnHook; - // ƒtƒbƒN‚Ě‰đœ + // フックの解除 if (hook_lib != NULL) { UnHook = GetProcAddress(hook_lib, "UnHook"); if (UnHook != NULL) { @@ -1146,7 +1215,7 @@ static void unregist_hook(void) } /* - * winodw_initialize - ƒEƒBƒ“ƒhƒE‚̏‰Šú‰ť + * winodw_initialize - ウィンドウの初期化 */ static BOOL winodw_initialize(const HWND hWnd) { @@ -1154,29 +1223,29 @@ static BOOL winodw_initialize(const HWND hWnd) *err_str = TEXT('\0'); - // Œ`ŽŽî•ń‚̏‰Šú‰ť + // 形式情報の初期化 if (format_initialize(err_str) == FALSE && *err_str != TEXT('\0')) { _SetForegroundWindow(hWnd); MessageBox(hWnd, err_str, ERROR_TITLE, MB_ICONERROR); } - // ƒc[ƒ‹î•ń‚̏‰Šú‰ť + // ツール情報の初期化 if (tool_initialize(err_str) == FALSE && *err_str != TEXT('\0')) { _SetForegroundWindow(hWnd); MessageBox(hWnd, err_str, ERROR_TITLE, MB_ICONERROR); } - // —š—đ‚Ě“Ç‚Ýž‚Ý + // 幼歴ぎ読み螟み if (load_history(hWnd, 0) == FALSE) { return FALSE; } - // “o˜^ƒAƒCƒeƒ€‚Ě“Ç‚Ýž‚Ý + // 登録アイテムの読み込み if (load_regist(hWnd) == FALSE) { return FALSE; } - // ƒc[ƒ‹ƒ`ƒbƒv‚̍쐬 + // ツールチップの作成 hToolTip = tooltip_create(hInst); - // ƒ^ƒXƒNƒgƒŒƒC‚ɃAƒCƒRƒ“‚đ“o˜^ + // タスクトレイにアイコンを登録 if (GetAwareness() != PROCESS_DPI_UNAWARE && GetScale() >= 300) { icon_clip = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_CLIP), IMAGE_ICON, 48, 48, 0); @@ -1198,37 +1267,37 @@ static BOOL winodw_initialize(const HWND hWnd) icon_tray = (option.main_clipboard_watch == 1) ? icon_clip : icon_clip_ban; set_tray_icon(hWnd, icon_tray, MAIN_WINDOW_TITLE); - // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“‚Ě“Ç‚Ýž‚Ý + // メニューに表示するアイコンの読み込み icon_menu_default = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_DEFAULT), IMAGE_ICON, SICONSIZE, SICONSIZE, 0); icon_menu_folder = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON_FOLDER), IMAGE_ICON, SICONSIZE, SICONSIZE, 0); - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹ŠJŽn + // クリップボード監視開始 if (option.main_clipboard_watch == 1) { hClipNextWnd = SetClipboardViewer(hWnd); SetTimer(hWnd, ID_RECHAIN_TIMER, RECHAIN_INTERVAL, NULL); } - // ƒzƒbƒgƒL[‚Ě“o˜^ + // ホットキーの登録 regist_hotkey(hWnd, TRUE); - // ƒtƒbƒN‚Ě“o˜^ + // フックの登録 regist_hook(hWnd); - // ‹N“ŽŽž‚ÉŽŔs‚ˇ‚éƒc[ƒ‹ + // 起動時に実行するツール tool_execute_all(hWnd, CALLTYPE_START, NULL); - // ƒrƒ…[ƒA•\ŽŚ + // ビューア表示 if (option.main_show_viewer == 1) { SendMessage(hWnd, WM_COMMAND, ID_MENUITEM_VIEWER, 0); } - // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ˆ— + // コマンドライン処理 commnad_line_func(FindWindow(MAIN_WND_CLASS, MAIN_WINDOW_TITLE)); return TRUE; } /* - * winodw_reset - Ý’čÄ“ǂݍž‚Ý + * winodw_reset - 設定再読み込み */ static BOOL winodw_reset(const HWND hWnd) { @@ -1246,40 +1315,40 @@ static BOOL winodw_reset(const HWND hWnd) SendMessage(hViewerWnd, WM_CLOSE, 0, 0); } - // ƒzƒbƒgƒL[‚Ě‰đœ + // ホットキーの解除 unregist_hotkey(hWnd); - // ƒtƒbƒN‚Ě‰đœ + // フックの解除 unregist_hook(); - // ƒAƒCƒeƒ€‚Ěƒƒjƒ…[î•ń‚đ‰đ•ú + // アイテムのメニュー情報を解放 data_menu_free(history_data.child); data_menu_free(regist_data.child); - // Œ`ŽŽî•ń‚̉đ•ú + // 形式情報の解放 format_free(); - // Ý’č‚̉đ•ú + // 設定の解放 ini_free(); - // Ý’č‚Ě“Ç‚Ýž‚Ý + // 設定の読み込み get_work_path(hInst); if (ini_get_option(err_str) == FALSE) { MessageBox(hWnd, err_str, ERROR_TITLE, MB_ICONERROR); return FALSE; } - // Œ`ŽŽî•ń‚̏‰Šú‰ť + // 形式情報の初期化 if (format_initialize(err_str) == FALSE && *err_str != TEXT('\0')) { _SetForegroundWindow(hWnd); MessageBox(hWnd, err_str, ERROR_TITLE, MB_ICONERROR); } - // ƒc[ƒ‹î•ń‚̏‰Šú‰ť + // ツール情報の初期化 if (tool_initialize(err_str) == FALSE && *err_str != TEXT('\0')) { _SetForegroundWindow(hWnd); MessageBox(hWnd, err_str, ERROR_TITLE, MB_ICONERROR); } - // ƒzƒbƒgƒL[‚Ě“o˜^ + // ホットキーの登録 regist_hotkey(hWnd, TRUE); - // ƒtƒbƒN‚Ě“o˜^ + // フックの登録 regist_hook(hWnd); SetTimer(hWnd, ID_RECHAIN_TIMER, RECHAIN_INTERVAL, NULL); @@ -1293,30 +1362,30 @@ static BOOL winodw_reset(const HWND hWnd) } /* - * winodw_save - ƒEƒBƒ“ƒhƒE‚̕ۑśˆ— + * winodw_save - ウィンドウの保存処理 */ static BOOL winodw_save(const HWND hWnd) { - // I—šŽž‚ÉŽŔs‚ˇ‚éƒc[ƒ‹ + // 終了時に実行するツール tool_execute_all(hWnd, CALLTYPE_END, NULL); - // “o˜^ƒAƒCƒeƒ€‚̕ۑś + // 登録アイテムの保存 if (save_regist(hWnd) == FALSE && MessageBox(hWnd, message_get_res(IDS_ERROR_END), ERROR_TITLE, MB_ICONQUESTION | MB_YESNO) == IDNO) { return FALSE; } - // —š—đ‚̕ۑś + // 履歴の保存 if (save_history(hWnd, 0) == FALSE && MessageBox(hWnd, message_get_res(IDS_ERROR_END), ERROR_TITLE, MB_ICONQUESTION | MB_YESNO) == IDNO) { return FALSE; } - // Ý’č‚̕ۑś + // 設定の保存 ini_put_option(); return TRUE; } /* - * winodw_end - ƒEƒBƒ“ƒhƒE‚̏I—šˆ— + * winodw_end - ウィンドウの終了処理 */ static BOOL winodw_end(const HWND hWnd) { @@ -1328,22 +1397,22 @@ static BOOL winodw_end(const HWND hWnd) hToolTip = NULL; } - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹‰đœ + // クリップボード監視解除 KillTimer(hWnd, ID_RECHAIN_TIMER); if (option.main_clipboard_watch == 1) { ChangeClipboardChain(hWnd, hClipNextWnd); hClipNextWnd = NULL; } - // ƒzƒbƒgƒL[‚Ě‰đœ + // ホットキーの解除 unregist_hotkey(hWnd); - // ƒtƒbƒN‚Ě‰đœ + // フックの解除 unregist_hook(); - // —š—đ‚̉đ•ú + // 履歴の解放 data_free(history_data.child); data_free(regist_data.child); - // Œ`ŽŽî•ń‚̉đ•ú + // 形式情報の解放 format_free(); #ifdef OP_XP_STYLE @@ -1361,7 +1430,7 @@ static BOOL winodw_end(const HWND hWnd) } /* - * main_proc - ƒƒCƒ“ƒEƒBƒ“ƒhƒEƒvƒƒV[ƒWƒƒ + * main_proc - メインウィンドウプロシージャ */ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -1373,14 +1442,14 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa switch (msg) { case WM_CREATE: WM_TASKBARCREATED = RegisterWindowMessage(TEXT("TaskbarCreated")); - // ƒEƒBƒ“ƒhƒEěŹ + // ウィンドウ作成 if (winodw_initialize(hWnd) == FALSE) { return -1; } break; case WM_QUERYENDSESSION: - // WindowsI—š + // Windows終了 if (winodw_save(hWnd) == FALSE) { return FALSE; } @@ -1388,13 +1457,13 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return TRUE; case WM_ENDSESSION: - // WindowsI—š + // Windows終了 winodw_end(hWnd); DestroyWindow(hWnd); return 0; case WM_CLOSE: - // ƒEƒBƒ“ƒhƒE‚đ•‚ś‚é + // ウィンドウを閉じる if (winodw_save(hWnd) == FALSE) { break; } @@ -1404,7 +1473,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_DESTROY: - // ƒEƒBƒ“ƒhƒE‚Ě”jŠü + // ウィンドウの破棄 if (save_flag == FALSE) { winodw_save(hWnd); } @@ -1412,14 +1481,14 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_MEASUREITEM: - // ƒƒjƒ…[•`‰ćÝ’č + // メニュー描画設定 if (wParam == 0) { menu_set_drawitem((MEASUREITEMSTRUCT *)lParam); } break; case WM_DRAWITEM: - // ƒƒjƒ…[•`‰ć + // メニュー描画 if (wParam == 0) { HWND menu_wnd; @@ -1428,7 +1497,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa set_menu_layerer(menu_wnd, option.menu_alpha); #endif if (((DRAWITEMSTRUCT *)lParam)->itemState & ODS_SELECTED) { - // ƒc[ƒ‹ƒ`ƒbƒv‚Ě•\ŽŚˆĘ’u‚đÝ’č + // ツールチップの表示位置を設定 menu_sel_pt.x = ((DRAWITEMSTRUCT *)lParam)->rcItem.left + (((DRAWITEMSTRUCT *)lParam)->rcItem.right - ((DRAWITEMSTRUCT *)lParam)->rcItem.left) / 2; menu_sel_pt.y = ((DRAWITEMSTRUCT *)lParam)->rcItem.top; @@ -1446,32 +1515,32 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_MENUCHAR: - // ƒƒjƒ…[ƒAƒNƒZƒ‰ƒŒ[ƒ^ + // メニューアクセラレータ if (HIWORD(wParam) == MF_POPUP) { return menu_accelerator((HMENU)lParam, (TCHAR)LOWORD(wParam)); } break; case WM_MENUSELECT: - // ‘I‘đƒƒjƒ…[‚Ěƒc[ƒ‹ƒ`ƒbƒv•\ŽŚ + // 選択メニューのツールチップ表示 if (option.menu_show_tooltip == 0 || (UINT)LOWORD(wParam) == 0xFFFF || (UINT)HIWORD(wParam) & MF_SEPARATOR) { tooltip_hide(hToolTip); break; } - // ƒc[ƒ‹ƒ`ƒbƒv‚đ•\ŽŚ + // ツールチップを表示 show_menu_tooltip(hToolTip, (HMENU)lParam, (UINT)LOWORD(wParam), ((UINT)HIWORD(wParam) & MF_MOUSESELECT) ? TRUE : FALSE); break; case WM_EXITMENULOOP: - // ƒc[ƒ‹ƒ`ƒbƒv‚đ”ń•\ŽŚ + // ツールチップを非表示 tooltip_hide(hToolTip); break; case WM_CHANGECBCHAIN: - // ƒNƒŠƒbƒvƒ{[ƒhƒ`ƒF[ƒ“‚Ě•ĎX + // クリップボードチェーンの変更 if ((HWND)wParam == hClipNextWnd && (HWND)lParam != hWnd) { hClipNextWnd = (HWND)lParam; } else if (hClipNextWnd != NULL && hClipNextWnd != hWnd) { @@ -1480,15 +1549,15 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_DRAWCLIPBOARD: - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹ + // クリップボード監視 if (hClipNextWnd != NULL && hClipNextWnd != hWnd) { SendMessage(hClipNextWnd, msg, wParam, lParam); } if (clip_flag == TRUE) { - // —š—đ‚É“ü‚ę‚Č‚˘ + // 履歴に入れない break; } - // —š—đ‚ɒljÁ + // 履歴に追加 SetTimer(hWnd, ID_HISTORY_TIMER, option.history_add_interval, NULL); SetTimer(hWnd, ID_RECHAIN_TIMER, RECHAIN_INTERVAL, NULL); rechain_cnt = 0; @@ -1497,12 +1566,13 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_COMMAND: switch (LOWORD(wParam)) { case ID_MENUITEM_EXIT: - // I—š + // 終了 + // exit SendMessage(hWnd, WM_CLOSE, 0, 0); break; case ID_MENUITEM_VIEWER: - // ƒrƒ…[ƒA + // ビューア if (hViewerWnd != NULL) { if (option.viewer_toggle == 1) { SendMessage(hViewerWnd, WM_CLOSE, 0, 0); @@ -1521,30 +1591,30 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case ID_MENUITEM_OPTION: - // ƒIƒvƒVƒ‡ƒ“ + // オプション SendMessage(hWnd, WM_OPTION_SHOW, 0, 0); break; case ID_MENUITEM_CLIPBOARD_WATCH: - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹Ř‚č‘Ö‚Ś + // クリップボード監視切り替え SendMessage(hWnd, WM_SET_CLIPBOARD_WATCH, !option.main_clipboard_watch, 0); break; } break; case WM_TIMER: - // ƒ^ƒCƒ}[ + // タイマー switch (wParam) { case ID_HISTORY_TIMER: - // ƒNƒŠƒbƒvƒ{[ƒh‚Ěƒf[ƒ^‚đ—š—đ‚ɒljÁ + // クリップボードのデータを履歴に追加 if (clipboard_to_history(hWnd) == TRUE && hViewerWnd != NULL) { - // ƒNƒŠƒbƒvƒ{[ƒh‚̕ωť‚đ’Ę’m + // クリップボードの変化を通知 SendMessage(hViewerWnd, WM_VIEWER_CHANGE_CLIPBOARD, 0, 0); } break; case ID_RECHAIN_TIMER: - // ƒNƒŠƒbƒvƒ{[ƒhÄŠÄŽ‹ + // クリップボード再監視 if (option.main_clipboard_watch == 0 || option.main_clipboard_rechain_minute <= 0) { KillTimer(hWnd, wParam); @@ -1554,13 +1624,13 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa if (rechain_cnt >= option.main_clipboard_rechain_minute) { rechain_cnt = 0; if (GetClipboardViewer() == hWnd) { - // ÄŠÄŽ‹‚Ě•K—v‚Č‚ľ + // 再監視の必要なし break; } - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹‰đœ + // クリップボード監視解除 ChangeClipboardChain(hWnd, hClipNextWnd); hClipNextWnd = NULL; - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹ŠJŽn + // クリップボード監視開始 clip_flag = TRUE; hClipNextWnd = SetClipboardViewer(hWnd); clip_flag = FALSE; @@ -1568,13 +1638,13 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case ID_TOOL_TIMER: - // ƒc[ƒ‹ƒLƒƒƒ“ƒZƒ‹ + // ツールキャンセル KillTimer(hWnd, wParam); ZeroMemory(&tmi, sizeof(TOOL_MENU_INFO)); break; case ID_PASTE_TIMER: - // “o˜^ƒAƒCƒeƒ€‚𒟐ړ\‚č•t‚Ż + // 登録アイテムを直接貼り付け if (paste_di == NULL) { KillTimer(hWnd, wParam); break; @@ -1588,24 +1658,24 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa } KillTimer(hWnd, wParam); - // ƒf[ƒ^‚đƒNƒŠƒbƒvƒ{[ƒh‚É‘—‚é + // データをクリップボードに送る SendMessage(hWnd, WM_ITEM_TO_CLIPBOARD, 0, (LPARAM)paste_di); if (paste_di->op_paste == 1) { - // ƒzƒbƒgƒL[‚Ě‰đœ + // ホットキーの解除 unregist_hotkey(hWnd); - // “\‚č•t‚Ż + // 貼り付け sendkey_paste(GetForegroundWindow()); - // ƒzƒbƒgƒL[‚Ě“o˜^ + // ホットキーの登録 regist_hotkey(hWnd, FALSE); } paste_di = NULL; break; case ID_KEY_TIMER: - // ƒL[‚Q‰ń‰Ÿ‚ľ—p + // キー2回押し用 KillTimer(hWnd, wParam); if (key_cnt > 1) { - // ƒL[‚Ş‚Q‰ń‰Ÿ‚ł‚ę‚˝Žž‚Ě“ŽěŒÄ‚яo‚ľ + // キーが2回押された時の動作呼び出し switch (prev_key) { case VK_CONTROL: action_execute(hWnd, ACTION_TYPE_CTRL_CTRL, 0, TRUE); @@ -1624,7 +1694,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case ID_LCLICK_TIMER: - // ƒ^ƒXƒNƒgƒŒƒCśƒNƒŠƒbƒN + // タスクトレイ左クリック if (GetAsyncKeyState(VK_LBUTTON) < 0) { SetTimer(hWnd, ID_LCLICK_TIMER, 1, NULL); break; @@ -1634,7 +1704,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case ID_RCLICK_TIMER: - // ƒ^ƒXƒNƒgƒŒƒC‰EƒNƒŠƒbƒN + // タスクトレイ右クリック if (GetAsyncKeyState(VK_RBUTTON) < 0) { SetTimer(hWnd, ID_RCLICK_TIMER, 1, NULL); break; @@ -1646,10 +1716,10 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_TRAY_NOTIFY: - // ƒ^ƒXƒNƒgƒŒƒCƒƒbƒZ[ƒW + // タスクトレイメッセージ switch (LOWORD(lParam)) { case WM_LBUTTONDOWN: - // śƒ_ƒuƒ‹ƒNƒŠƒbƒN”ť’č—p‚Ěƒ^ƒCƒ}[ + // 左ダブルクリック判定用のタイマー SetTimer(hWnd, ID_LCLICK_TIMER, (action_check(ACTION_TYPE_TRAY_LEFT_DBLCLK) == TRUE) ? GetDoubleClickTime() : 1, NULL); break; @@ -1660,7 +1730,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_RBUTTONDOWN: - // ‰Eƒ_ƒuƒ‹ƒNƒŠƒbƒN”ť’č—p‚Ěƒ^ƒCƒ}[ + // 右ダブルクリック判定用のタイマー SetTimer(hWnd, ID_RCLICK_TIMER, (action_check(ACTION_TYPE_TRAY_RIGHT_DBLCLK) == TRUE) ? GetDoubleClickTime() : 1, NULL); break; @@ -1676,12 +1746,12 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa POINT pt; active_wnd = GetForegroundWindow(); - // ƒ^ƒXƒNƒo[‚Ě”ť’č + // タスクバーの判定 GetCursorPos(&pt); mouse_wnd = WindowFromPoint(pt); while (mouse_wnd != NULL && mouse_wnd != active_wnd) mouse_wnd = GetParent(mouse_wnd); if (active_wnd != focus_info.active_wnd && active_wnd != hWnd && active_wnd != mouse_wnd) { - // ƒtƒH[ƒJƒXî•ńŽć“ž + // フォーカス情報取得 get_focus_info(&focus_info); } } @@ -1690,7 +1760,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_KEY_HOOK: - // ƒL[ƒ{[ƒhƒtƒbƒN + // キーボードフック switch (wParam) { case VK_CONTROL: case VK_SHIFT: @@ -1716,7 +1786,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; default: - // ‘ź‚ĚƒL[‚މŸ‚ł‚ę‚˝ę‡‚Í–łŒř‚É‚ˇ‚é + // 他のキーが押された場合は無効にする if (key_flag == 1) { key_flag = -1; } @@ -1726,21 +1796,21 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_HOTKEY: - // ƒzƒbƒgƒL[ + // ホットキー action_execute(hWnd, ACTION_TYPE_HOTKEY, (int)wParam, TRUE); break; case WM_VIEWER_NOTIFY_CLOSE: - // ƒrƒ…[ƒAI—š’Ę’m + // ビューア終了通知 hViewerWnd = NULL; break; case WM_GET_VERSION: - // ƒo[ƒWƒ‡ƒ“Žć“ž + // バージョン取得 return APP_VAR; case WM_GET_WORKPATH: - // ě‹ĆƒfƒBƒŒƒNƒgƒŠŽć“ž + // 作業ディレクトリ取得 if (lParam == 0) { break; } @@ -1748,22 +1818,22 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_GET_CLIPBOARD_WATCH: - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹ó‘Ԃ̎擞 + // クリップボード監視状態の取得 return option.main_clipboard_watch; case WM_SET_CLIPBOARD_WATCH: - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹Ř‚č‘Ö‚Ś + // クリップボード監視切り替え ZeroMemory(&tmi, sizeof(TOOL_MENU_INFO)); if (wParam != 0) { option.main_clipboard_watch = 1; icon_tray = icon_clip; - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹ŠJŽn + // クリップボード監視開始 hClipNextWnd = SetClipboardViewer(hWnd); SetTimer(hWnd, ID_RECHAIN_TIMER, RECHAIN_INTERVAL, NULL); } else { option.main_clipboard_watch = 0; icon_tray = icon_clip_ban; - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹‰đœ + // クリップボード監視解除 KillTimer(hWnd, ID_RECHAIN_TIMER); ChangeClipboardChain(hWnd, hClipNextWnd); hClipNextWnd = NULL; @@ -1775,7 +1845,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_GET_FORMAT_ICON: - // Œ`ŽŽ—pƒAƒCƒRƒ“‚̎擞 + // 形式用アイコンの取得 if (lParam != 0) { HICON hIcon, ret; BOOL free_icon = TRUE; @@ -1793,22 +1863,22 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return 0; case WM_ENABLE_ACCELERATOR: - // ƒAƒNƒZƒ‰ƒŒ[ƒ^‚Ě—LŒřE–łŒř‚̐؂č‘Ö‚Ś + // アクセラレータの有効・無効の切り替え accel_flag = (BOOL)wParam; break; case WM_REGIST_HOTKEY: - // ƒzƒbƒgƒL[‚Ě“o˜^ + // ホットキーの登録 regist_hotkey(hWnd, TRUE); break; case WM_UNREGIST_HOTKEY: - // ƒzƒbƒgƒL[‚Ě‰đœ + // ホットキーの解除 unregist_hotkey(hWnd); break; case WM_OPTION_SHOW: - // ƒIƒvƒVƒ‡ƒ“•\ŽŚ + // オプション表示 { TCHAR buf[MAX_PATH]; @@ -1818,21 +1888,21 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_OPTION_GET: - // ƒIƒvƒVƒ‡ƒ“‚̎擞 + // オプションの取得 return (LRESULT)&option; case WM_OPTION_LOAD: - // Ý’č‚Ě“Ç‚Ýž‚Ý + // 設定の読み込み winodw_reset(hWnd); break; case WM_OPTION_SAVE: - // Ý’č‚̕ۑś + // 設定の保存 ini_put_option(); break; case WM_HISTORY_CHANGED: - // —š—đ‚Ě“ŕ—e•ωť + // 履歴の内容変化 if (hViewerWnd != NULL) { return SendMessage(hViewerWnd, msg, wParam, lParam); } else { @@ -1841,11 +1911,11 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_HISTORY_GET_ROOT: - // —š—đƒAƒCƒeƒ€‚̎擞 + // 履歴アイテムの取得 return (LRESULT)&history_data; case WM_HISTORY_LOAD: - // —š—đ‚Ě“Ç‚Ýž‚Ý + // 幼歴ぎ読み螟み if (wParam == 0 && option.history_save == 0) { return TRUE; } @@ -1854,11 +1924,11 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return load_history(hWnd, wParam); case WM_HISTORY_SAVE: - // —š—đ‚̕ۑś + // 履歴の保存 return save_history(hWnd, wParam); case WM_REGIST_CHANGED: - // “o˜^ƒAƒCƒeƒ€‚Ě“ŕ—e•ωť + // 登録アイテムの内容変化 if (hViewerWnd != NULL) { return SendMessage(hViewerWnd, msg, wParam, lParam); } else { @@ -1867,40 +1937,43 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_REGIST_GET_ROOT: - // “o˜^ƒAƒCƒeƒ€‚̎擞 + // 登録アイテムの取得 return (LRESULT)®ist_data; case WM_REGIST_LOAD: - // “o˜^ƒAƒCƒeƒ€‚Ě“Ç‚Ýž‚Ý + // 登録アイテムの読み込み data_free(regist_data.child); regist_data.child = NULL; return load_regist(hWnd); case WM_REGIST_SAVE: - // “o˜^ƒAƒCƒeƒ€‚̕ۑś + // 登録アイテムの保存 return save_regist(hWnd); case WM_ITEM_TO_CLIPBOARD: - // ƒf[ƒ^‚đƒNƒŠƒbƒvƒ{[ƒh‚ɐݒč + // データをクリップボードに設定 if (lParam == 0) { return FALSE; } return item_to_clipboard(hWnd, (DATA_INFO *)lParam, (wParam == 0) ? TRUE : FALSE); case WM_ITEM_CREATE: - // ƒAƒCƒeƒ€‚̍쐬 + // アイテムの作成 / create an item switch (wParam) { case TYPE_DATA: - // ƒf[ƒ^‚̍쐬 + // データの作成 + // create data with format_name specified in lParam if (lParam == 0) { return 0; } return (LRESULT)data_create_data(0, (TCHAR *)lParam, NULL, 0, TRUE, NULL); case TYPE_ITEM: - // ƒAƒCƒeƒ€‚̍쐬 + // アイテムの作成 + // create an item with title specified in lParam return (LRESULT)data_create_item((TCHAR *)lParam, TRUE, NULL); case TYPE_FOLDER: - // ƒtƒHƒ‹ƒ_‚̍쐬 + // フォルダの作成 + // create a folder with title specified in lParam if (lParam == 0) { return 0; } @@ -1909,14 +1982,14 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return 0; case WM_ITEM_COPY: - // ƒAƒCƒeƒ€‚ĚƒRƒs[ + // アイテムのコピー if (lParam == 0) { return 0; } return (LRESULT)data_item_copy((DATA_INFO *)lParam, (BOOL)wParam, FALSE, NULL); case WM_ITEM_FREE: - // ƒAƒCƒeƒ€‚̉đ•ú + // アイテムの解放 if ((DATA_INFO *)lParam == &history_data || (DATA_INFO *)lParam == ®ist_data) { break; @@ -1925,7 +1998,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_ITEM_FREE_DATA: - // ƒf[ƒ^‚̉đ•ú + // データの解放 if (wParam == 0 || lParam == 0) { break; } @@ -1935,7 +2008,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_ITEM_CHECK: - // ƒAƒCƒeƒ€‚Ě‘śÝƒ`ƒFƒbƒN + // アイテムの存在チェック if (data_check(&history_data, (DATA_INFO *)lParam) != NULL) { return 0; } @@ -1945,7 +2018,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return -1; case WM_ITEM_TO_BYTES: - // ƒAƒCƒeƒ€‚Š‚çƒoƒCƒg—ń‚đŽć“ž + // アイテムからバイト列を取得 if (lParam != 0) { BYTE *ret; @@ -1957,7 +2030,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_ITEM_FROM_BYTES: - // ƒoƒCƒg—ń‚Š‚çƒf[ƒ^‚đěŹ‚ľƒAƒCƒeƒ€‚ɐݒč + // バイト列からデータを作成しアイテムに設定 if (lParam == 0) { break; } @@ -1975,7 +2048,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_ITEM_TO_FILE: - // ƒAƒCƒeƒ€‚đƒtƒ@ƒCƒ‹‚ɕۑś + // アイテムをファイルに保存 if (lParam != 0) { TCHAR err_str[BUF_SIZE]; @@ -1993,7 +2066,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return FALSE; case WM_ITEM_FROM_FILE: - // ƒtƒ@ƒCƒ‹‚Š‚çƒf[ƒ^‚đěŹ‚ľ‚ăAƒCƒeƒ€‚ɐݒč + // ファイルからデータを作成してアイテムに設定 if (lParam != 0) { TCHAR err_str[BUF_SIZE]; @@ -2020,7 +2093,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return FALSE; case WM_ITEM_GET_PARENT: - // eƒAƒCƒeƒ€‚̎擞 + // 親アイテムの取得 { DATA_INFO *di; @@ -2034,7 +2107,8 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return (LRESULT)NULL; case WM_ITEM_GET_FORMAT_TO_ITEM: - // Œ`ŽŽ–ź‚Š‚çƒAƒCƒeƒ€‚đŽć“ž + // 形式名からアイテムを取得 + // get item by format name if (lParam != 0 && wParam != 0) { DATA_INFO *di = (DATA_INFO *)lParam; @@ -2052,21 +2126,21 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa return (LRESULT)NULL; case WM_ITEM_GET_PRIORITY_HIGHEST: - // —Dć‡ˆĘ‚̍‚‚˘Œ`ŽŽ‚ĚƒAƒCƒeƒ€‚đ‘I‘đ + // 優先順位の高い形式のアイテムを選択 return (LRESULT)format_get_priority_highest((DATA_INFO *)lParam); case WM_ITEM_GET_TITLE: - // ƒAƒCƒeƒ€‚Ěƒ^ƒCƒgƒ‹Žć“ž + // アイテムのタイトル取得 if (lParam != 0) { DATA_INFO *di; di = format_get_priority_highest((DATA_INFO *)lParam); data_menu_free_item(di); - // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒ^ƒCƒgƒ‹‚đŽć“ž + // メニューに表示するタイトルを取得 format_get_menu_title(di); - // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒAƒCƒRƒ“‚đŽć“ž + // メニューに表示するアイコンを取得 format_get_menu_icon(di); - // ƒƒjƒ…[‚É•\ŽŚ‚ˇ‚éƒrƒbƒgƒ}ƒbƒv‚đŽć“ž + // メニューに表示するビットマップを取得 format_get_menu_bitmap(di); if ((TCHAR *)wParam != NULL) { @@ -2076,36 +2150,36 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa break; case WM_ITEM_GET_OPEN_INFO: - // ƒAƒCƒeƒ€‚đŠJ‚­î•ń + // アイテムを開く情報 return format_get_file_info((TCHAR *)lParam, NULL, (OPENFILENAME *)wParam, TRUE); case WM_ITEM_GET_SAVE_INFO: - // ƒAƒCƒeƒ€‚̕ۑśî•ń + // アイテムの保存情報 return format_get_file_info(((DATA_INFO *)lParam)->format_name, (DATA_INFO *)lParam, (OPENFILENAME *)wParam, FALSE); case WM_VIEWER_SHOW: - // ƒrƒ…[ƒA•\ŽŚ + // ビューア表示 SendMessage(hWnd, WM_COMMAND, ID_MENUITEM_VIEWER, 0); break; case WM_VIEWER_GET_HWND: - // ƒrƒ…[ƒA‚ĚƒEƒBƒ“ƒhƒEƒnƒ“ƒhƒ‹‚đŽć“ž + // ビューアのウィンドウハンドルを取得 return (LRESULT)hViewerWnd; case WM_VIEWER_GET_MAIN_HWND: - // –{‘Ě‚ĚƒEƒBƒ“ƒhƒEƒnƒ“ƒhƒ‹‚đŽć“ž + // 本体のウィンドウハンドルを取得 return (LRESULT)hWnd; case WM_VIEWER_GET_SELECTION: - // ‘I‘đƒAƒCƒeƒ€‚đŽć“ž + // 選択アイテムを取得 if (hViewerWnd != NULL) { return SendMessage(hViewerWnd, msg, wParam, lParam); } return (LRESULT)NULL; case WM_VIEWER_SELECT_ITEM: - // ƒcƒŠ[ƒAƒCƒeƒ€‚đ‘I‘đ + // ツリーアイテムを選択 if (hViewerWnd != NULL) { return SendMessage(hViewerWnd, msg, wParam, lParam); } @@ -2121,7 +2195,7 @@ static LRESULT CALLBACK main_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa } /* - * copy_old_file - ‹Œƒo[ƒWƒ‡ƒ“‚Ěƒtƒ@ƒCƒ‹‚đˆÚs + * copy_old_file - 旧バージョンのファイルを移行 */ static void copy_old_file() { @@ -2133,13 +2207,13 @@ static void copy_old_file() lstrcpy(tmp_path, app_path); - // ŒťÝ‚ĚƒƒOƒCƒ“ƒ†[ƒU–ź‚̎擞 + // 現在のログインユーザ名の取得 i = BUF_SIZE - 1; if (GetUserName(user_name, &i) == FALSE) { lstrcpy(user_name, DEFAULT_USER); } - // ‹¤’ʂ̐ݒč‚đŽg—p‚ˇ‚éę‡‚Ěƒ†[ƒU–ź‚̎擞 + // 共通の設定を使用する場合のユーザ名の取得 wsprintf(general_ini_path, TEXT("%s\\%s"), app_path, GENERAL_INI); if (PathFileExists(general_ini_path) == FALSE) { if (!SUCCEEDED(SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, tmp_path))) { @@ -2188,13 +2262,13 @@ static void copy_old_file() } /* - * get_work_path - ě‹ĆƒfƒBƒŒƒNƒgƒŠ‚̍쐬 + * get_work_path - 作業ディレクトリの作成 */ static void get_work_path(const HINSTANCE hInstance) { TCHAR *p, *r; - // ƒAƒvƒŠƒP[ƒVƒ‡ƒ“‚ĚƒpƒX‚đŽć“ž + // アプリケーションのパスを取得 GetModuleFileName(hInstance, app_path, MAX_PATH - 1); for (p = r = app_path; *p != TEXT('\0'); p++) { #ifndef UNICODE @@ -2236,7 +2310,7 @@ static void get_work_path(const HINSTANCE hInstance) } /* - * commnad_line_func - ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ˆ— + * commnad_line_func - コマンドライン処理 */ static void commnad_line_func(const HWND hWnd) { @@ -2248,7 +2322,7 @@ static void commnad_line_func(const HWND hWnd) } p = GetCommandLine(); - // ŽŔsƒtƒ@ƒCƒ‹–ź‚̏œ‹Ž + // 実行ファイル名の除去 if (*p == TEXT('"')) { for (p++; *p != TEXT('\0') && *p != TEXT('"'); p++) ; @@ -2275,7 +2349,7 @@ static void commnad_line_func(const HWND hWnd) } switch (*p) { case TEXT('v'): case TEXT('V'): - // ƒrƒ…[ƒA•\ŽŚ + // ビューア表示 vWnd = (HWND)SendMessage(hWnd, WM_VIEWER_GET_HWND, 0, 0); if (vWnd == NULL) { SendMessage(hWnd, WM_VIEWER_SHOW, 0, 0); @@ -2288,17 +2362,17 @@ static void commnad_line_func(const HWND hWnd) break; case TEXT('w'): case TEXT('W'): - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹ + // クリップボード監視 SendMessage(hWnd, WM_SET_CLIPBOARD_WATCH, 1, 0); break; case TEXT('n'): case TEXT('N'): - // ƒNƒŠƒbƒvƒ{[ƒhŠÄŽ‹‰đœ + // クリップボード監視解除 SendMessage(hWnd, WM_SET_CLIPBOARD_WATCH, 0, 0); break; case TEXT('x'): case TEXT('X'): - // I—š + // 終了 SendMessage(hWnd, WM_CLOSE, 0, 0); break; } @@ -2306,7 +2380,7 @@ static void commnad_line_func(const HWND hWnd) } /* - * init_application - ƒEƒBƒ“ƒhƒEƒNƒ‰ƒX‚Ě“o˜^ + * init_application - ウィンドウクラスの登録 */ static BOOL init_application(const HINSTANCE hInstance) { @@ -2322,18 +2396,18 @@ static BOOL init_application(const HINSTANCE hInstance) wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wc.lpszMenuName = NULL; wc.lpszClassName = MAIN_WND_CLASS; - // ƒEƒBƒ“ƒhƒEƒNƒ‰ƒX‚Ě“o˜^ + // ウィンドウクラスの登録 return RegisterClass(&wc); } /* - * init_instance - ƒEƒBƒ“ƒhƒE‚̍쐬 + * init_instance - ウィンドウの作成 */ static HWND init_instance(const HINSTANCE hInstance, const int CmdShow) { HWND hWnd; - // ƒEƒBƒ“ƒhƒE‚̍쐬 + // ウィンドウの作成 hWnd = CreateWindow(MAIN_WND_CLASS, MAIN_WINDOW_TITLE, WS_OVERLAPPEDWINDOW, @@ -2346,7 +2420,7 @@ static HWND init_instance(const HINSTANCE hInstance, const int CmdShow) } /* - * WinMain - ƒƒCƒ“ + * WinMain - メイン */ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { @@ -2362,7 +2436,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL hInst = hInstance; #ifndef _DEBUG - // 2d‹N“Žƒ`ƒFƒbƒN + // 2重起動チェック InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION); SetSecurityDescriptorDacl(&sd, TRUE, 0, FALSE); sa.nLength = sizeof(SECURITY_ATTRIBUTES); @@ -2370,7 +2444,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL sa.bInheritHandle = TRUE; hMutex = CreateMutex(&sa, FALSE, MUTEX); if (GetLastError() == ERROR_ALREADY_EXISTS) { - // ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ˆ— + // コマンドライン処理 commnad_line_func(FindWindow(MAIN_WND_CLASS, MAIN_WINDOW_TITLE)); if (hMutex != NULL) { CloseHandle(hMutex); @@ -2379,13 +2453,13 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL } #endif - // DPI‚̏‰Šú‰ť + // DPIの初期化 InitDpi(); - // CommonControl‚̏‰Šú‰ť + // CommonControlの初期化 InitCommonControls(); - // OLE‚̏‰Šú‰ť + // OLEの初期化 OleInitialize(NULL); - // Ý’čŽć“ž + // 設定取得 get_work_path(hInstance); if (ini_get_option(err_str) == FALSE) { MessageBox(NULL, err_str, ERROR_TITLE, MB_ICONERROR); @@ -2395,7 +2469,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL return 0; } - // ƒrƒ…[ƒA‚Ě“o˜^ + // ビューアの登録 if (viewer_regist(hInstance) == FALSE || container_regist(hInstance) == FALSE || binview_regist(hInstance) == FALSE) { MessageBox(NULL, message_get_res(IDS_ERROR_WINDOW_INIT), ERROR_TITLE, MB_ICONERROR); @@ -2404,7 +2478,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL } return 0; } - // ƒƒCƒ“ƒEƒBƒ“ƒhƒE‚̍쐬 + // メインウィンドウの作成 if (tooltip_regist(hInstance) == FALSE || init_application(hInstance) == FALSE || init_instance(hInstance, nCmdShow) == NULL) { MessageBox(NULL, message_get_res(IDS_ERROR_WINDOW_INIT), ERROR_TITLE, MB_ICONERROR); @@ -2414,7 +2488,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL return 0; } hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELERATOR)); - // ƒEƒBƒ“ƒhƒEƒƒbƒZ[ƒWˆ— + // ウィンドウメッセージ処理 while (GetMessage(&msg, NULL, 0, 0) == TRUE) { if (accel_flag == TRUE && hViewerWnd != NULL && hViewerWnd == GetForegroundWindow() && (TranslateAccelerator(hViewerWnd, hAccel, &msg) == TRUE)) { @@ -2424,7 +2498,7 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdL DispatchMessage(&msg); } - // Ý’č‚̉đ•ú + // 設定の解放 ini_free(); OleUninitialize(); if (hMutex != NULL) { diff --git a/readme_en.txt b/readme_en.txt index d91db29..983e588 100644 --- a/readme_en.txt +++ b/readme_en.txt @@ -1,24 +1,391 @@ + CLCL Ver 2.1.3 -- -CLCL is clipboard caching utility. - -- All clipboard formats are supported. -- Template can be registered. -- Pop-up menu is displayed by "Alt+C." -- Menu can be customized. -- Item is paste automatically. -- Picture is displayed on a menu. -- Tool tip is displayed on a menu. -- The format to leave and the format to save can be set up. -- The ignored window can be set up. -- The paste key for every window can be set up. -- Function is extensible with plug-in. -- Unicode -- Freeware +■ Introduction +CLCL is a software that records clipboard history. --- -Copyright (C) 1996-2022 by Ohno Tomoaki. All rights reserved. - https://www.nakka.com/ +■ Functions + ポSupports multiple clipboard formats + ポFrequently used standard phrases can be registered as templates in a hierarchical structure + ポFreely customize the menu displayed with hotkeys + ポHistory items templates items selected from the menu can be automatically pasted into the editor being edited + ポDisplay thumbprint images in the menu + ポDisplay tooltips in the menu + ポThe format to leave and the format to save can be set up + ポIt can be configured for which windows to save or not to save history + ポThe paste key can be set up individually for every window + ポHistory is automatically saved when the program is closed and restored the next time it is started + ポNo limit on the maximum number of items that can be saved in the history + ポView and edit history and templates in an Explorer-style viewer + ポProgram is extensible by plug-ins + ポSupports Unicode + +■ Installation +Works on Windows XP and later OS. + +CLCL will be installed when you launch the downloaded file. + +Please uninstall from the Control Panel. +Please uninstall after closing CLCL. + +Data will be saved in the following folder. (For Windows 10) +C:\Users\(username)\AppData\Local\CLCL + +To save data in the same location as CLCL.exe, set clcl_app.ini as follows and then start CLCL. + +[GENERAL] +portable=1 + +■ Startup +When you start CLCL, a clip icon will be displayed in the task tray (the area with the clock in the corner of the taskbar). +Clicking on this task tray icon will display a menu. +By default, the menu displays the history in ascending order. +The menu can be customized in the settings. + +Right-clicking on the task tray icon will display the viewer. +The left side of the viewer is a tree that displays the history and registered items. +The right side of the viewer displays and edits the contents of the history and registered items. The edited contents will be reflected in the item when you move the focus. Some formats cannot be edited. The contents of the current clipboard cannot be edited. + +The "Clipboard" at the top of the tree is the current clipboard contents. +The "History" in the tree is a list of the history. +"Registered Items" in the tree is a list of registered items (such as standard phrases). + + ┌─■ Clipboard - Current clipboard contents + │ ├─□ TEXT - Formats in the current clipboard + │ ├─□ LOCALE + │ └─□ OEM TEXT + │ + ├─■ History - Clipboard history + │ ├─□ (BITMAP) - History items + │ │ ├─□ BITMAP - Formats in history items + │ │ └─□ DIB + │ │ + │ ├─□ Hello... + │ │ └─□ TEXT + │ │ + │ ├─□ Today... + │ └─□ (BITMAP) + │ + └─■ Registered items - Registered items + │ + ├─■ Folder - Folder + │ ├─□ Address... + │ └─□ (BITMAP) + │ + └─□ http://www... - Registered item + └─□ TEXT - Format in registered item + +■ Clipboard +ポWhat is the clipboard? +The clipboard is an area for exchanging information between different applications. +For example, you can paste text copied in Notepad into Word, and this is because the clipboard is used. + +ポClipboard format +The clipboard can hold multiple formats at once. +For example, if you copy text in Notepad, the following four formats will be stored in the clipboard (Windows 10): + ポUNICODE TEXT + ポLOCALE + ポTEXT + ポOEM TEXT +If you copy in Excel or Access, even more formats will be sent to the clipboard. + +CLCL's default settings are: + ポUNICODE TEXT - Text + ポBITMAP - Bitmap + ポDROP FILE LIST - File +The following will be saved in the history. +You can also save other formats in the history by using the optional "Filter". + +■ History +This is the history of data copied to the clipboard. +Newly copied data is added to the top of the history. + +A single history item contains multiple clipboard formats. The clipboard formats with the highest priority are displayed in the menu and viewer, which are registered in the optional "Format". + +The number of history items remains as set in the optional "History". +Only clipboard formats set to add in the optional "Filter" are added to the history. + +■ Registered Items +Registered items can be used to register commonly used data such as standard phrases. +You can add folders to organize them into hierarchical structures and give names to items. + +To add a registered item, open the viewer, select the history item, and select "Add to Registered Items" from the menu. +Select the folder you want to add in the tree, and select "Create New" from the menu to create an item by loading the contents of an empty item or file. + +To add a folder, open the viewer, right-click on the location in the registered items where you want to add it, and select "Create Folder." + +To rename a folder or item, open the viewer, select the item you want to rename, right-click on it, and select "Rename." +"Initialize Name" erases the name you set and displays the item's contents as the name. +If you name an item "-", it will be displayed as a separator in the menu. The format and data in the item will be ignored. +If you add & to the name, the character following it will be used as the shortcut key in the menu. If you want to display & itself in the menu, use &&. + +Right-click on a registered item to display the menu and select "Hotkey Settings" to assign a hotkey to the registered item. Pressing that key will send the registered item directly to the clipboard without displaying the menu, and will paste it directly if "Paste" is enabled. +You can check the registered hotkeys in the list display area of the viewer. If you select other registered items, they will be displayed in the status bar. + +There is no limit to the number of registered items or the clipboard format. + +■ Send to Clipboard +There are several ways to send history or registered items to the clipboard. + +ポClick the task tray to bring up a menu. +If you select a history or registered item from the menu, the data will be sent to the clipboard and automatically pasted into the active window. + +ポPress the hotkey (default is Alt + C) to bring up a menu. +If you select a history or registered item from the menu, the data will be sent to the clipboard and automatically pasted into the active window. + +ポSelect an item in the viewer and bring up a right-click menu. +If you select "Send to Clipboard", the selected item will be sent to the clipboard. + +■ Menu +The menu items displayed in the task tray or hotkey are set in the "Action" option. +You can customize the menu behavior and display in the "Menu" option. + +If you move the mouse over a history or registered item in the menu, a tooltip with detailed information will be displayed at the mouse position. If you select an item with the keyboard, a tooltip will be displayed under the menu item. + +Right-clicking on a menu history or registered item will display the registered tools in a menu, and the selected tool will be executed and sent to the clipboard. + +To display the tool menu with the keyboard, press Ctrl and Enter to select an item. + +History and registered items display menu items according to the "Menu text display format" option. The displayed numbers start from 0, but if you want to change the starting value, set the starting number between the % and the character. + +Examples: + %0d -> 0,1,2,3... + %8x -> 8,9,a,b... + %1n -> 1,2,3...8,9,0,1,2... + %10B -> K,L,M,N... + +■ Action +The action when the hotkey is pressed or the task tray icon is clicked can be set in the "Action" option. + +When you specify "Menu" as the action in Edit Action, you can set the menu items to display in the menu settings at the bottom of the screen. + +Invoking method sets the method for invoking the specified action. + +When you specify "Hotkey", set the key to invoke. +"Ctrl + Ctrl", "Shift + Shift", and "Alt + Alt" invoke the specified action when you press the key twice. + +If you specify Menu as the action, you can set "Paste". +When you select an item in the menu, the paste action is automatically sent to the application you are working in. +If you hold down Shift when selecting a menu item, it will not be pasted but will only be sent to the clipboard. + +If you specify Menu as the action and Hotkey, Ctrl + Ctrl, Shift + Shift, or Alt + Alt as the invoking method, you can set "Show at caret position". +"Show at caret position" displays the menu at the caret position of the editor. +If you do not set it, the menu will be displayed at the mouse position. + +If you specify Menu as the action and select History as the item, you can set the display range. The display range is specified from 1 to the number of items to be left in the history. Specifying 0 as the start number is the same as specifying 1, and specifying 0 as the end number is the same as specifying the number of items to be left in the history. + +If the end number is smaller than the start number, nothing will be displayed. If the end number is larger than the number of items to be left in the history, only the number of items to be left in the history will be displayed. + +■ Clipboard format +CLCL can process all clipboard formats, but clipboard formats that are not registered will be displayed as binary dumps in the viewer. + +Clipboard formats are registered in the options "Format". The registered format at the top takes priority, and the clipboard format with the highest priority among the items is displayed in the menu and viewer. + +To register, set the format name, the DLL to be processed, and the function header. If you omit the DLL and press the function header selection button, a list of built-in function headers will be displayed. +For example, if you want to process the CSV clipboard format as text when copying in Excel, set it as follows: + Format name: CSV + DLL: + Function header: text_ +The menu and viewer will process it as text. + +■ Filter +To select the clipboard format, set it in the "Filter" option. + +If you select "Add all formats to history", all clipboard formats except those set to be excluded will be added to the history. +If you select "Exclude all formats from history", only clipboard formats set to be added will be added to the history. + +For clipboard formats set to be added in the filter, you can further set the size limit when adding to the history. Data exceeding the limit size will not be added to the history. + +If you set the clipboard format set to be added in the filter to "Do not save", it will not be saved to a file when CLCL is closed. +For example, you can set it to add text and bitmaps to the history and save only the text. + +■ Window settings +If you want to change the behavior of CLCL depending on the application you use, set the window and behavior in the "Window" option. + +Specify the window title and class name, and use "*" as any character. +For example, for Notepad, set it as follows: + Title: * - Notepad + Class name: Notepad +The behavior of CLCL will change when Notepad is active. +Either the title or the class name needs to be entered, and if it is not entered, it is the same as specifying only "*". + +ポDon't add to history + Copying in the set window will not be added to the history. + If you specify this option for an application that causes problems when added to the history, copying from that application will be ignored. + +ポDon't set focus + Focus will not be set after activating the set window. + If the focus goes somewhere when pasting the selected menu item and the pasting is not performed correctly, specifying this option may make it work correctly. + +ポPaste even if the tool is canceled + When canceling a cancelable tool, the subsequent pasting is usually not performed, but if this option is specified, the pasting will be performed even if it is canceled. + If you set the copy key as the cut key in the key settings for each window, specifying this option will prevent the characters from disappearing even if you cancel the tool. + +■ Key settings for each window +Select the history or registered item from the hotkey, and the paste action will automatically send the paste key to the window. +By default, Ctrl + V is sent to all windows, but depending on the window, the paste key may be a different key. + +When the tool is called with a hotkey, the copy key (Ctrl + C) is sent to the window to perform the Copy -> Tool Processing -> Paste action. + +The copy and paste keys for each window are set in the "Key" option. +Set the title and class name of the window to be set and set the copy and paste keys. + +If the copy and paste keys are not set, the default key settings will be used. + +Multiple keys can be set for one window. If multiple keys are set, the keys will be sent in order from the top. + +■ Tools (plug-ins) +To process history or registered item data or expand the functions of CLCL, set it in the "Tool" option. + +When you select the DLL and function name, the tool name and execution timing will be automatically set. +The "Action Menu" execution timing allows you to execute from the menu set in the action option. +The "Viewer" execution timing allows you to execute from the viewer's tool menu. + +The "Send copy and paste" execution timing sends a copy to the active window, executes a tool on the copied data, and pastes the execution results into the active window. +If this option is not checked, the tool is executed on the most recent history item and sent to the clipboard. In the tool menu that appears when you right-click an item in the action menu, the tool is executed on the selected item and sent to the clipboard. +If "Paste" is not enabled in the action settings, pasting will not be performed after copying and executing the tool. + +Drag and drop a DLL into the tool list window to display a list of tools that can be registered, and you can select multiple tools to register them all at once. + +■ Command Line +When starting CLCL, you can specify a command line to specify the operation after startup. +If CLCL is already running, the command will be sent to the already running CLCL. + +[Format] +CLCL.exe [/vownx] + /v Display viewer + /w Monitor clipboard + /n Cancel monitoring clipboard + /x Exit + +■ Special thanks +K.Takata ( http://webs.to/ken/ ) + +■ Update history +ポVer 2.1.2 -> Ver 2.1.3 + ポChanged the system tray icon when not monitoring the clipboard. + ポImproved the up and down movement buttons in the settings. + ポImproved so that the main screen does not appear when displaying the menu. + +ポVer 2.1.1 -> Ver 2.1.2 + ポAdded the ability to scroll by dragging the mouse in image formats (BITMAP, DIB). + +ポVer 2.1.0 -> Ver 2.1.1 + ポAdded a function to copy file names and file paths in file formats. + ポAdded a setting to place settings and data in the same location as CLCL.exe. + +ポVer 2.0.3 -> Ver 2.1.0 + ポHigh DPI support. + ポSupport for PNG and JPEG when saving image formats (BITMAP, DIB). + ポEnlarge/reduce image formats (BITMAP, DIB). + →Hold down Ctrl and use the mouse wheel, or Ctrl+↑↓ to change the magnification. + ポBinaries are no longer separated into Japanese and English versions. + ポChanged the settings save location to be saved in a separate area for each user. + → For Windows 10, "C:\Users\(username)\AppData\Local\CLCL" + (Automatically migrated on first launch) + +ポVer 2.0.2 -> Ver 2.0.3 + ポFixed typos in the English version settings screen. + +ポVer 2.0.1 -> Ver 2.0.2 + ポSupport for Unicode in settings files. + → Starting once with Ver 2.0.2 will make the settings file Unicode. + The files before conversion are backed up with the file names "general.ini.back" and "clcl.ini.back". + If you want to revert to an older version, use the above files. + ポThe startup function has been changed from WinMain to wWinMain. + +ポVer 2.0.0 -> Ver 2.0.1 + ポIncorporated correction code from K. Takata + → Supports Unicode surrogate pairs + → Retry processing when task tray addition fails + → Prevents consecutive double startups and double startups from another user + ポFixed a problem where the color of items disabled in the "Action" settings would sometimes become invisible + ポImproved the task tray icon when clipboard monitoring is stopped. + +ポVer 1.1.2 -> Ver 2.0.0 + ポSupports Unicode. As a result, older versions of Windows are no longer supported. + → The settings of the older version will be inherited, but tools and plugin formats must be Unicode-compatible. + ポChanged the behavior to copy the file if the save is successful so that registered items are not deleted if the save process fails when CLCL is closed. + ポChanged the icon design in the task tray. + ポChanged the default behavior when clicking on the task tray. + → Changed the menu to appear when left-clicking the task tray icon to take into account operation on tablets. + +ポVer 1.1.1 -> Ver 1.1.2 + ポFixed the problem where the tooltip background was not displayed correctly in a 256-color environment. + ポOptimized the menu display method. + ポOptimized the text display in the viewer. + +ポVer 1.1.0 -> Ver 1.1.1 + ポImproved the behavior when selecting the character position with the mouse in TEXT editing. + ポFixed the error that occurred when there was no history to save with the filter when closing. + ポMade it possible to move items between history and registered items. + ポChanged the method of displaying thumbnail images. + ポChanged the initial value of the waiting time for copy and paste to 100. + ポFixed a problem where memory was not being released. + +ポVer 1.0.9 -> Ver 1.1.0 + ポFixed a problem where the menu would loop when Ctrl+V or other keys were specified as the hotkey to bring up the menu. + ポNow it is possible to specify the Windows key or Space key as the hotkey for actions and tools. + +ポVer 1.0.8 -> Ver 1.0.9 + ポFixed a problem where the display would become distorted if the confirmation message for the same format was canceled when creating a new item in the viewer. + ポFixed a problem where the edited format would be displayed unconditionally regardless of priority when editing the contents of the format in the viewer. + ポFixed a problem where the status bar was not updated when editing an item in the viewer. + ポFixed a problem where the position of Japanese input would shift when editing TEXT. + +ポVer 1.0.7 -> Ver 1.0.8 + ポChange the INI file name (user.ini -> clcl.ini) + The file name will be changed automatically at startup. + ポChanged display and editing of TEXT format from rich edit control to our own. + ポImproved behavior of the viewer when calling tools from the viewer. + ポExtended the binary display function. + ポOther + +ポVer 1.0.6 -> Ver 1.0.7 + ポWhen selecting an item in the menu while holding down the Shift key, it will only send it to the clipboard without pasting. + ポAdded a command line option. + ポFixed a bug that prevented keys from being sent to some windows. + ポIncreased the default behavior settings for the list in the viewer options. + +ポVer 1.0.5 -> Ver 1.0.6 + ポMade it possible to copy items in the behavior settings. + ポChanged the number of history items displayed to the display range in the behavior settings. + ポMade minor adjustments to the options screen. + +ポVer 1.0.4 -> Ver 1.0.5 + ポMade it possible to assign hotkeys to registered items. + ポMade hotkeys visible in the menu. + ポThe viewer position is no longer adjusted when launched. + ポThe position and size are now forcibly saved when closing the viewer. + ポ0x7F is no longer displayed in the character display area when displaying binary data. + ポFiles can now be opened even if they are locked. + +ポVer 1.0.3 -> Ver 1.0.4 + ポFiles can now be automatically registered as external applications when dragged and dropped into the operation settings screen. + ポVer 1.0.2 -> Ver 1.0.3 + ポFixed a bug where history was not saved correctly when the OS was shut down on Windows XP. + +ポVer 1.0.1 -> Ver 1.0.2 + ポImproved the timing of releasing memory associated with menus. + ポFolder icons now use system icons. + +ポVer 1.0.0 -> Ver 1.0.1 + ポAdded settings for each window. + ポFixed a bug where text was not redrawn after changing the font depending on the environment. + ポFixed a bug where pasting was not possible in some software. + ポFixed a bug where all windows were targeted when only one of the window name and class name was specified in the window settings and key settings. + +ポVer 0.2.0 -> Ver 1.0.0 + ポRecreated + Data and settings will not be carried over. + If you want to migrate registered items from Ver 0.2.0 to Ver 1.0.0, start both and send the registered items from Ver 0.2.0 to the clipboard and add them to the history of Ver 1.0.0. Then, register the items from the history added to Ver 1.0.0 to the registered items of Ver 1.0.0. Tools that are compatible with Ver 0.2.0 can also be used with Ver 1.0.0. (Some restrictions apply) + +-- + +The author is not responsible for any problems caused by this program. It is strongly recommended that you back up important files. + +Please contact nakka@nakka.com for bugs, requests, and questions. +Copyright (C) 1996-2022 by Ohno Tomoaki. All rights reserved. https://www.nakka.com/ 2022/12/1