diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-18 14:45:04 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-18 14:45:04 +0000 |
commit | a3385262c10d49a477e1e071a44ebdfd8e4b7d24 (patch) | |
tree | 5f5bdfc4b4cefd0cd71ce692e9ffa83d1b26b816 /plugins/StatusPlugins | |
parent | 0da1d99c8ecda784b14ade348897096dc43a65b4 (diff) |
fix: AAA crashes another programs when global hooks are active
git-svn-id: http://svn.miranda-ng.org/main/trunk@2355 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StatusPlugins')
7 files changed, 76 insertions, 69 deletions
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj index 290d43eb64..24a61ea27c 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj @@ -161,6 +161,7 @@ <WarningLevel>Level3</WarningLevel>
<PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <AssemblerOutput>AssemblyAndSourceCode</AssemblerOutput>
</ClCompile>
<Link>
<OptimizeReferences>true</OptimizeReferences>
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp index 00cc8ab90b..b40e45960f 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -44,7 +44,7 @@ int CompareSettings( const TAAAProtoSetting* p1, const TAAAProtoSetting* p2 ) return lstrcmpA( p1->szName, p2->szName );
}
-OBJLIST<TAAAProtoSetting> autoAwaySettings( 10, CompareSettings );
+OBJLIST<TAAAProtoSetting> *autoAwaySettings;
TAAAProtoSetting::TAAAProtoSetting( PROTOACCOUNT* pa )
{
@@ -190,14 +190,14 @@ static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) if ( ack->result != ACKRESULT_SUCCESS )
return 0;
log_debugA("ProcessProtoAck: ack->szModule: %s", ack->szModule);
- for ( int i=0; i < autoAwaySettings.getCount(); i++ ) {
- log_debugA("chk: %s", autoAwaySettings[i].szName);
- if (!strcmp(autoAwaySettings[i].szName, ack->szModule)) {
- log_debugA("ack->szModule: %s autoAwaySettings[i].statusChanged: %d", ack->szModule, autoAwaySettings[i].statusChanged);
- if (!autoAwaySettings[i].statusChanged)
- autoAwaySettings[i].mStatus = TRUE;
-
- autoAwaySettings[i].statusChanged = FALSE;
+ for ( int i=0; i < autoAwaySettings->getCount(); i++ ) {
+ log_debugA("chk: %s", (*autoAwaySettings)[i].szName);
+ if (!strcmp((*autoAwaySettings)[i].szName, ack->szModule)) {
+ log_debugA("ack->szModule: %s (*autoAwaySettings)[i].statusChanged: %d", ack->szModule, (*autoAwaySettings)[i].statusChanged);
+ if (!(*autoAwaySettings)[i].statusChanged)
+ (*autoAwaySettings)[i].mStatus = TRUE;
+
+ (*autoAwaySettings)[i].statusChanged = FALSE;
} }
return 0;
@@ -211,14 +211,14 @@ int OnAccChanged(WPARAM wParam,LPARAM lParam) PROTOACCOUNT* pa = ( PROTOACCOUNT* )lParam;
switch( wParam ) {
case PRAC_ADDED:
- autoAwaySettings.insert( new TAAAProtoSetting( pa ));
+ autoAwaySettings->insert( new TAAAProtoSetting( pa ));
break;
case PRAC_REMOVED:
{
- for ( int i=0; i < autoAwaySettings.getCount(); i++ ) {
- if ( !lstrcmpA( autoAwaySettings[i].szName, pa->szModuleName )) {
- autoAwaySettings.remove( i );
+ for ( int i=0; i < autoAwaySettings->getCount(); i++ ) {
+ if ( !lstrcmpA( (*autoAwaySettings)[i].szName, pa->szModuleName )) {
+ autoAwaySettings->remove( i );
break;
} } }
break;
@@ -293,8 +293,8 @@ static VOID CALLBACK AutoAwayTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD int statusChanged = FALSE;
int confirm = FALSE;
- for ( int i=0; i < autoAwaySettings.getCount(); i++ ) {
- TAAAProtoSetting& aas = autoAwaySettings[i];
+ for ( int i=0; i < autoAwaySettings->getCount(); i++ ) {
+ TAAAProtoSetting& aas = (*autoAwaySettings)[i];
aas.status = ID_STATUS_DISABLED;
BOOL screenSaver = FALSE, locked = FALSE;
@@ -400,11 +400,11 @@ static VOID CALLBACK AutoAwayTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD changeState(aas, ACTIVE);
aas.sts1setTimer = 0;
}
- autoAwaySettings[i].mStatus = FALSE;
+ (*autoAwaySettings)[i].mStatus = FALSE;
}
if ( confirm || statusChanged ) {
- OBJLIST<TAAAProtoSetting> ps = autoAwaySettings;
+ OBJLIST<TAAAProtoSetting> ps = *autoAwaySettings;
int i;
for ( i=0; i < ps.getCount(); i++ ) {
@@ -592,7 +592,7 @@ static int AutoAwayShutdown(WPARAM wParam,LPARAM lParam) UnhookWindowsHooks();
DestroyHookableEvent(hStateChangedEvent);
- autoAwaySettings.destroy();
+ autoAwaySettings->destroy();
return 0;
}
@@ -616,7 +616,7 @@ int CSModuleLoaded(WPARAM wParam, LPARAM lParam) ////////////////////////////////////////////////////////////////////////////////////////
- protoList = ( OBJLIST<PROTOCOLSETTINGEX>* )&autoAwaySettings;
+ protoList = ( OBJLIST<PROTOCOLSETTINGEX>* )autoAwaySettings;
int count;
PROTOACCOUNT** protos;
@@ -624,11 +624,11 @@ int CSModuleLoaded(WPARAM wParam, LPARAM lParam) for ( int i=0; i < count; i++ )
if ( IsSuitableProto( protos[i] ))
- autoAwaySettings.insert( new TAAAProtoSetting( protos[i] ));
+ autoAwaySettings->insert( new TAAAProtoSetting( protos[i] ));
////////////////////////////////////////////////////////////////////////////////////////
- LoadOptions(autoAwaySettings, FALSE);
+ LoadOptions(*autoAwaySettings, FALSE);
#ifdef TRIGGERPLUGIN
InitTrigger();
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h index 5820a5f85c..e9b2565466 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h @@ -80,11 +80,11 @@ struct AAMSGSETTING char* msg;
};
-extern HINSTANCE hInst;
+extern HINSTANCE hInst, hCore;
int CompareSettings( const TAAAProtoSetting* p1, const TAAAProtoSetting* p2 );
-extern OBJLIST<TAAAProtoSetting> autoAwaySettings;
+extern OBJLIST<TAAAProtoSetting> *autoAwaySettings;
int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName);
void LoadOptions(OBJLIST<TAAAProtoSetting>& settings, BOOL override);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/main.cpp b/plugins/StatusPlugins/AdvancedAutoAway/main.cpp index f640369607..4cd6e31f4d 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/main.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/main.cpp @@ -27,9 +27,7 @@ // {F0FDF73A-753D-499d-8DBA-336DB79CDD41}
#define MIID_ADVAUTOAWAY { 0xf0fdf73a, 0x753d, 0x499d, { 0x8d, 0xba, 0x33, 0x6d, 0xb7, 0x9c, 0xdd, 0x41 } }
-HINSTANCE hInst;
-
-
+HINSTANCE hInst, hCore = NULL;
HANDLE hCSModuleLoadedHook;
HANDLE hStateChangedEvent;
@@ -42,7 +40,10 @@ int CSModuleLoaded(WPARAM wParam, LPARAM lParam); BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{
- hInst = hinstDLL;
+ if (fdwReason == DLL_PROCESS_ATTACH) {
+ hInst = hinstDLL;
+ hCore = GetModuleHandleA("mir_core.dll");
+ }
return TRUE;
}
@@ -72,9 +73,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" __declspec(dllexport) int Load(void)
{
-
mir_getLP( &pluginInfoEx );
+ autoAwaySettings = new OBJLIST<TAAAProtoSetting>(10, CompareSettings);
+
InitCommonStatus();
hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded);
hStateChangedEvent = CreateHookableEvent(ME_AAA_STATECHANGED);
@@ -87,5 +89,6 @@ extern "C" __declspec(dllexport) int Load(void) extern "C" __declspec(dllexport) int Unload(void)
{
DestroyHookableEvent( hStateChangedEvent );
+ delete autoAwaySettings;
return 0;
}
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp index f9599f7b4d..edfeb0aaa8 100644 --- a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp +++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp @@ -31,8 +31,6 @@ static BOOL (WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0; #define ListView_SetCheckState(w,i,f) ListView_SetItemState(w,i,INDEXTOSTATEIMAGEMASK((f)+1),LVIS_STATEIMAGEMASK)
#endif
-static OBJLIST<TAAAProtoSetting> optionSettings( 10, CompareSettings );
-
int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName);
INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
@@ -125,6 +123,8 @@ static void SetDialogStatus(HWND hwndDlg, TAAAProtoSetting* sameSetting) /////////////////////////////////////////////////////////////////////////////////////////
// Rules dialog window procedure
+static OBJLIST<TAAAProtoSetting> *optionSettings;
+
static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static TAAAProtoSetting* sameSetting;
@@ -136,15 +136,16 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM TranslateDialogDefault(hwndDlg);
// copy the settings
- optionSettings = autoAwaySettings;
+ optionSettings = new OBJLIST<TAAAProtoSetting>(10, CompareSettings);
+ *optionSettings = *autoAwaySettings;
sameSetting = ( TAAAProtoSetting* )malloc(sizeof(TAAAProtoSetting));
LoadAutoAwaySetting(*sameSetting, SETTING_ALL);
// fill list from currentProtoSettings
{
- for ( int i=0; i < optionSettings.getCount(); i++ ) {
- TAAAProtoSetting& p = optionSettings[i];
+ for ( int i=0; i < optionSettings->getCount(); i++ ) {
+ TAAAProtoSetting& p = (*optionSettings)[i];
int item = SendDlgItemMessage( hwndDlg, IDC_PROTOCOL, CB_ADDSTRING, 0, ( LPARAM )p.tszAccName );
SendDlgItemMessage( hwndDlg, IDC_PROTOCOL, CB_SETITEMDATA, item, (LPARAM)&p );
}
@@ -351,15 +352,15 @@ static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM if (bSettingSame)
WriteAutoAwaySetting(*sameSetting, SETTING_ALL);
else {
- for (int i=0; i < optionSettings.getCount(); i++ )
- WriteAutoAwaySetting(optionSettings[i], optionSettings[i].szName);
+ for (int i=0; i < optionSettings->getCount(); i++ )
+ WriteAutoAwaySetting((*optionSettings)[i], (*optionSettings)[i].szName);
}
- LoadOptions(autoAwaySettings, FALSE);
+ LoadOptions(*autoAwaySettings, FALSE);
}
break;
case WM_DESTROY:
- optionSettings.destroy();
+ optionSettings->destroy();
free(sameSetting);
break;
}
@@ -419,7 +420,7 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA DBWriteContactSettingWord(NULL, MODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, NULL, FALSE));
DBWriteContactSettingByte(NULL, MODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE));
DBWriteContactSettingByte(NULL, MODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD));
- LoadOptions(autoAwaySettings, FALSE);
+ LoadOptions(*autoAwaySettings, FALSE);
}
break;
}
diff --git a/plugins/StatusPlugins/StartupStatus/version.h b/plugins/StatusPlugins/StartupStatus/version.h index bc6f07a01c..2ea7d0fc6b 100644 --- a/plugins/StatusPlugins/StartupStatus/version.h +++ b/plugins/StatusPlugins/StartupStatus/version.h @@ -8,7 +8,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 8
#define __RELEASE_NUM 0
-#define __BUILD_NUM 43
+#define __BUILD_NUM 44
// minimal MirandaIM version number, with which this plugin supposed to work
#define __PROD_MAJOR_VERSION 0
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 0381de0b69..3da2d8b4ad 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -47,7 +47,7 @@ static int CompareSettings( const TConfirmSetting* p1, const TConfirmSetting* p2 { return lstrcmpA( p1->szName, p2->szName );
}
-static OBJLIST<TConfirmSetting> confirmSettings( 10, CompareSettings );
+static OBJLIST<TConfirmSetting> *confirmSettings;
static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
@@ -104,7 +104,7 @@ static INT_PTR CALLBACK StatusMessageDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam static int SetStatusList(HWND hwndDlg)
{
- if (confirmSettings.getCount() == 0)
+ if (confirmSettings->getCount() == 0)
return -1;
HWND hList = GetDlgItem(hwndDlg, IDC_STARTUPLIST);
@@ -115,19 +115,19 @@ static int SetStatusList(HWND hwndDlg) lvItem.mask = LVIF_TEXT | LVIF_PARAM;
lvItem.cchTextMax = 256;
- for ( int i=0; i < confirmSettings.getCount(); i++ ) {
- lvItem.pszText = confirmSettings[i].tszAccName;
- if (ListView_GetItemCount(hList) < confirmSettings.getCount())
+ for ( int i=0; i < confirmSettings->getCount(); i++ ) {
+ lvItem.pszText = (*confirmSettings)[i].tszAccName;
+ if (ListView_GetItemCount(hList) < confirmSettings->getCount())
ListView_InsertItem(hList,&lvItem);
int actualStatus;
- switch( confirmSettings[i].status ) {
- case ID_STATUS_LAST: actualStatus = confirmSettings[i].lastStatus; break;
- case ID_STATUS_CURRENT: actualStatus = CallProtoService(confirmSettings[i].szName,PS_GETSTATUS, 0, 0); break;
- default: actualStatus = confirmSettings[i].status;
+ switch( (*confirmSettings)[i].status ) {
+ case ID_STATUS_LAST: actualStatus = (*confirmSettings)[i].lastStatus; break;
+ case ID_STATUS_CURRENT: actualStatus = CallProtoService((*confirmSettings)[i].szName,PS_GETSTATUS, 0, 0); break;
+ default: actualStatus = (*confirmSettings)[i].status;
}
TCHAR* status = ( TCHAR* )CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, actualStatus, GSMDF_TCHAR );
- switch( confirmSettings[i].status ) {
+ switch( (*confirmSettings)[i].status ) {
case ID_STATUS_LAST:
mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT("<last>"), status);
ListView_SetItemText(hList, lvItem.iItem, 1, buf);
@@ -141,10 +141,10 @@ static int SetStatusList(HWND hwndDlg) }
// status message
- if ( !((!((CallProtoService(confirmSettings[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService(confirmSettings[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus))))) {
- TCHAR *msg = GetDefaultStatusMessage( &confirmSettings[i], actualStatus );
+ if ( !((!((CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0)&PF1_MODEMSGSEND)&~PF1_INDIVMODEMSG)) || (!(CallProtoService((*confirmSettings)[i].szName, PS_GETCAPS, (WPARAM)PFLAGNUM_3, 0)&Proto_Status2Flag(actualStatus))))) {
+ TCHAR *msg = GetDefaultStatusMessage( &(*confirmSettings)[i], actualStatus );
if ( msg != NULL ) {
- TCHAR* fMsg = variables_parsedup( msg, confirmSettings[i].tszAccName, NULL );
+ TCHAR* fMsg = variables_parsedup( msg, (*confirmSettings)[i].tszAccName, NULL );
ListView_SetItemText(hList, lvItem.iItem, 2, fMsg);
mir_free(fMsg);
mir_free(msg);
@@ -155,7 +155,7 @@ static int SetStatusList(HWND hwndDlg) ListView_SetColumnWidth(hList, 0, LVSCW_AUTOSIZE);
ListView_SetColumnWidth(hList, 2, LVSCW_AUTOSIZE);
- lvItem.lParam = (LPARAM)&confirmSettings[i];
+ lvItem.lParam = (LPARAM)&(*confirmSettings)[i];
ListView_SetItem(hList,&lvItem);
lvItem.iItem++;
}
@@ -189,6 +189,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA }
// create items
+ confirmSettings = new OBJLIST<TConfirmSetting>(10, CompareSettings);
SetStatusList(hwndDlg);
EnableWindow(GetDlgItem(hwndDlg, IDC_SETSTSMSG), FALSE);
@@ -238,16 +239,16 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA case IDC_PROFILE:
{
int i, profile = (int)SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROFILE, CB_GETCURSEL, 0, 0), 0);
- for ( i=0; i < confirmSettings.getCount(); i++ ) {
- if (confirmSettings[i].szMsg != NULL) {
- free(confirmSettings[i].szMsg);
- confirmSettings[i].szMsg = NULL;
+ for ( i=0; i < confirmSettings->getCount(); i++ ) {
+ if ((*confirmSettings)[i].szMsg != NULL) {
+ free((*confirmSettings)[i].szMsg);
+ (*confirmSettings)[i].szMsg = NULL;
} }
CallService(MS_SS_GETPROFILE, (WPARAM)profile, (LPARAM)&confirmSettings);
- for ( i=0; i < confirmSettings.getCount(); i++ )
- if (confirmSettings[i].szMsg != NULL) // we free this later, copy to our memory space
- confirmSettings[i].szMsg = _tcsdup(confirmSettings[i].szMsg);
+ for ( i=0; i < confirmSettings->getCount(); i++ )
+ if ((*confirmSettings)[i].szMsg != NULL) // we free this later, copy to our memory space
+ (*confirmSettings)[i].szMsg = _tcsdup((*confirmSettings)[i].szMsg);
SetStatusList(hwndDlg);
}
@@ -343,7 +344,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA lvItem.iSubItem=0;
lvItem.iItem = ListView_GetNextItem(GetDlgItem(hwndDlg,IDC_STARTUPLIST),-1,LVNI_SELECTED);
- if (ListView_GetItem(GetDlgItem(hwndDlg,IDC_STARTUPLIST), &lvItem) == FALSE) {
+ if ( ListView_GetItem(GetDlgItem(hwndDlg,IDC_STARTUPLIST), &lvItem) == FALSE) {
SetStatusList(hwndDlg);
break;
}
@@ -377,14 +378,15 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA actualStatus = currentStatus;
}
- for ( i = 0; i < SIZEOF(statusModeList); i++ ) {
+ for (i=0; i < SIZEOF(statusModeList); i++) {
if ( ((flags&statusModePf2List[i]) || (statusModePf2List[i] == PF2_OFFLINE)) && (!((!(flags)&Proto_Status2Flag(statusModePf2List[i]))) || ((CallProtoService(proto->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0)&Proto_Status2Flag(statusModePf2List[i]))))) {
TCHAR* statusMode = ( TCHAR* )CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, statusModeList[i], GSMDF_TCHAR);
item = SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_ADDSTRING,0,(LPARAM)statusMode);
SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_SETITEMDATA,item,(LPARAM)statusModeList[i]);
if (statusModeList[i] == proto->status)
SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_SETCURSEL,(WPARAM)item,0);
- } }
+ }
+ }
// enable status box
EnableWindow(GetDlgItem(hwndDlg,IDC_STATUS), (ListView_GetNextItem(GetDlgItem(hwndDlg,IDC_STARTUPLIST),-1,LVNI_SELECTED)>=0));
@@ -411,7 +413,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA break;
case WM_DESTROY:
- confirmSettings.destroy();
+ delete confirmSettings; confirmSettings = 0;
break;
}
@@ -423,18 +425,18 @@ INT_PTR ShowConfirmDialogEx(WPARAM wParam, LPARAM lParam) if ( wParam == 0 )
return -1;
- confirmSettings.destroy();
+ delete confirmSettings; confirmSettings = 0;
OBJLIST<PROTOCOLSETTINGEX>& param = *( OBJLIST<PROTOCOLSETTINGEX>* )wParam;
- for ( int i=0; i < param.getCount(); i++ )
- confirmSettings.insert( new TConfirmSetting( param[i] ));
+ for (int i=0; i < param.getCount(); i++)
+ confirmSettings->insert( new TConfirmSetting( param[i] ));
timeOut = lParam;
if (timeOut < 0)
timeOut = DEF_CLOSE_TIME;
- if ( GetWindow(win, 0) == NULL ) {
- win = CreateDialogParam( hInst,MAKEINTRESOURCE(IDD_CONFIRMDIALOG),NULL,ConfirmDlgProc,NULL);
+ if (GetWindow(win, 0) == NULL) {
+ win = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONFIRMDIALOG), NULL, ConfirmDlgProc, NULL);
EnableWindow(win,TRUE);
}
|