summaryrefslogtreecommitdiff
path: root/plugins/SendScreenshotPlus/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/SendScreenshotPlus/src')
-rw-r--r--plugins/SendScreenshotPlus/src/Main.cpp42
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.cpp15
-rw-r--r--plugins/SendScreenshotPlus/src/global.h2
3 files changed, 13 insertions, 46 deletions
diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp
index 362f698362..7048794d81 100644
--- a/plugins/SendScreenshotPlus/src/Main.cpp
+++ b/plugins/SendScreenshotPlus/src/Main.cpp
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
FI_INTERFACE *FIP = 0;
HINSTANCE hInst; //!< Global reference to the application
MGLOBAL myGlobals;
-int hLangpack;
+int hLangpack;
//Information gathered by Miranda, displayed in the plugin pane of the Option Dialog
@@ -59,10 +59,6 @@ HANDLE hsvc_Send2ImageShack=0;
HANDLE hNetlibUser = 0; //!< Netlib Register User
HANDLE hFolderScreenshot=0;
-HANDLE hhook_ModulesLoad=0;
-HANDLE hhook_SystemPShutdown=0;
-
-
// Functions ////////////////////////////////////////////////////////////////////////////
/*---------------------------------------------------------------------------
@@ -102,10 +98,8 @@ extern "C" int __declspec(dllexport) Load(void)
// load icon library (use UserInfoEx icon Pack)
IcoLib_LoadModule();
- hhook_ModulesLoad = HookEvent(ME_SYSTEM_MODULESLOADED, hook_ModulesLoaded);
- //hhook_options_init = HookEvent(ME_OPT_INITIALISE, hook_options_init);
- //hhook_OkToExit = HookEvent(ME_SYSTEM_OKTOEXIT, hook_OkToExit);
- hhook_SystemPShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, hook_SystemPShutdown);
+ HookEvent(ME_SYSTEM_MODULESLOADED, hook_ModulesLoaded);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, hook_SystemPShutdown);
AddMenuItems();
RegisterServices();
@@ -115,26 +109,21 @@ extern "C" int __declspec(dllexport) Load(void)
int hook_ModulesLoaded(WPARAM, LPARAM)
{
-
myGlobals.PopUpExist = ServiceExists(MS_POPUP_ADDPOPUP);
myGlobals.PopUpActionsExist = ServiceExists(MS_POPUP_REGISTERACTIONS);
myGlobals.PluginHTTPExist = ServiceExists(MS_HTTP_ACCEPT_CONNECTIONS);
myGlobals.PluginFTPExist = ServiceExists(MS_FTPFILE_SHAREFILE);
-// myGlobals.PluginUserinfoEx = ServiceExists(MS_USERINFO_VCARD_EXPORT);
// Netlib register
- if (!NetlibInit()){
- ;
- }
+ NetlibInit();
// load my button class
- if(!ServiceExists("UserInfo/vCard/Export")) {
+ if(!ServiceExists("UserInfo/vCard/Export"))
CtrlButtonLoadModule();
- }
// Folders plugin support
hFolderScreenshot = FoldersRegisterCustomPathT(LPGEN("SendSS"), LPGEN("Screenshots"),
- _T(PROFILE_PATH)_T("\\")_T(CURRENT_PROFILE)_T("\\Screenshots"));
+ _T(PROFILE_PATH)_T("\\")_T(CURRENT_PROFILE)_T("\\Screenshots"));
return 0;
}
@@ -143,34 +132,27 @@ int hook_ModulesLoaded(WPARAM, LPARAM)
* Prepare the plugin to stop
* Called by Miranda when it will exit or when the plugin gets deselected
*/
+
extern "C" int __declspec(dllexport) Unload(void)
{
- UnhookEvent(hhook_SystemPShutdown);
-
- DestroyServiceFunction(MS_SENDSS_OPENDIALOG);
- DestroyServiceFunction(MS_SENDSS_EDITBITMAP);
- DestroyServiceFunction(MS_SENDSS_SENDDESKTOP);
- DestroyServiceFunction(MS_SENDSS_SEND2IMAGESHACK);
return 0;
}
-int hook_SystemPShutdown(WPARAM wParam, LPARAM lParam) {
- UnhookEvent(hhook_ModulesLoad);
-
+int hook_SystemPShutdown(WPARAM wParam, LPARAM lParam)
+{
// Netlib unregister
NetlibClose();
// uninitialize classes
CtrlButtonUnloadModule();
-
return 0;
}
//---------------------------------------------------------------------------
// Netlib
-HANDLE NetlibInit(void) {
- NETLIBUSER nlu = {0};
- nlu.cbSize = sizeof(nlu);
+HANDLE NetlibInit(void)
+{
+ NETLIBUSER nlu = { sizeof(nlu) };
nlu.szSettingsModule = __PLUGIN_NAME;
nlu.ptszDescriptiveName = TranslateT("SendSS HTTP connections");
nlu.flags = NUF_OUTGOING|NUF_HTTPCONNS|NUF_TCHAR; //|NUF_NOHTTPSOPTION;
diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp
index 3758c1e18e..63affd0132 100644
--- a/plugins/SendScreenshotPlus/src/Utils.cpp
+++ b/plugins/SendScreenshotPlus/src/Utils.cpp
@@ -537,18 +537,3 @@ INT_PTR SaveTIF(HBITMAP hBmp, LPTSTR szFilename) {
Gdiplus::GdiplusShutdown(gdiplusToken);
return 0;
}
-
-//---------------------------------------------------------------------------
-/* Old stuff from Borland C++ */
-//---------------------------------------------------------------------------
-/*/Popup
-void ShowPopUp(char *title, char *text) {
- POPUPDATAEX pude={0};
-
- strcpy(pude.lpzText, text);
- strcpy(pude.lpzContactName, title);
- pude.lchIcon = LoadIcon(g_hAppInstance, MAKEINTRESOURCE(MAIN));
- pude.colorBack = POPUP_USE_SKINNED_BG;
-
- CallService(MS_POPUP_ADDPOPUP, (WPARAM)&pude, 0);
-}*/
diff --git a/plugins/SendScreenshotPlus/src/global.h b/plugins/SendScreenshotPlus/src/global.h
index b6301a8caf..2cf2a12374 100644
--- a/plugins/SendScreenshotPlus/src/global.h
+++ b/plugins/SendScreenshotPlus/src/global.h
@@ -99,7 +99,7 @@ using namespace std;
#define MSGINFO (text) MessageBox(NULL, text, _T("SendSS"), MB_OK | MB_ICONINFORMATION)
typedef struct _MGLOBAL {
- DWORD mirandaVersion; // mirandaVersion
+ DWORD mirandaVersion; // mirandaVersion
BOOLEAN PopUpExist : 1; // Popup or MS_POPUP_ADDPOPUP exist
BOOLEAN PopUpActionsExist : 1; // Popup++ or MS_POPUP_REGISTERACTIONS exist
BOOLEAN PluginHTTPExist : 1; // HTTPServer or MS_HTTP_ACCEPT_CONNECTIONS exist