Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.01 c
14-59906
гончий
2003-04-29 10:45
2003.05.19
Нужен компонент для проигрывания mp3 файлов


6-59843
alex55
2003-03-16 19:12
2003.05.19
NamedPipe


4-60002
Nick Denry
2003-03-16 22:34
2003.05.19
Разница в шрифте!


1-59712
tytus
2003-05-05 17:45
2003.05.19
MessageBeep


7-59968
SaperXL
2003-03-23 11:12
2003.05.19
разрешение принтера




   Наверх