summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2015-04-24 21:52:13 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2015-04-24 21:52:13 +0000
commit712a95b62ed7ed6aef9ab078ccd4ac685f34b42c (patch)
tree748ea5e47f0abfb64de970d3b8993bfe2fb3acf2 /plugins/AutoShutdown/src
parent383d28b152438345e129963e6c1a40e8e4f04293 (diff)
AutoShutdown - common project
git-svn-id: http://svn.miranda-ng.org/main/trunk@13114 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoShutdown/src')
-rw-r--r--plugins/AutoShutdown/src/cpuusage.cpp2
-rw-r--r--plugins/AutoShutdown/src/frame.cpp14
-rw-r--r--plugins/AutoShutdown/src/main.cpp6
-rw-r--r--plugins/AutoShutdown/src/options.cpp4
-rw-r--r--plugins/AutoShutdown/src/settingsdlg.cpp5
-rw-r--r--plugins/AutoShutdown/src/shutdownsvc.cpp3
-rw-r--r--plugins/AutoShutdown/src/stdafx.cxx (renamed from plugins/AutoShutdown/src/stdafx.cpp)2
-rw-r--r--plugins/AutoShutdown/src/stdafx.h75
-rw-r--r--plugins/AutoShutdown/src/utils.cpp2
-rw-r--r--plugins/AutoShutdown/src/watcher.cpp8
10 files changed, 92 insertions, 29 deletions
diff --git a/plugins/AutoShutdown/src/cpuusage.cpp b/plugins/AutoShutdown/src/cpuusage.cpp
index cd30482e6d..4e710e4e92 100644
--- a/plugins/AutoShutdown/src/cpuusage.cpp
+++ b/plugins/AutoShutdown/src/cpuusage.cpp
@@ -19,7 +19,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
/************************* Stat Switch ********************************/
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index c9843510f0..efcc1c4071 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -19,7 +19,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
/* Show Frame */
extern HINSTANCE hInst;
@@ -58,15 +58,6 @@ static LOGFONT* GetDefaultFont(LOGFONT *lf)
return (LOGFONT*)NULL;
}
-static HICON SetFrameTitleIcon(WORD hFrame,HICON hNewIcon)
-{
- HICON hPrevIcon;
- hPrevIcon=(HICON)CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_ICON,hFrame),0);
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_ICON,hFrame),(LPARAM)hNewIcon);
- if ((int)hPrevIcon==-1) return (HICON)NULL;
- return hPrevIcon;
-}
-
static LRESULT CALLBACK ProgressBarSubclassProc(HWND hwndProgress,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch(msg) {
@@ -232,7 +223,6 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame,UINT msg,WPARAM wParam,LPARA
UnhookEvent(dat->hHookIconsChanged);
/* other childs are destroyed automatically */
if (dat->hwndToolTip != NULL) DestroyWindow(dat->hwndToolTip);
- HICON hIcon=(HICON)SendMessage(dat->hwndIcon,STM_SETIMAGE,IMAGE_ICON,0);
break;
}
case WM_NCDESTROY:
@@ -585,7 +575,7 @@ void CloseCountdownFrame(void)
/************************* Misc ***************************************/
-static int FrameModulesLoaded(WPARAM wParam,LPARAM lParam)
+static int FrameModulesLoaded(WPARAM, LPARAM)
{
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
LOGFONT lf;
diff --git a/plugins/AutoShutdown/src/main.cpp b/plugins/AutoShutdown/src/main.cpp
index 0f3cfc1fc4..7962e5fe6b 100644
--- a/plugins/AutoShutdown/src/main.cpp
+++ b/plugins/AutoShutdown/src/main.cpp
@@ -18,7 +18,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
HINSTANCE hInst;
int hLangpack;
@@ -44,7 +44,7 @@ IconItem iconList[] =
{ LPGEN("Inactive"), "AutoShutdown_Inactive", IDI_INACTIVE },
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, VOID *pReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, VOID*)
{
hInst = hinstDLL;
return TRUE;
@@ -60,7 +60,7 @@ static int ShutdownModulesLoaded(WPARAM,LPARAM)
return 0;
}
-extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) const PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp
index 3f50077c07..0fa9d4f5e3 100644
--- a/plugins/AutoShutdown/src/options.cpp
+++ b/plugins/AutoShutdown/src/options.cpp
@@ -19,7 +19,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
/* Option Page */
static HANDLE hHookOptInit;
@@ -103,7 +103,7 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L
return FALSE;
}
-static int ShutdownOptInit(WPARAM wParam, LPARAM lParam)
+static int ShutdownOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
odp.hInstance = hInst;
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp
index f78516f66a..70170abfe1 100644
--- a/plugins/AutoShutdown/src/settingsdlg.cpp
+++ b/plugins/AutoShutdown/src/settingsdlg.cpp
@@ -19,7 +19,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
/* Menu Item */
static HANDLE hServiceMenuCommand;
@@ -180,7 +180,6 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
case WM_DESTROY:
{
Utils_SaveWindowPosition(hwndDlg,NULL,"AutoShutdown","SettingsDlg_");
- HICON hIcon=(HICON)SendDlgItemMessage(hwndDlg,IDC_ICON_HEADER,STM_SETIMAGE,IMAGE_ICON,0);
HFONT hFont=(HFONT)SendDlgItemMessage(hwndDlg,IDC_TEXT_HEADER,WM_GETFONT,0,0);
SendDlgItemMessage(hwndDlg,IDC_TEXT_HEADER,WM_SETFONT,0,FALSE); /* no return value */
if (hFont != NULL) DeleteObject(hFont);
@@ -396,7 +395,7 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
/************************* Services ***********************************/
-static INT_PTR ServiceShowSettingsDialog(WPARAM wParam,LPARAM lParam)
+static INT_PTR ServiceShowSettingsDialog(WPARAM, LPARAM)
{
if (hwndSettingsDlg != NULL) { /* already opened, bring to front */
SetForegroundWindow(hwndSettingsDlg);
diff --git a/plugins/AutoShutdown/src/shutdownsvc.cpp b/plugins/AutoShutdown/src/shutdownsvc.cpp
index dde2ed0716..3de69ba4d2 100644
--- a/plugins/AutoShutdown/src/shutdownsvc.cpp
+++ b/plugins/AutoShutdown/src/shutdownsvc.cpp
@@ -19,7 +19,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
/* Shutdown Dialog */
static HWND hwndShutdownDlg;
@@ -343,7 +343,6 @@ static INT_PTR CALLBACK ShutdownDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
/* reallow foreground window changes (WinMe/2000+) */
LockSetForegroundWindow(LSFW_UNLOCK);
Utils_SaveWindowPosition(hwndDlg,NULL,"AutoShutdown","ConfirmDlg_");
- HICON hIcon=(HICON)SendDlgItemMessage(hwndDlg,IDC_ICON_HEADER,STM_SETIMAGE,IMAGE_ICON,0);
HFONT hFont=(HFONT)SendDlgItemMessage(hwndDlg,IDC_TEXT_HEADER,WM_GETFONT,0,0);
SendDlgItemMessage(hwndDlg,IDC_TEXT_HEADER,WM_SETFONT,0,FALSE); /* no return value */
if (hFont != NULL) DeleteObject(hFont);
diff --git a/plugins/AutoShutdown/src/stdafx.cpp b/plugins/AutoShutdown/src/stdafx.cxx
index c5fe5abaad..6fb37564b7 100644
--- a/plugins/AutoShutdown/src/stdafx.cpp
+++ b/plugins/AutoShutdown/src/stdafx.cxx
@@ -15,4 +15,4 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "common.h" \ No newline at end of file
+#include "stdafx.h" \ No newline at end of file
diff --git a/plugins/AutoShutdown/src/stdafx.h b/plugins/AutoShutdown/src/stdafx.h
new file mode 100644
index 0000000000..03a39e306d
--- /dev/null
+++ b/plugins/AutoShutdown/src/stdafx.h
@@ -0,0 +1,75 @@
+/*
+
+'AutoShutdown'-Plugin for Miranda IM
+
+Copyright 2004-2007 H. Herkenrath
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program (Shutdown-License.txt); if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include <time.h> /* for mktime(),time() */
+#include <windows.h>
+#include <Uxtheme.h>
+#include <Shlwapi.h>
+#include <PowrProf.h>
+#include <Ras.h>
+
+/* WinXP+: shutdown reason codes */
+#if defined(EWX_RESTARTAPPS) /* new MS Platform SDK */
+ #include <reason.h>
+#else
+ #define SHTDN_REASON_MAJOR_OTHER 0x00000000
+ #define SHTDN_REASON_MINOR_OTHER 0x00000000
+ #define SHTDN_REASON_FLAG_PLANNED 0x80000000
+#endif
+
+/* RAS */
+#include <ras.h> /* for RasEnumConnections(), RasHangUp() */
+#include <raserror.h> /* error codes for RAS */
+
+#include <newpluginapi.h>
+#include <m_database.h>
+#include <m_clui.h>
+#include <m_langpack.h>
+#include <m_skin.h>
+#include <m_protosvc.h>
+#include <m_options.h>
+#include <m_message.h>
+#include <m_file.h>
+#include <m_idle.h>
+#include <win2k.h>
+#include <m_cluiframes.h>
+#include <m_clistint.h>
+#include <m_fontservice.h>
+#include <m_icolib.h>
+#include <m_hotkeys.h>
+
+#include "../Utils/mir_fonts.h"
+
+#include <m_weather.h>
+#include <m_toptoolbar.h>
+#include <m_shutdown.h>
+
+#include "cpuusage.h"
+#include "frame.h"
+#include "options.h"
+#include "settingsdlg.h"
+#include "shutdownsvc.h"
+#include "utils.h"
+#include "watcher.h"
+#include "resource.h"
+#include "version.h"
+
+extern IconItem iconList[]; \ No newline at end of file
diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp
index 28b5932079..933ca57446 100644
--- a/plugins/AutoShutdown/src/utils.cpp
+++ b/plugins/AutoShutdown/src/utils.cpp
@@ -19,7 +19,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
/************************* String *********************************/
diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp
index bce511ce8f..8efdf3a5c4 100644
--- a/plugins/AutoShutdown/src/watcher.cpp
+++ b/plugins/AutoShutdown/src/watcher.cpp
@@ -19,7 +19,7 @@ along with this program (Shutdown-License.txt); if not, write to the Free Softwa
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "common.h"
+#include "stdafx.h"
/* Msg Shutdown */
static HANDLE hHookEventAdded;
@@ -89,7 +89,7 @@ static TCHAR* GetMessageText(BYTE **ppBlob,DWORD *pcbBlob)
return (WCHAR*)buf;
}
-static int MsgEventAdded(WPARAM wParam,LPARAM hDbEvent)
+static int MsgEventAdded(WPARAM, LPARAM hDbEvent)
{
if (currentWatcherType & SDWTF_MESSAGE) {
DBEVENTINFO dbe = { sizeof(dbe) };
@@ -118,7 +118,7 @@ static int MsgEventAdded(WPARAM wParam,LPARAM hDbEvent)
static HANDLE *transfers;
static int nTransfersCount;
-static int ProtoAck(WPARAM wParam,LPARAM lParam)
+static int ProtoAck(WPARAM, LPARAM lParam)
{
ACKDATA *ack=(ACKDATA*)lParam;
if (ack->type != ACKTYPE_FILE)
@@ -244,7 +244,7 @@ static int WeatherUpdated(WPARAM wParam,LPARAM lParam)
/************************* Services ***********************************/
-INT_PTR ServiceStartWatcher(WPARAM wParam,LPARAM lParam)
+INT_PTR ServiceStartWatcher(WPARAM, LPARAM lParam)
{
/* passing watcherType as lParam is only to be used internally, undocumented */
if (lParam==0)