to post a new message or reply to an existing one. If you are not registered, please
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Apr 15, 2009 - 9:27 AM
what would be the right way to serialize keyboard shortcuts that have been defined or modified through
CExtCustomizePageKeyboard not in the registry but in a file?
Apr 16, 2009 - 1:55 PM
The keyboard shortcuts are serialized as part of the customization subsystem state. The
CExtCustomizeSite::CustomizeStateSerialize() method allows you to serialize the state of the customization subsystem into the
CArchive stream which can be based on the
CFile object opened on the file system’s file.
If you need to serialize keyboard accelerators only, the following code does this for all the registered documents/menus:
CArchive & ar = . . .
CExtCustomizeSize * pSite = . . .
INT i, nMenuInfoCount = pSite->MenuInfoGetCount();
for(i = 0; i < nMenuInfoCount; i++ )
CExtCustomizeSize::CCmdMenuInfo * pCmdMenuInfo = pSite->MenuInfoGetAt( i );
ASSERT( pCmdMenuInfo != NULL );
pCmdMenuInfo->AccelTableSerialize( ar );
You can serialize the keyboard accelerators of one menu line only by invoking its
method. You should invoke the
method after loading keyboard accelerators.