Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 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.47 MB
Время: 0.01 c
7-59965
Andy78
2003-03-21 10:59
2003.05.19
Формат отображения даты


14-59861
uri
2003-04-29 07:05
2003.05.19
exe v delphi


1-59770
KSergey
2003-05-05 11:17
2003.05.19
TAction и кнопка


3-59593
Arkady
2003-04-28 08:23
2003.05.19
Вставка большого файла в базу Access


14-59898
JibSkeart
2003-04-27 12:56
2003.05.19
Круто У нас Метель была я в шоке :о)