summaryrefslogtreecommitdiff
path: root/plugins/BossKeyPlus
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-12-14 14:39:45 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-12-14 14:39:45 +0000
commit406de4af82891ae5d30280917721a88f4d43abeb (patch)
treeb76390e3b97cfc0b7430d20029a5ce7be1578ddb /plugins/BossKeyPlus
parent3f7e27dc41ea766841f88b546e3db04edbdc5b96 (diff)
BossKey: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11408 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BossKeyPlus')
-rw-r--r--plugins/BossKeyPlus/BossKey_12.vcxproj8
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp391
-rw-r--r--plugins/BossKeyPlus/src/BossKey.h30
-rw-r--r--plugins/BossKeyPlus/src/BossKeyIdle.cpp14
-rw-r--r--plugins/BossKeyPlus/src/Options.cpp278
5 files changed, 361 insertions, 360 deletions
diff --git a/plugins/BossKeyPlus/BossKey_12.vcxproj b/plugins/BossKeyPlus/BossKey_12.vcxproj
index 3c90f59db9..47932e7987 100644
--- a/plugins/BossKeyPlus/BossKey_12.vcxproj
+++ b/plugins/BossKeyPlus/BossKey_12.vcxproj
@@ -81,7 +81,7 @@
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>BossKey.h</PrecompiledHeaderFile>
@@ -109,7 +109,7 @@
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -138,7 +138,7 @@
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<FunctionLevelLinking>true</FunctionLevelLinking>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>BossKey.h</PrecompiledHeaderFile>
@@ -166,7 +166,7 @@
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>BossKey.h</PrecompiledHeaderFile>
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index 572a1c364c..ffe9b3709f 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -2,20 +2,20 @@
BossKey - Hide Miranda from your boss :)
Copyright (C) 2002-2003 Goblineye Entertainment, (C) 2007-2010 Billy_Bons
- 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 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.
+ 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; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
#include "BossKey.h"
@@ -40,7 +40,7 @@ BYTE g_bOldSetting;
PFNDwmIsCompositionEnabled dwmIsCompositionEnabled;
-void LanguageChanged(HWND hDlg);
+static void LanguageChanged(HWND hDlg);
static PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -53,16 +53,16 @@ static PLUGININFOEX pluginInfo = {
__AUTHORWEB,
UNICODE_AWARE,
// {4FAC353D-0A36-44A4-9064-6759C53AE782}
- {0x4fac353d, 0x0a36, 0x44a4, {0x90, 0x64, 0x67, 0x59, 0xc5, 0x3a, 0xe7, 0x82}}
+ { 0x4fac353d, 0x0a36, 0x44a4, { 0x90, 0x64, 0x67, 0x59, 0xc5, 0x3a, 0xe7, 0x82 } }
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
g_hInstance = hinstDLL;
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -73,17 +73,17 @@ static BOOL IsAeroMode()
return dwmIsCompositionEnabled && (dwmIsCompositionEnabled(&result) == S_OK) && result;
}
-INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static DWORD dwOldIcon = 0;
HICON hIcon = 0;
- switch(uMsg){
+ switch (uMsg){
case WM_INITDIALOG:
g_hDlgPass = hDlg;
hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_DLGPASSWD));
dwOldIcon = SetClassLongPtr(hDlg, GCLP_HICON, (LONG)hIcon); // set alt+tab icon
- SendDlgItemMessage(hDlg,IDC_EDIT1,EM_LIMITTEXT,MAXPASSLEN,0);
+ SendDlgItemMessage(hDlg, IDC_EDIT1, EM_LIMITTEXT, MAXPASSLEN, 0);
if (IsAeroMode())
{
@@ -98,10 +98,10 @@ INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
TranslateDialogDefault(hDlg);
oldLangID = 0;
- SetTimer(hDlg,1,200,NULL);
+ SetTimer(hDlg, 1, 200, NULL);
oldLayout = GetKeyboardLayout(0);
- if (MAKELCID((WORD)oldLayout & 0xffffffff, SORT_DEFAULT) != (LCID)0x00000409)
+ if (MAKELCID((WORD)oldLayout & 0xffffffff, SORT_DEFAULT) != (LCID)0x00000409)
ActivateKeyboardLayout((HKL)0x00000409, 0);
LanguageChanged(hDlg);
return TRUE;
@@ -115,30 +115,30 @@ INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
return (INT_PTR)GetSysColorBrush(COLOR_HIGHLIGHT);
case WM_COMMAND:
- {
- UINT uid = LOWORD(wParam);
- if (uid == IDOK){
- char password[MAXPASSLEN + 1] = {0};
- int passlen = GetDlgItemTextA(hDlg,IDC_EDIT1,password,SIZEOF(password));
+ {
+ UINT uid = LOWORD(wParam);
+ if (uid == IDOK){
+ char password[MAXPASSLEN + 1] = { 0 };
+ int passlen = GetDlgItemTextA(hDlg, IDC_EDIT1, password, SIZEOF(password));
- if (passlen == 0)
- {
- SetDlgItemText(hDlg, IDC_HEADERBAR, TranslateT("Miranda NG is locked.\nEnter password to unlock it."));
- SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_NCPAINT, 0, 0);
- break;
- }
- else if (mir_strcmp(password, g_password))
- {
- SetDlgItemText(hDlg, IDC_HEADERBAR, TranslateT("Password is not correct!\nPlease, enter correct password."));
- SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_NCPAINT, 0, 0);
- SetDlgItemText(hDlg, IDC_EDIT1, _T(""));
- break;
- }
- else EndDialog(hDlg, IDOK);
+ if (passlen == 0)
+ {
+ SetDlgItemText(hDlg, IDC_HEADERBAR, TranslateT("Miranda NG is locked.\nEnter password to unlock it."));
+ SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_NCPAINT, 0, 0);
+ break;
+ }
+ else if (mir_strcmp(password, g_password))
+ {
+ SetDlgItemText(hDlg, IDC_HEADERBAR, TranslateT("Password is not correct!\nPlease, enter correct password."));
+ SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_NCPAINT, 0, 0);
+ SetDlgItemText(hDlg, IDC_EDIT1, _T(""));
+ break;
}
- else if (uid == IDCANCEL)
- EndDialog(hDlg, IDCANCEL);
+ else EndDialog(hDlg, IDOK);
}
+ else if (uid == IDCANCEL)
+ EndDialog(hDlg, IDCANCEL);
+ }
case WM_TIMER:
LanguageChanged(hDlg);
@@ -160,31 +160,31 @@ static void LanguageChanged(HWND hDlg)
HKL LangID = GetKeyboardLayout(0);
if (LangID != oldLangID)
{
- char Lang[3] = {0};
+ char Lang[3] = { 0 };
oldLangID = LangID;
- GetLocaleInfoA(MAKELCID(((WORD)LangID & 0xffffffff), SORT_DEFAULT), LOCALE_SABBREVLANGNAME, Lang, 2);
+ GetLocaleInfoA(MAKELCID(((WORD)LangID & 0xffffffff), SORT_DEFAULT), LOCALE_SABBREVLANGNAME, Lang, 2);
Lang[0] = toupper(Lang[0]);
Lang[1] = tolower(Lang[1]);
SetDlgItemTextA(hDlg, IDC_LANG, Lang);
}
}
-BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM)
+BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM)
{
DWORD dwWndPID;
- GetWindowThreadProcessId(hWnd,&dwWndPID);
+ GetWindowThreadProcessId(hWnd, &dwWndPID);
if ((g_dwMirandaPID == dwWndPID) && hWnd != g_hDlgPass && IsWindowVisible(hWnd))
{
TCHAR szTemp[32];
- GetClassName(hWnd,szTemp,32);
+ GetClassName(hWnd, szTemp, 32);
- if (mir_tstrcmp(szTemp,_T("MirandaThumbsWnd")) == 0) // hide floating contacts
+ if (mir_tstrcmp(szTemp, _T("MirandaThumbsWnd")) == 0) // hide floating contacts
{
- CallService("FloatingContacts/MainHideAllThumbs",0,0);
+ CallService("FloatingContacts/MainHideAllThumbs", 0, 0);
g_bOldSetting |= OLD_FLTCONT;
}
- else if (mir_tstrcmp(szTemp,_T("PopupWnd2")) == 0 || mir_tstrcmp(szTemp,_T("YAPPWinClass")) == 0) // destroy opened popups
+ else if (mir_tstrcmp(szTemp, _T("PopupWnd2")) == 0 || mir_tstrcmp(szTemp, _T("YAPPWinClass")) == 0) // destroy opened popups
PUDeletePopup(hWnd);
else
{
@@ -193,7 +193,7 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM)
// add to list
node->next = g_pMirWnds;
g_pMirWnds = node;
- ShowWindow(hWnd,SW_HIDE);
+ ShowWindow(hWnd, SW_HIDE);
}
}
return true;
@@ -201,28 +201,28 @@ BOOL CALLBACK EnumWindowsProc(HWND hWnd,LPARAM)
TCHAR* GetDefStatusMsg(unsigned uStatus, const char* szProto)
{
- return (TCHAR*)CallService (MS_AWAYMSG_GETSTATUSMSGT, uStatus, (LPARAM)szProto);
+ return (TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, uStatus, (LPARAM)szProto);
}
void SetStatus(const char* szProto, unsigned status, TCHAR *tszAwayMsg)
{
- if ( tszAwayMsg && CallProtoService( szProto, PS_GETCAPS, PFLAGNUM_1, 0 ) & PF1_MODEMSGSEND )
+ if (tszAwayMsg && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND)
{
- if ( CallProtoService( szProto, PS_SETAWAYMSGT, status, (LPARAM) tszAwayMsg ) == CALLSERVICE_NOTFOUND )
+ if (CallProtoService(szProto, PS_SETAWAYMSGT, status, (LPARAM)tszAwayMsg) == CALLSERVICE_NOTFOUND)
{
char *szAwayMsg = mir_t2a(tszAwayMsg);
- CallProtoService( szProto, PS_SETAWAYMSG, status, (LPARAM)szAwayMsg );
+ CallProtoService(szProto, PS_SETAWAYMSG, status, (LPARAM)szAwayMsg);
mir_free(szAwayMsg);
}
}
- CallProtoService( szProto, PS_SETSTATUS, status, 0 );
+ CallProtoService(szProto, PS_SETSTATUS, status, 0);
}
static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg)
{
- for (int i=0; i < protoCount; i++)
+ for (int i = 0; i < protoCount; i++)
{
- unsigned status = CallProtoService(proto[i]->szModuleName,PS_GETSTATUS,0,0);
+ unsigned status = CallProtoService(proto[i]->szModuleName, PS_GETSTATUS, 0, 0);
if (
(g_wMask & OPT_ONLINEONLY) ? // check "Change only if current status is Online" option
((status == ID_STATUS_ONLINE) || (status == ID_STATUS_FREECHAT)) // process only "online" and "free for chat"
@@ -244,9 +244,9 @@ static int ChangeAllProtoStatuses(unsigned statusMode, TCHAR *msg)
static int BackAllProtoStatuses(void)
{
- for (int i=0; i < protoCount; i++)
+ for (int i = 0; i < protoCount; i++)
{
- if ( oldStatus[i] )
+ if (oldStatus[i])
{
SetStatus(proto[i]->szModuleName, oldStatus[i], oldStatusMsg[i]);
if (oldStatusMsg[i])
@@ -264,10 +264,11 @@ static void CreateTrayIcon(bool create)
{
NOTIFYICONDATA nim;
DBVARIANT dbVar;
- if (!db_get_ts(NULL,MOD_NAME,"ToolTipText",&dbVar)) {
+ if (!db_get_ts(NULL, MOD_NAME, "ToolTipText", &dbVar)) {
_tcsncpy_s(nim.szTip, dbVar.ptszVal, _TRUNCATE);
db_free(&dbVar);
- } else
+ }
+ else
_tcsncpy_s(nim.szTip, _T("Miranda NG"), _TRUNCATE);
nim.cbSize = sizeof(nim);
@@ -286,160 +287,160 @@ static void RestoreOldSettings(void)
CallService(MS_POPUP_QUERY, PUQS_ENABLEPOPUPS, 0);
if (g_bOldSetting & OLD_SOUND)
- db_set_b(NULL,"Skin","UseSound", 1);
+ db_set_b(NULL, "Skin", "UseSound", 1);
if (g_bOldSetting & OLD_FLTCONT) // show Floating contacts if needed
{
- if(ServiceExists("FloatingContacts/MainHideAllThumbs"))
- CallService("FloatingContacts/MainHideAllThumbs",0,0);
+ if (ServiceExists("FloatingContacts/MainHideAllThumbs"))
+ CallService("FloatingContacts/MainHideAllThumbs", 0, 0);
else
- db_set_b(NULL,"FloatingContacts","HideAll", 0);
+ db_set_b(NULL, "FloatingContacts", "HideAll", 0);
}
g_bOldSetting = 0;
}
-LRESULT CALLBACK ListenWndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
+LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg){
case WM_WTSSESSION_CHANGE:
if (wParam == WTS_SESSION_LOCK && g_wMaskAdv & OPT_HIDEIFLOCK && !g_bWindowHidden) // Windows locked
- PostMessage(hWnd,WM_USER + 40, 0, 0);
+ PostMessage(hWnd, WM_USER + 40, 0, 0);
return 0;
case WM_USER + 24:
if (lParam == WM_LBUTTONDBLCLK)
- PostMessage(hWnd,WM_USER + 52, 0, 0);
+ PostMessage(hWnd, WM_USER + 52, 0, 0);
return 0;
- case WM_USER+40: // hide
- {
- if (g_bWindowHidden || g_fOptionsOpen) // already hidden or in options, no hiding
- break;
+ case WM_USER + 40: // hide
+ {
+ if (g_bWindowHidden || g_fOptionsOpen) // already hidden or in options, no hiding
+ break;
- DWORD dwWndPID; // remember foreground window
- HWND hForegroundWnd = GetForegroundWindow();
- GetWindowThreadProcessId(hForegroundWnd,&dwWndPID);
- if (g_dwMirandaPID == dwWndPID)
- hOldForegroundWindow = hForegroundWnd;
+ DWORD dwWndPID; // remember foreground window
+ HWND hForegroundWnd = GetForegroundWindow();
+ GetWindowThreadProcessId(hForegroundWnd, &dwWndPID);
+ if (g_dwMirandaPID == dwWndPID)
+ hOldForegroundWindow = hForegroundWnd;
- EnumWindows(EnumWindowsProc, 0);
+ EnumWindows(EnumWindowsProc, 0);
- if (g_wMask & OPT_CHANGESTATUS) // is this even needed?
+ if (g_wMask & OPT_CHANGESTATUS) // is this even needed?
+ {
+ BYTE bReqMode = db_get_b(NULL, MOD_NAME, "stattype", 2);
+ unsigned uMode = (STATUS_ARR_TO_ID[bReqMode]);
+ DBVARIANT dbVar;
+ if (g_wMask & OPT_USEDEFMSG || db_get_ts(NULL, MOD_NAME, "statmsg", &dbVar))
{
- BYTE bReqMode = db_get_b(NULL, MOD_NAME, "stattype", 2);
- unsigned uMode = (STATUS_ARR_TO_ID[bReqMode]);
- DBVARIANT dbVar;
- if (g_wMask & OPT_USEDEFMSG || db_get_ts(NULL,MOD_NAME,"statmsg",&dbVar))
+ TCHAR *ptszDefMsg = GetDefStatusMsg(uMode, 0);
+ ChangeAllProtoStatuses(uMode, ptszDefMsg);
+ mir_free(ptszDefMsg);
+ }
+ else
+ {
+ if (ServiceExists(MS_VARS_FORMATSTRING))
{
- TCHAR *ptszDefMsg = GetDefStatusMsg(uMode, 0);
- ChangeAllProtoStatuses(uMode, ptszDefMsg);
- mir_free(ptszDefMsg);
+ TCHAR *ptszParsed = variables_parse(dbVar.ptszVal, 0, 0);
+ ChangeAllProtoStatuses(uMode, ptszParsed);
+ mir_free(ptszParsed);
}
else
- {
- if (ServiceExists(MS_VARS_FORMATSTRING))
- {
- TCHAR *ptszParsed = variables_parse(dbVar.ptszVal, 0, 0);
- ChangeAllProtoStatuses(uMode, ptszParsed);
- mir_free(ptszParsed);
- }
- else
- ChangeAllProtoStatuses(uMode, dbVar.ptszVal);
- db_free(&dbVar);
- }
+ ChangeAllProtoStatuses(uMode, dbVar.ptszVal);
+ db_free(&dbVar);
}
+ }
- pcli->pfnTrayIconDestroy (pcli->hwndContactList);
- pcli->pfnUninitTray();
+ pcli->pfnTrayIconDestroy(pcli->hwndContactList);
+ pcli->pfnUninitTray();
- if (g_wMask & OPT_TRAYICON)
- CreateTrayIcon(true);
+ if (g_wMask & OPT_TRAYICON)
+ CreateTrayIcon(true);
- // disable popups
- if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1)
- {
- // save current
- g_bOldSetting |= OLD_POPUP;
- CallService(MS_POPUP_QUERY, PUQS_DISABLEPOPUPS, 0);
- }
+ // disable popups
+ if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1)
+ {
+ // save current
+ g_bOldSetting |= OLD_POPUP;
+ CallService(MS_POPUP_QUERY, PUQS_DISABLEPOPUPS, 0);
+ }
- // disable sounds
- if ((g_wMask & OPT_DISABLESNDS) && db_get_b(NULL,"Skin","UseSound",1))
- {
- // save current
- g_bOldSetting |= OLD_SOUND;
- db_set_b(NULL,"Skin","UseSound",0);
- }
+ // disable sounds
+ if ((g_wMask & OPT_DISABLESNDS) && db_get_b(NULL, "Skin", "UseSound", 1))
+ {
+ // save current
+ g_bOldSetting |= OLD_SOUND;
+ db_set_b(NULL, "Skin", "UseSound", 0);
+ }
- g_bWindowHidden = true;
+ g_bWindowHidden = true;
- g_bOldSetting |= OLD_WASHIDDEN;
- db_set_b(NULL, MOD_NAME, "OldSetting", g_bOldSetting);
- }
- return 0;
+ g_bOldSetting |= OLD_WASHIDDEN;
+ db_set_b(NULL, MOD_NAME, "OldSetting", g_bOldSetting);
+ }
+ return 0;
- case WM_USER+52: // back
- {
- if (!g_bWindowHidden || g_fPassRequested)
- break;
+ case WM_USER + 52: // back
+ {
+ if (!g_bWindowHidden || g_fPassRequested)
+ break;
- if (g_wMask & OPT_REQPASS){ //password request
- DBVARIANT dbVar;
- if (!db_get_s(NULL,MOD_NAME, "password", &dbVar)) {
- g_fPassRequested = true;
+ if (g_wMask & OPT_REQPASS){ //password request
+ DBVARIANT dbVar;
+ if (!db_get_s(NULL, MOD_NAME, "password", &dbVar)) {
+ g_fPassRequested = true;
- strncpy(g_password, dbVar.pszVal, MAXPASSLEN);
- db_free(&dbVar);
+ strncpy(g_password, dbVar.pszVal, MAXPASSLEN);
+ db_free(&dbVar);
- int res = DialogBox(g_hInstance,(MAKEINTRESOURCE(IDD_PASSDIALOGNEW)),GetForegroundWindow(), DlgStdInProc);
+ int res = DialogBox(g_hInstance, (MAKEINTRESOURCE(IDD_PASSDIALOGNEW)), GetForegroundWindow(), DlgStdInProc);
- g_fPassRequested = false;
- if(res != IDOK) return 0;
- }
+ g_fPassRequested = false;
+ if (res != IDOK) return 0;
}
+ }
- if (g_wMask & OPT_CHANGESTATUS && g_wMask & OPT_SETONLINEBACK) // set back to some status
- BackAllProtoStatuses();
+ if (g_wMask & OPT_CHANGESTATUS && g_wMask & OPT_SETONLINEBACK) // set back to some status
+ BackAllProtoStatuses();
- HWND_ITEM *pCurWnd = g_pMirWnds;
- while (pCurWnd != NULL)
- {
- HWND_ITEM *pNextWnd = pCurWnd->next;
- TCHAR szTemp[32];
- GetClassName(pCurWnd->hWnd,szTemp,32);
+ HWND_ITEM *pCurWnd = g_pMirWnds;
+ while (pCurWnd != NULL)
+ {
+ HWND_ITEM *pNextWnd = pCurWnd->next;
+ TCHAR szTemp[32];
+ GetClassName(pCurWnd->hWnd, szTemp, 32);
- if (IsWindow(pCurWnd->hWnd) && mir_tstrcmp(szTemp,_T("SysShadow")) != 0) // precaution
- ShowWindow(pCurWnd->hWnd, SW_SHOW);
+ if (IsWindow(pCurWnd->hWnd) && mir_tstrcmp(szTemp, _T("SysShadow")) != 0) // precaution
+ ShowWindow(pCurWnd->hWnd, SW_SHOW);
- delete pCurWnd; // bye-bye
- pCurWnd = pNextWnd; // traverse to next item
- }
- g_pMirWnds = NULL;
+ delete pCurWnd; // bye-bye
+ pCurWnd = pNextWnd; // traverse to next item
+ }
+ g_pMirWnds = NULL;
- if (hOldForegroundWindow)
- {
- SetForegroundWindow(hOldForegroundWindow);
- hOldForegroundWindow = NULL;
- }
+ if (hOldForegroundWindow)
+ {
+ SetForegroundWindow(hOldForegroundWindow);
+ hOldForegroundWindow = NULL;
+ }
- RestoreOldSettings();
+ RestoreOldSettings();
- if (g_TrayIcon) CreateTrayIcon(false);
+ if (g_TrayIcon) CreateTrayIcon(false);
- pcli->pfnInitTray();
- pcli->pfnTrayIconInit(pcli->hwndContactList);
+ pcli->pfnInitTray();
+ pcli->pfnTrayIconInit(pcli->hwndContactList);
- // force a redraw
- // should prevent drawing problems
- InvalidateRect(pcli->hwndContactList,NULL,true);
- UpdateWindow(pcli->hwndContactList);
+ // force a redraw
+ // should prevent drawing problems
+ InvalidateRect(pcli->hwndContactList, NULL, true);
+ UpdateWindow(pcli->hwndContactList);
- PostMessage(hWnd, WM_MOUSEMOVE, 0, (LPARAM)MAKELONG(2, 2)); // reset core's IDLE
- g_bWindowHidden = false;
+ PostMessage(hWnd, WM_MOUSEMOVE, 0, (LPARAM)MAKELONG(2, 2)); // reset core's IDLE
+ g_bWindowHidden = false;
- db_set_b(NULL, MOD_NAME, "OldSetting", 0);
- }
- return 0;
+ db_set_b(NULL, MOD_NAME, "OldSetting", 0);
+ }
+ return 0;
}
return(DefWindowProc(hWnd, uMsg, wParam, lParam));
}
@@ -451,11 +452,11 @@ static int MsgWinOpening(WPARAM, LPARAM) // hiding new message windows
return 0;
}
-VOID CALLBACK WinEventProc(HWINEVENTHOOK g_hWinHook, DWORD event, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime)
+VOID CALLBACK WinEventProc(HWINEVENTHOOK, DWORD event, HWND hwnd, LONG idObject, LONG, DWORD, DWORD)
{
if (g_bWindowHidden && idObject == OBJID_WINDOW && (event == EVENT_OBJECT_CREATE || event == EVENT_OBJECT_SHOW) && (IsWindowVisible(hwnd)))
{
- if(hwnd == pcli->hwndContactList)
+ if (hwnd == pcli->hwndContactList)
ShowWindow(hwnd, SW_HIDE);
else
EnumWindows(EnumWindowsProc, 0);
@@ -470,7 +471,7 @@ INT_PTR BossKeyHideMiranda(WPARAM, LPARAM) // for service :)
static TCHAR *HokeyVkToName(WORD vkKey)
{
- static TCHAR buf[32] = {0};
+ static TCHAR buf[32] = { 0 };
DWORD code = MapVirtualKey(vkKey, 0) << 16;
switch (vkKey)
@@ -507,17 +508,17 @@ static TCHAR *HokeyVkToName(WORD vkKey)
static TCHAR *GetBossKeyText(void)
{
- WORD wHotKey = db_get_w(NULL,"SkinHotKeys", "Hide/Show Miranda", HOTKEYCODE(HOTKEYF_CONTROL, VK_F12));
+ WORD wHotKey = db_get_w(NULL, "SkinHotKeys", "Hide/Show Miranda", HOTKEYCODE(HOTKEYF_CONTROL, VK_F12));
BYTE key = LOBYTE(wHotKey);
BYTE shift = HIBYTE(wHotKey);
- static TCHAR buf[128] = {0};
+ static TCHAR buf[128] = { 0 };
mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s%s%s"),
- (shift & HOTKEYF_CONTROL) ? _T("Ctrl + ") : _T(""),
- (shift & HOTKEYF_SHIFT) ? _T("Shift + ") : _T(""),
- (shift & HOTKEYF_ALT) ? _T("Alt + ") : _T(""),
- (shift & HOTKEYF_EXT) ? _T("Win + ") : _T(""),
+ (shift & HOTKEYF_CONTROL) ? _T("Ctrl + ") : _T(""),
+ (shift & HOTKEYF_SHIFT) ? _T("Shift + ") : _T(""),
+ (shift & HOTKEYF_ALT) ? _T("Alt + ") : _T(""),
+ (shift & HOTKEYF_EXT) ? _T("Win + ") : _T(""),
HokeyVkToName(key));
return buf;
@@ -531,11 +532,11 @@ static IconItem iconList[] =
static int GenMenuInit(WPARAM, LPARAM) // Modify menu item text before to show the main menu
{
if (g_hMenuItem) {
- TCHAR buf[128] = {0};
+ TCHAR buf[128] = { 0 };
mir_sntprintf(buf, SIZEOF(buf), _T("%s [%s]"), TranslateT("Hide"), GetBossKeyText());
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | CMIF_TCHAR | CMIM_NAME;
+ mi.flags = CMIM_FLAGS | CMIF_TCHAR | CMIM_NAME;
mi.ptszName = buf;
Menu_ModifyItem(g_hMenuItem, &mi);
@@ -564,9 +565,9 @@ void BossKeyMenuItemUnInit(void) // Remove menu item
g_hMenuItem = 0;
}
-void RegisterCoreHotKeys (void)
+void RegisterCoreHotKeys(void)
{
- HOTKEYDESC hotkey = {0};
+ HOTKEYDESC hotkey = { 0 };
hotkey.cbSize = sizeof(HOTKEYDESC);
hotkey.pszName = "Hide/Show Miranda";
hotkey.pszDescription = LPGEN("Hide/Show Miranda");
@@ -591,7 +592,7 @@ static int TopToolbarInit(WPARAM, LPARAM)
// Tabsrmm toolbar support
static int TabsrmmButtonPressed(WPARAM, LPARAM lParam)
{
- CustomButtonClickData *cbcd=(CustomButtonClickData *)lParam;
+ CustomButtonClickData *cbcd = (CustomButtonClickData *)lParam;
if (!strcmp(cbcd->pszModule, MOD_NAME))
BossKeyHideMiranda(0, 0);
@@ -601,7 +602,7 @@ static int TabsrmmButtonPressed(WPARAM, LPARAM lParam)
static int TabsrmmButtonsInit(WPARAM, LPARAM)
{
- BBButton bbd = {0};
+ BBButton bbd = { 0 };
bbd.cbSize = sizeof(BBButton);
bbd.pszModuleName = MOD_NAME;
@@ -609,7 +610,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM)
bbd.ptszTooltip = LPGENT("Hide Miranda NG");
bbd.bbbFlags = BBBF_ISRSIDEBUTTON | BBBF_CANBEHIDDEN;
bbd.hIcon = iconList[0].hIcolib;
- CallService (MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
+ CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
return 0;
}
@@ -623,7 +624,7 @@ static TCHAR *VariablesBossKey(ARGUMENTSINFO *ai) {
return GetBossKeyText();
}
-static int EnumProtos(WPARAM wParam, LPARAM lParam)
+static int EnumProtos(WPARAM, LPARAM)
{
ProtoEnumAccounts(&protoCount, &proto);
@@ -631,7 +632,7 @@ static int EnumProtos(WPARAM wParam, LPARAM lParam)
delete[] oldStatusMsg;
oldStatus = new unsigned[protoCount];
- oldStatusMsg = new TCHAR* [protoCount];
+ oldStatusMsg = new TCHAR*[protoCount];
for (int i = 0; i < protoCount; i++)
{
oldStatus[i] = 0;
@@ -640,9 +641,9 @@ static int EnumProtos(WPARAM wParam, LPARAM lParam)
return 0;
}
-int MirandaLoaded(WPARAM,LPARAM)
+int MirandaLoaded(WPARAM, LPARAM)
{
- g_wMask = db_get_w(NULL,MOD_NAME,"optsmask",DEFAULTSETTING);
+ g_wMask = db_get_w(NULL, MOD_NAME, "optsmask", DEFAULTSETTING);
RegisterCoreHotKeys();
@@ -657,7 +658,7 @@ int MirandaLoaded(WPARAM,LPARAM)
GetWindowThreadProcessId(pcli->hwndContactList, &g_dwMirandaPID);
- WNDCLASS winclass = {0};
+ WNDCLASS winclass = { 0 };
winclass.lpfnWndProc = ListenWndProc;
winclass.hInstance = g_hInstance;
winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
@@ -665,7 +666,7 @@ int MirandaLoaded(WPARAM,LPARAM)
if (RegisterClass(&winclass))
{
- g_hListenWindow = CreateWindow(BOSSKEY_LISTEN_INFO,BOSSKEY_LISTEN_INFO,WS_POPUP,0,0,5,5,pcli->hwndContactList,NULL,g_hInstance,NULL);
+ g_hListenWindow = CreateWindow(BOSSKEY_LISTEN_INFO, BOSSKEY_LISTEN_INFO, WS_POPUP, 0, 0, 5, 5, pcli->hwndContactList, NULL, g_hInstance, NULL);
WTSRegisterSessionNotification(g_hListenWindow, 0);
}
@@ -673,7 +674,7 @@ int MirandaLoaded(WPARAM,LPARAM)
{
hDwmApi = LoadLibrary(_T("dwmapi.dll"));
if (hDwmApi)
- dwmIsCompositionEnabled = (PFNDwmIsCompositionEnabled)GetProcAddress(hDwmApi,"DwmIsCompositionEnabled");
+ dwmIsCompositionEnabled = (PFNDwmIsCompositionEnabled)GetProcAddress(hDwmApi, "DwmIsCompositionEnabled");
}
if (g_wMaskAdv & OPT_MENUITEM)
BossKeyMenuItemInit();
@@ -681,7 +682,7 @@ int MirandaLoaded(WPARAM,LPARAM)
// Register token for variables plugin
if (ServiceExists(MS_VARS_REGISTERTOKEN))
{
- TOKENREGISTER tr = {0};
+ TOKENREGISTER tr = { 0 };
tr.cbSize = sizeof(TOKENREGISTER);
tr.memType = TR_MEM_OWNER;
tr.flags = TRF_FIELD | TRF_TCHAR | TRF_PARSEFUNC;
@@ -689,7 +690,7 @@ int MirandaLoaded(WPARAM,LPARAM)
tr.tszTokenString = _T("bosskeyname");
tr.parseFunctionT = VariablesBossKey;
tr.szHelpText = LPGEN("BossKey")"\t"LPGEN("get the BossKey name");
- CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM) &tr);
+ CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM)&tr);
}
EnumProtos(0, 0);
@@ -709,7 +710,7 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getLP(&pluginInfo);
mir_getCLI();
- g_wMaskAdv = db_get_w(NULL,MOD_NAME,"optsmaskadv",0);
+ g_wMaskAdv = db_get_w(NULL, MOD_NAME, "optsmaskadv", 0);
g_bOldSetting = db_get_b(NULL, MOD_NAME, "OldSetting", 0);
if ((g_bOldSetting & OLD_POPUP) && !(g_wMaskAdv & OPT_RESTORE)) // Restore popup settings if Miranda was crushed or killed in hidden mode and "Restore hiding on startup after failure" option is disabled
@@ -725,9 +726,9 @@ extern "C" int __declspec(dllexport) Load(void)
Icon_Register(g_hInstance, "BossKey", iconList, SIZEOF(iconList));
- g_hHideService = CreateServiceFunction(MS_BOSSKEY_HIDE,BossKeyHideMiranda); // Create service
+ g_hHideService = CreateServiceFunction(MS_BOSSKEY_HIDE, BossKeyHideMiranda); // Create service
- HookEvent(ME_SYSTEM_MODULESLOADED,MirandaLoaded);
+ HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded);
return 0;
}
diff --git a/plugins/BossKeyPlus/src/BossKey.h b/plugins/BossKeyPlus/src/BossKey.h
index b28d22efdd..f7b71b3db5 100644
--- a/plugins/BossKeyPlus/src/BossKey.h
+++ b/plugins/BossKeyPlus/src/BossKey.h
@@ -2,20 +2,20 @@
BossKey - Hide Miranda from your boss :)
Copyright (C) 2002-2003 Goblineye Entertainment, (C) 2007-2010 Billy_Bons
- 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 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.
+ 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; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
#pragma once
@@ -88,11 +88,11 @@ extern HINSTANCE g_hInstance;
extern bool g_bWindowHidden;
extern UINT minutes;
-int OptsDlgInit(WPARAM wParam,LPARAM lParam);
+int OptsDlgInit(WPARAM wParam, LPARAM lParam);
INT_PTR BossKeyHideMiranda(WPARAM wParam, LPARAM lParam);
void BossKeyMenuItemInit(void);
void BossKeyMenuItemUnInit(void);
-TCHAR *GetBossKeyText(void);
+static TCHAR *GetBossKeyText(void);
void InitIdleTimer(void);
void UninitIdleTimer(void);
TCHAR* GetDefStatusMsg(unsigned uMode, const char* szProto);
@@ -104,4 +104,4 @@ typedef struct HWND_ITEM_TYPE
HWND_ITEM_TYPE *next;
} HWND_ITEM;
-typedef HRESULT (WINAPI *PFNDwmIsCompositionEnabled)(BOOL *);
+typedef HRESULT(WINAPI *PFNDwmIsCompositionEnabled)(BOOL *);
diff --git a/plugins/BossKeyPlus/src/BossKeyIdle.cpp b/plugins/BossKeyPlus/src/BossKeyIdle.cpp
index 57a1044734..3bdc04a9d8 100644
--- a/plugins/BossKeyPlus/src/BossKeyIdle.cpp
+++ b/plugins/BossKeyPlus/src/BossKeyIdle.cpp
@@ -33,29 +33,29 @@ VOID CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT idEvent, DWORD dwTime);
static bool IsUserIdle()
{
DWORD dwTick;
- if ( g_wMaskAdv & OPT_HIDEIFMIRIDLE ) {
+ if (g_wMaskAdv & OPT_HIDEIFMIRIDLE) {
CallService(MS_SYSTEM_GETIDLE, 0, (LPARAM)&dwTick);
return GetTickCount() - dwTick > (minutes * 60 * 1000);
}
LASTINPUTINFO ii = { sizeof(ii) };
- if ( GetLastInputInfo(&ii))
+ if (GetLastInputInfo(&ii))
return GetTickCount() - ii.dwTime > (minutes * 60 * 1000);
return FALSE;
}
-VOID CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT_PTR idEvent, DWORD dwTime)
+VOID CALLBACK IdleTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
{
- if ( hTimer == idEvent && !g_bWindowHidden && ((g_wMaskAdv & (OPT_HIDEIFWINIDLE | OPT_HIDEIFMIRIDLE) && IsUserIdle()) ||
- (g_wMaskAdv & OPT_HIDEIFSCRSVR) && IsScreenSaverRunning()))
+ if (hTimer == idEvent && !g_bWindowHidden && ((g_wMaskAdv & (OPT_HIDEIFWINIDLE | OPT_HIDEIFMIRIDLE) && IsUserIdle()) ||
+ (g_wMaskAdv & OPT_HIDEIFSCRSVR) && IsScreenSaverRunning()))
BossKeyHideMiranda(0, 0);
}
void InitIdleTimer()
{
- minutes = db_get_b(NULL,MOD_NAME,"time",10);
- hTimer=SetTimer(NULL, 0, 2000, IdleTimer);
+ minutes = db_get_b(NULL, MOD_NAME, "time", 10);
+ hTimer = SetTimer(NULL, 0, 2000, IdleTimer);
}
void UninitIdleTimer()
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp
index 0b1e541f99..3708d3fe25 100644
--- a/plugins/BossKeyPlus/src/Options.cpp
+++ b/plugins/BossKeyPlus/src/Options.cpp
@@ -2,20 +2,20 @@
BossKey - Hide Miranda from your boss :)
Copyright (C) 2002-2003 Goblineye Entertainment, (C) 2007-2010 Billy_Bons
- 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 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.
+ 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; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
#include "BossKey.h"
@@ -23,7 +23,7 @@ bool g_fOptionsOpen;
bool g_fReqRass;
extern HGENMENU g_hMenuItem;
-INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool s_fRedraw;
@@ -37,30 +37,30 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
// set icon and tooltip for variables help button
variables_skin_helpbutton(hwndDlg, IDC_MAINOPT_VARHELP);
- SendDlgItemMessage(hwndDlg,IDC_MAINOPT_PASS,EM_LIMITTEXT,MAXPASSLEN,0); // limit password length
+ SendDlgItemMessage(hwndDlg, IDC_MAINOPT_PASS, EM_LIMITTEXT, MAXPASSLEN, 0); // limit password length
DBVARIANT dbVar;
- if (!db_get_s(NULL,MOD_NAME,"password",&dbVar)) {
- SetDlgItemTextA(hwndDlg,IDC_MAINOPT_PASS,dbVar.pszVal);
+ if (!db_get_s(NULL, MOD_NAME, "password", &dbVar)) {
+ SetDlgItemTextA(hwndDlg, IDC_MAINOPT_PASS, dbVar.pszVal);
db_free(&dbVar);
}
- CheckDlgButton(hwndDlg,IDC_MAINOPT_SETONLINEBACK,(g_wMask & OPT_SETONLINEBACK) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_CHANGESTATUSBOX,(g_wMask & OPT_CHANGESTATUS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_DISABLESNDS,(g_wMask & OPT_DISABLESNDS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_REQPASS,(g_wMask & OPT_REQPASS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_ONLINEONLY,(g_wMask & OPT_ONLINEONLY) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_USEDEFMSG,(g_wMask & OPT_USEDEFMSG) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_TRAYICON,(g_wMask & OPT_TRAYICON) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_SETONLINEBACK, (g_wMask & OPT_SETONLINEBACK) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_CHANGESTATUSBOX, (g_wMask & OPT_CHANGESTATUS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_DISABLESNDS, (g_wMask & OPT_DISABLESNDS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_REQPASS, (g_wMask & OPT_REQPASS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_ONLINEONLY, (g_wMask & OPT_ONLINEONLY) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_USEDEFMSG, (g_wMask & OPT_USEDEFMSG) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_TRAYICON, (g_wMask & OPT_TRAYICON) ? BST_CHECKED : BST_UNCHECKED);
- for (int i=ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_INSERTSTRING, -1, (LPARAM)pcli->pfnGetStatusModeDescription(i, 0));
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_SETCURSEL, db_get_b(NULL, MOD_NAME, "stattype", 2), 0);
- SendMessage(hwndDlg,WM_USER + 60,0,0);
- SendMessage(hwndDlg,WM_USER + 50,0,0);
+ SendMessage(hwndDlg, WM_USER + 60, 0, 0);
+ SendMessage(hwndDlg, WM_USER + 50, 0, 0);
s_fRedraw = true;
}
@@ -74,117 +74,117 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
// this plugin ain't that big, no need for a seperate routine
// write down status type
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED) {
- db_set_b(NULL,MOD_NAME,"stattype",(BYTE)SendDlgItemMessage(hwndDlg,IDC_MAINOPT_CHGSTS,CB_GETCURSEL,0,0));
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED) {
+ db_set_b(NULL, MOD_NAME, "stattype", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_GETCURSEL, 0, 0));
// status msg, if needed
- if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_MAINOPT_STATMSG))) { // meaning we should save it
+ if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MAINOPT_STATMSG))) { // meaning we should save it
TCHAR tszMsg[1025];
- GetDlgItemText(hwndDlg,IDC_MAINOPT_STATMSG,tszMsg,SIZEOF(tszMsg));
+ GetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, tszMsg, SIZEOF(tszMsg));
if (tszMsg[0] != 0)
- db_set_ts(NULL,MOD_NAME,"statmsg",tszMsg);
+ db_set_ts(NULL, MOD_NAME, "statmsg", tszMsg);
else // delete current setting
- db_unset(NULL,MOD_NAME,"statmsg");
+ db_unset(NULL, MOD_NAME, "statmsg");
}
wMask |= OPT_CHANGESTATUS;
}
// checkbox
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_REQPASS) == BST_CHECKED) {
- char szPass[MAXPASSLEN+1];
- GetDlgItemTextA(hwndDlg,IDC_MAINOPT_PASS,szPass,SIZEOF(szPass));
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_REQPASS) == BST_CHECKED) {
+ char szPass[MAXPASSLEN + 1];
+ GetDlgItemTextA(hwndDlg, IDC_MAINOPT_PASS, szPass, SIZEOF(szPass));
if (szPass[0] != 0){
- db_set_s(NULL,MOD_NAME,"password",szPass);
+ db_set_s(NULL, MOD_NAME, "password", szPass);
wMask |= OPT_REQPASS;
}
}
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_SETONLINEBACK) == BST_CHECKED) wMask |= OPT_SETONLINEBACK;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_DISABLESNDS) == BST_CHECKED) wMask |= OPT_DISABLESNDS;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_ONLINEONLY) == BST_CHECKED) wMask |= OPT_ONLINEONLY;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_USEDEFMSG) == BST_CHECKED) wMask |= OPT_USEDEFMSG;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_TRAYICON) == BST_CHECKED) wMask |= OPT_TRAYICON;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_SETONLINEBACK) == BST_CHECKED) wMask |= OPT_SETONLINEBACK;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_DISABLESNDS) == BST_CHECKED) wMask |= OPT_DISABLESNDS;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_ONLINEONLY) == BST_CHECKED) wMask |= OPT_ONLINEONLY;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_USEDEFMSG) == BST_CHECKED) wMask |= OPT_USEDEFMSG;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_TRAYICON) == BST_CHECKED) wMask |= OPT_TRAYICON;
- db_set_w(NULL,MOD_NAME,"optsmask",wMask);
+ db_set_w(NULL, MOD_NAME, "optsmask", wMask);
g_wMask = wMask;
return true;
}
break;
- case WM_USER+50: // we're told to checkout the selection state of the combobox, and enable/disable accordingly
- {
- BYTE bSelection = (BYTE)SendDlgItemMessage(hwndDlg,IDC_MAINOPT_CHGSTS,CB_GETCURSEL,0,0);
- WORD wMode = STATUS_ARR_TO_ID[bSelection];
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_USEDEFMSG) == BST_CHECKED) {
- TCHAR *ptszDefMsg = GetDefStatusMsg(wMode, 0);
- SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, ptszDefMsg);
- if(ptszDefMsg)
- mir_free(ptszDefMsg);
- }
- else {
- DBVARIANT dbVar;
- SendDlgItemMessage(hwndDlg,IDC_MAINOPT_STATMSG,EM_LIMITTEXT,1024,0);
- if (!db_get_ts(NULL,MOD_NAME,"statmsg",&dbVar)) {
- SetDlgItemText(hwndDlg,IDC_MAINOPT_STATMSG,dbVar.ptszVal);
- db_free(&dbVar);
- }
- }
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAINOPT_STATMSG),(IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED) && (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_USEDEFMSG) != BST_CHECKED));
- ShowWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_VARHELP), IsWindowEnabled(GetDlgItem(hwndDlg,IDC_MAINOPT_STATMSG)) && ServiceExists(MS_VARS_FORMATSTRING));
+ case WM_USER + 50: // we're told to checkout the selection state of the combobox, and enable/disable accordingly
+ {
+ BYTE bSelection = (BYTE)SendDlgItemMessage(hwndDlg, IDC_MAINOPT_CHGSTS, CB_GETCURSEL, 0, 0);
+ WORD wMode = STATUS_ARR_TO_ID[bSelection];
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_USEDEFMSG) == BST_CHECKED) {
+ TCHAR *ptszDefMsg = GetDefStatusMsg(wMode, 0);
+ SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, ptszDefMsg);
+ if (ptszDefMsg)
+ mir_free(ptszDefMsg);
}
- return true;
-
- case WM_USER+60:
- {
- bool fEnable = IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED;
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAINOPT_CHGSTS),fEnable);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAINOPT_SETONLINEBACK),fEnable);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAINOPT_ONLINEONLY),fEnable);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAINOPT_USEDEFMSG),fEnable);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAINOPT_PASS),IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_REQPASS) == BST_CHECKED);
+ else {
+ DBVARIANT dbVar;
+ SendDlgItemMessage(hwndDlg, IDC_MAINOPT_STATMSG, EM_LIMITTEXT, 1024, 0);
+ if (!db_get_ts(NULL, MOD_NAME, "statmsg", &dbVar)) {
+ SetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, dbVar.ptszVal);
+ db_free(&dbVar);
+ }
}
- return true;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_STATMSG), (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED) && (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_USEDEFMSG) != BST_CHECKED));
+ ShowWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_VARHELP), IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MAINOPT_STATMSG)) && ServiceExists(MS_VARS_FORMATSTRING));
+ }
+ return true;
+
+ case WM_USER + 60:
+ {
+ bool fEnable = IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_CHANGESTATUSBOX) == BST_CHECKED;
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_CHGSTS), fEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_SETONLINEBACK), fEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_ONLINEONLY), fEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_USEDEFMSG), fEnable);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAINOPT_PASS), IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_REQPASS) == BST_CHECKED);
+ }
+ return true;
case WM_COMMAND:
switch (HIWORD(wParam)) {
case CBN_SELCHANGE:
if (LOWORD(wParam) == IDC_MAINOPT_CHGSTS)
- SendMessage(hwndDlg,WM_USER + 50,0,0);
+ SendMessage(hwndDlg, WM_USER + 50, 0, 0);
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return 0;
case BN_CLICKED:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_MAINOPT_DISABLESNDS:
case IDC_MAINOPT_SETONLINEBACK:
case IDC_MAINOPT_ONLINEONLY:
case IDC_MAINOPT_TRAYICON:
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return true;
case IDC_MAINOPT_USEDEFMSG:
- SendMessage(hwndDlg,WM_USER + 50,0,0);
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ SendMessage(hwndDlg, WM_USER + 50, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return true;
case IDC_MAINOPT_CHANGESTATUSBOX:
- SendMessage(hwndDlg,WM_USER + 60,0,0);
- SendMessage(hwndDlg,WM_USER + 50,0,0);
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ SendMessage(hwndDlg, WM_USER + 60, 0, 0);
+ SendMessage(hwndDlg, WM_USER + 50, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return true;
case IDC_MAINOPT_REQPASS:
- SendMessage(hwndDlg,WM_USER + 60,0,0);
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ SendMessage(hwndDlg, WM_USER + 60, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return true;
case IDC_MAINOPT_VARHELP:
- variables_showhelp(hwndDlg, IDC_MAINOPT_STATMSG, VHF_INPUT|VHF_HELP, 0, 0);
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ variables_showhelp(hwndDlg, IDC_MAINOPT_STATMSG, VHF_INPUT | VHF_HELP, 0, 0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return true;
case IDC_MAINOPT_LNK_HOTKEY:
- OPENOPTIONSDIALOG ood = {0};
+ OPENOPTIONSDIALOG ood = { 0 };
ood.cbSize = sizeof(ood);
ood.pszGroup = "Customize";
ood.pszPage = "Hotkeys";
@@ -194,11 +194,11 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
return 0;
case EN_UPDATE:
- switch( LOWORD( wParam )) {
+ switch (LOWORD(wParam)) {
case IDC_MAINOPT_STATMSG:
case IDC_MAINOPT_PASS:
if (s_fRedraw)
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
}
break;
@@ -210,7 +210,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
return(false);
}
-INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static bool inFocus = false;
@@ -220,65 +220,65 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
g_fOptionsOpen = true;
- minutes = db_get_b(NULL,MOD_NAME,"time",10);
- TCHAR szMinutes[4] = {0};
+ minutes = db_get_b(NULL, MOD_NAME, "time", 10);
+ TCHAR szMinutes[4] = { 0 };
_itot(minutes, szMinutes, 10);
- SendDlgItemMessage(hwndDlg,IDC_MAINOPT_TIME,EM_LIMITTEXT,2,0);
+ SendDlgItemMessage(hwndDlg, IDC_MAINOPT_TIME, EM_LIMITTEXT, 2, 0);
SendDlgItemMessage(hwndDlg, IDC_MAINOPT_SPIN_TIME, UDM_SETRANGE32, 1, (LPARAM)99);
- SetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_HIDEIFLOCK,(g_wMaskAdv & OPT_HIDEIFLOCK) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_MENUITEM,(g_wMaskAdv & OPT_MENUITEM) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_HIDEIFWINIDLE,(g_wMaskAdv & OPT_HIDEIFWINIDLE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_HIDEIFMIRIDLE,(g_wMaskAdv & OPT_HIDEIFMIRIDLE) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_HIDEIFSCRSVR,(g_wMaskAdv & OPT_HIDEIFSCRSVR) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_HIDEONSTART,(g_wMaskAdv & OPT_HIDEONSTART) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_MAINOPT_RESTORE,(g_wMaskAdv & OPT_RESTORE) ? BST_CHECKED : BST_UNCHECKED);
+ SetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_HIDEIFLOCK, (g_wMaskAdv & OPT_HIDEIFLOCK) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_MENUITEM, (g_wMaskAdv & OPT_MENUITEM) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_HIDEIFWINIDLE, (g_wMaskAdv & OPT_HIDEIFWINIDLE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_HIDEIFMIRIDLE, (g_wMaskAdv & OPT_HIDEIFMIRIDLE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_HIDEIFSCRSVR, (g_wMaskAdv & OPT_HIDEIFSCRSVR) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_HIDEONSTART, (g_wMaskAdv & OPT_HIDEONSTART) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MAINOPT_RESTORE, (g_wMaskAdv & OPT_RESTORE) ? BST_CHECKED : BST_UNCHECKED);
}
return true;
case WM_NOTIFY:
- {
- NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code) {
- case PSN_APPLY:
- WORD wMaskAdv = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_HIDEIFLOCK) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFLOCK;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_HIDEIFWINIDLE) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFWINIDLE;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_HIDEIFMIRIDLE) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFMIRIDLE;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_HIDEIFSCRSVR) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFSCRSVR;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_HIDEONSTART) == BST_CHECKED) wMaskAdv |= OPT_HIDEONSTART;
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_RESTORE) == BST_CHECKED) wMaskAdv |= OPT_RESTORE;
-
- if (IsDlgButtonChecked(hwndDlg,IDC_MAINOPT_MENUITEM) == BST_CHECKED ) {
- if (g_hMenuItem == 0)
- BossKeyMenuItemInit();
- wMaskAdv |= OPT_MENUITEM;
- }
- else if (g_hMenuItem != 0)
- BossKeyMenuItemUnInit();
-
- TCHAR szMinutes[4] = {0};
- GetDlgItemText(hwndDlg,IDC_MAINOPT_TIME,szMinutes,SIZEOF(szMinutes));
- minutes = _ttoi(szMinutes);
- if(minutes<1) minutes = 1;
- db_set_b(NULL,MOD_NAME,"time",minutes);
- db_set_w(NULL,MOD_NAME,"optsmaskadv",wMaskAdv);
- g_wMaskAdv = wMaskAdv;
- return true;
+ {
+ NMHDR* nmhdr = (NMHDR*)lParam;
+ switch (nmhdr->code) {
+ case PSN_APPLY:
+ WORD wMaskAdv = 0;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_HIDEIFLOCK) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFLOCK;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_HIDEIFWINIDLE) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFWINIDLE;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_HIDEIFMIRIDLE) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFMIRIDLE;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_HIDEIFSCRSVR) == BST_CHECKED) wMaskAdv |= OPT_HIDEIFSCRSVR;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_HIDEONSTART) == BST_CHECKED) wMaskAdv |= OPT_HIDEONSTART;
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_RESTORE) == BST_CHECKED) wMaskAdv |= OPT_RESTORE;
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_MENUITEM) == BST_CHECKED) {
+ if (g_hMenuItem == 0)
+ BossKeyMenuItemInit();
+ wMaskAdv |= OPT_MENUITEM;
}
+ else if (g_hMenuItem != 0)
+ BossKeyMenuItemUnInit();
+
+ TCHAR szMinutes[4] = { 0 };
+ GetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes, SIZEOF(szMinutes));
+ minutes = _ttoi(szMinutes);
+ if (minutes < 1) minutes = 1;
+ db_set_b(NULL, MOD_NAME, "time", minutes);
+ db_set_w(NULL, MOD_NAME, "optsmaskadv", wMaskAdv);
+ g_wMaskAdv = wMaskAdv;
+ return true;
}
- break;
+ }
+ break;
case WM_COMMAND:
switch (HIWORD(wParam)) {
case BN_CLICKED:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_MAINOPT_MENUITEM:
case IDC_MAINOPT_HIDEIFLOCK:
case IDC_MAINOPT_HIDEIFSCRSVR:
case IDC_MAINOPT_HIDEONSTART:
case IDC_MAINOPT_RESTORE:
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return true;
case IDC_MAINOPT_HIDEIFWINIDLE:
@@ -300,10 +300,10 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
return 0;
case EN_UPDATE:
- switch( LOWORD( wParam )) {
+ switch (LOWORD(wParam)) {
case IDC_MAINOPT_TIME:
- if(inFocus)
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,(WPARAM)hwndDlg,0);
+ if (inFocus)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
break;
}
@@ -316,7 +316,7 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
return false;
}
-int OptsDlgInit(WPARAM wParam,LPARAM)
+int OptsDlgInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE optDi = { sizeof(optDi) };
optDi.position = 920000000;
@@ -325,13 +325,13 @@ int OptsDlgInit(WPARAM wParam,LPARAM)
optDi.hInstance = g_hInstance;
optDi.ptszTitle = LPGENT("BossKey");
optDi.ptszGroup = LPGENT("Events");
- optDi.ptszTab = LPGENT("Main");
- optDi.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ optDi.ptszTab = LPGENT("Main");
+ optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR;
Options_AddPage(wParam, &optDi);
optDi.pfnDlgProc = AdvOptDlg;
optDi.pszTemplate = MAKEINTRESOURCEA(IDD_OPTDIALOGADV);
- optDi.ptszTab = LPGENT("Advanced");
+ optDi.ptszTab = LPGENT("Advanced");
Options_AddPage(wParam, &optDi);
return 0;
}