static Bool WWriteEntryToRC( WAccelEditInfo *einfo, WAccelEntry *entry, FILE *fp ) { char *keytext; char *flagtext; uint_16 key, flags, id; Bool ok; flagtext = NULL; ok = (einfo != NULL && entry != NULL); if( ok ) { if( entry->is32bit ) { key = entry->entry32.Ascii; flags = entry->entry32.Flags; id = entry->entry32.Id; } else { key = entry->entry.Ascii; flags = entry->entry.Flags; id = (uint_16)entry->entry.Id; } keytext = WGetKeyText( key, flags ); ok = (keytext != NULL); } if( ok ) { ok = WSetFlagsText( flags, &flagtext ); } if( ok ) { fprintf( fp, " %s,\t", keytext ); if( entry->symbol ) { fprintf( fp, "%s", entry->symbol ); } else { fprintf( fp, "%d", (int)id ); } if( flagtext != NULL ) { fprintf( fp, "%s\n", flagtext ); } else { fwrite( "\n", sizeof( char ), 1, fp ); } } if( flagtext != NULL ) { WMemFree( flagtext ); } return( ok ); }
static bool WSetEditWindowKey( HWND dlg, uint_16 key, uint_16 flags ) { char *text; HWND edit; bool ok; ok = (dlg != (HWND)NULL); if( ok ) { text = WGetKeyText( key, flags ); ok = (text != NULL); } if( ok ) { edit = GetDlgItem( dlg, IDM_ACCEDKEY ); ok = WSetEditWithStr( edit, text ); } return( ok ); }