Index: src/common/ipcstructs.h =================================================================== diff -u -N -r3d1951f52696fe21e01618e1bbfb9e14745a3827 -r633a533cb6e741d44fe28aa56339e1d2709b1b27 --- src/common/ipcstructs.h (.../ipcstructs.h) (revision 3d1951f52696fe21e01618e1bbfb9e14745a3827) +++ src/common/ipcstructs.h (.../ipcstructs.h) (revision 633a533cb6e741d44fe28aa56339e1d2709b1b27) @@ -19,82 +19,32 @@ #ifndef __SHAREDDATA_H__ #define __SHAREDDATA_H__ -#include "../libchcore/TTaskDefinition.h" +#include // messages used #define WM_GETCONFIG WM_USER+20 -// config type to get from program -#define GC_DRAGDROP 0x00 -#define GC_EXPLORER 0x01 - -// command properties (used in menu displaying) -#pragma pack(push, 1) -struct _COMMAND -{ - UINT uiCommandID; // command ID - would be send - chcore::EOperationType eOperationType; - TCHAR szCommand[128]; // command name - TCHAR szDesc[128]; // and it's description -}; -#pragma pack(pop) - -#pragma pack(push, 1) -struct _SHORTCUT -{ - TCHAR szName[128]; - TCHAR szPath[_MAX_PATH]; -}; -#pragma pack(pop) - enum ECopyDataType { eCDType_TaskDefinitionContent, eCDType_TaskDefinitionContentSpecial, eCDType_CommandLineArguments, }; -// shared memory size in bytes -#define SHARED_BUFFERSIZE 65536 +enum ELocation +{ + eLocation_DragAndDropMenu, + eLocation_ContextMenu +}; -// structure used for passing data from program to DLL -// the rest is a dynamic texts -class CSharedConfigStruct +namespace IPCSupport { -public: - enum EFlags + static std::wstring GenerateSHMName(unsigned long ulRequestID) { - // drag&drop flags - OPERATION_MASK = 0x00ffffff, - DD_COPY_FLAG = 0x00000001, - DD_MOVE_FLAG = 0x00000002, - DD_COPYMOVESPECIAL_FLAG = 0x00000004, + std::wstring wstrName = _T("CHExtSHM_"); + wstrName += boost::lexical_cast(ulRequestID); + return wstrName; + } +} - EC_PASTE_FLAG = 0x00000010, - EC_PASTESPECIAL_FLAG = 0x00000020, - EC_COPYTO_FLAG = 0x00000040, - EC_MOVETO_FLAG = 0x00000080, - EC_COPYMOVETOSPECIAL_FLAG = 0x00000100, - - eFlag_InterceptDragAndDrop = 0x00000200, - eFlag_InterceptKeyboardActions = 0x00000400, - eFlag_InterceptCtxMenuActions = 0x00000800 - }; -public: - _SHORTCUT* GetShortcutsPtr() const { return (_SHORTCUT*)(byData + iCommandCount * sizeof(_COMMAND)); } - _COMMAND* GetCommandsPtr() const { return (_COMMAND*)byData; } - -public: - UINT uiFlags; // what items and how to display in drag&drop ctx menu & explorer.ctx.menu - - bool bShowFreeSpace; // show the free space by the shortcuts ? - TCHAR szSizes[6][64]; // names of the kB, GB, ... - bool bShowShortcutIcons; // show shell icons with shortcuts ? - - int iCommandCount; // count of commands stored at the beginning of a buffer - int iShortcutsCount; // count of shortcuts to display in submenus - - BYTE byData[SHARED_BUFFERSIZE]; // buffer for texts and other stuff -}; - #endif