Текущий архив: 2003.05.19;
Скачать: CL | DM;
ВнизНастройка панели инструментов Найти похожие ветки
← →
Вадим (2003-05-04 23:21) [0]Диалог настройки панели инструментов я вызываю так: SendMessage(ToolBar.Handle, TB_CUSTOMIZE, 0, 0); Но как можно сохранить, а при загрузке восстановить параметры?
Вычитал в справке, что сохранить/восстановить параметры можно с помощью TB_SAVERESTORE. Сделал следующее...
//сохранение параметров
procedure SaveButtons;
var
SP: TTBSaveParams;
begin
SP.hkr := HKEY_CURRENT_USER;
SP.pszSubKey := "Software\MyProg";
SP.pszValueName := "ToolBar";
SendMessage(ToolBar.Handle, TB_SAVERESTORE, Integer(True), Longint(@SP));
end;
//восстановление параметров
procedure RestoreButtons;
var
SP: TTBSaveParams;
begin
SP.hkr := HKEY_CURRENT_USER;
SP.pszSubKey := "Software\MyProg";
SP.pszValueName := "ToolBar";
SendMessage(ToolBar.Handle, TB_SAVERESTORE, Integer(False), Longint(@SP));
end;
Но есть следующий глюк: если удаляю кнопку из середины, то при последующем восстановлении удаляется последняя кнопка. А та, что я удалил остается видна. Как с этим бороться?
Спасибо за внимание.
← →
Вадим (2003-05-05 03:09) [1]up
← →
Вадим (2003-05-05 10:14) [2]Никто не знает?
← →
REA (2003-05-05 10:52) [3]Ремарки читал? Может помочь:
Remarks
For version 4.72 and earlier, to use this message to save or restore a toolbar, the parent window of the toolbar control must implement a handler for the TBN_GETBUTTONINFO notification message. The toolbar issues this notification to retrieve information about each button as it is restored.
Version 5.80 includes a new save/restore option. At the beginning of the process, and as each button is saved or restored, your application will receive a TBN_SAVE or TBN_RESTORE notification. To use this option, you must implement notification handlers to provide the Shell with the bitmap and state information it needs to successfully save or restore the toolbar state. See Saving and Restoring Toolbar States for a detailed explanation of how to handle TBN_SAVE and TBN_RESTORE.
← →
Вадим (2003-05-05 19:41) [4]Может есть у кого-нибудь пример? Я запутался.
Страницы: 1 вся ветка
Текущий архив: 2003.05.19;
Скачать: CL | DM;
Память: 0.45 MB
Время: 0.007 c