long ShortcutList::onRemoveKeybinding(FXObject*o,FXSelector sel,void*p) { FXIconItem*item=acclist->getItem(acclist->getCurrentItem()); MenuSpec*spec=(MenuSpec*)item->getData(); if (spec->accel[0] && DeleteShortcut(spec)) { apply_btn->disable(); } return 1; }
/* #FN# Saves changes the user has made using the page */ void /* #AS# Nothing */ CWizardStep1:: Commit() { char szShortPath[ MAX_PATH + 1 ]; CFileStatus fsStatus; GetMenuFolder( szShortPath ); /* Create shortcuts in the Start Menu */ if( m_bShortMenu ) { if( CFile::GetStatus( szShortPath, fsStatus ) || CreateDirectory( szShortPath, NULL ) ) for( int i = 0; i < s_nShortInfoNo; i++ ) { CreateShortcut( &m_pShortInfo[ i ], szShortPath ); } } /* Remove shortcuts from the Start Menu */ else { if( CFile::GetStatus( szShortPath, fsStatus ) ) for( int i = 0; i < s_nShortInfoNo; i++ ) { DeleteShortcut( &m_pShortInfo[ i ], szShortPath ); } RemoveDirectory( szShortPath ); } GetDeskFolder( szShortPath ); /* Create shortcuts at the Desktop */ if( m_bShortDesk ) { CreateShortcut( &m_pShortInfo[ 0 ], szShortPath ); } /* Remove shortcuts from the Desktop */ else { DeleteShortcut( &m_pShortInfo[ 0 ], szShortPath ); } } /* #OF# CWizardStep1::Commit */
int Uninstall(HWND hWnd) { // Remove all installed files DeleteDirectory(g_sInstallPath); DeleteShortcut(hWnd); DeleteRegistryKey(); if (!g_bRunFromSetupDll) RunSystemUninstall(); // TODO: May probably handle errors during deletion (such as locked directories) // and notify user. Right now just return OK. return ErrOK; }
long ShortcutList::onApplyChanges(FXObject*o,FXSelector sel,void*p) { FXHotKey hk=sce->getChord(); FXIconItem*item=acclist->getItem(acclist->getCurrentItem()); MenuSpec*spec=(MenuSpec*)item->getData(); if (hk) { if (Verify(hk,spec) && ConfirmOverwrite(hk,spec)) { ApplyShortcut(hk,spec); } } else { if (DeleteShortcut(spec)) { apply_btn->disable(); } } return 1; }