diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:07:15 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:07:15 +0200 |
commit | 8318453bf9d4fd50b137ff6c6fc8d1fd22aa6395 (patch) | |
tree | 975c6e590c31e56007006a23e7b15d0245d75b08 /shared/Taskbar_Seven/taskbar.h | |
parent | 3.6 (diff) | |
download | FreeFileSync-8318453bf9d4fd50b137ff6c6fc8d1fd22aa6395.tar.gz FreeFileSync-8318453bf9d4fd50b137ff6c6fc8d1fd22aa6395.tar.bz2 FreeFileSync-8318453bf9d4fd50b137ff6c6fc8d1fd22aa6395.zip |
3.7
Diffstat (limited to 'shared/Taskbar_Seven/taskbar.h')
-rw-r--r-- | shared/Taskbar_Seven/taskbar.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/shared/Taskbar_Seven/taskbar.h b/shared/Taskbar_Seven/taskbar.h new file mode 100644 index 00000000..3b7abc51 --- /dev/null +++ b/shared/Taskbar_Seven/taskbar.h @@ -0,0 +1,70 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef TASKBAR_SEVEN_DLL_H +#define TASKBAR_SEVEN_DLL_H + +#ifdef TASKBAR_SEVEN_DLL_EXPORTS +#define DLL_FUNCTION_DECLARATION extern "C" __declspec(dllexport) +#else +#define DLL_FUNCTION_DECLARATION extern "C" __declspec(dllimport) +#endif + + +namespace TaskbarSeven +{ +enum TaskBarStatus +{ + STATUS_NOPROGRESS, + STATUS_INDETERMINATE, + STATUS_NORMAL, + STATUS_ERROR, + STATUS_PAUSED +}; + +typedef size_t TBHandle; + + +//COM needs to be initialized before calling any of these functions! CoInitializeEx/CoUninitialize +DLL_FUNCTION_DECLARATION +TBHandle init(); //returns handle; 0 on failure + +DLL_FUNCTION_DECLARATION +void release(TBHandle handle); //release taskbar handle + +DLL_FUNCTION_DECLARATION +bool setStatus(TBHandle handle, + void* hwnd, //HWND: window assciated to the taskbar icon + TaskBarStatus status); + + +DLL_FUNCTION_DECLARATION +bool setProgress(TBHandle handle, + void* hwnd, //HWND: window assciated to the taskbar icon + size_t current, + size_t total); + +//if any of the functions above returns 'false', this message returns last error +DLL_FUNCTION_DECLARATION +void getLastError(wchar_t* errorMessage, size_t errorBufferLen); + + +//function typedefs +typedef TBHandle (*initFct)(); +typedef void (*releaseFct)(TBHandle handle); +typedef bool (*setStatusFct)(TBHandle handle, void* hwnd, TaskBarStatus status); +typedef bool (*setProgressFct)(TBHandle handle, void* hwnd, size_t current, size_t total); +typedef void (*getLastErrorFct)(wchar_t* errorMessage, size_t errorBufferLen); + +//function names (use const pointers to ensure internal linkage) +const char* const initFctName = "init"; +const char* const releaseFctName = "release"; +const char* const setStatusFctName = "setStatus"; +const char* const setProgressFctName = "setProgress"; +const char* const getLastErrorFctName = "getLastError"; +} + +#endif //TASKBAR_SEVEN_DLL_H
\ No newline at end of file |