Главная страница
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.018 c
4-60003
Step[B.M.]
2003-03-01 12:42
2003.05.19
Как из моей проги запустить другой exe-шник, да еще с параметрами


6-59834
Fire Man
2003-03-22 18:39
2003.05.19
Подскажите пожалуйста, как узнать подключен ли комп к Инету и


1-59685
lightix
2003-05-07 16:31
2003.05.19
Вопрос по QReport


3-59573
Анна
2003-04-27 20:07
2003.05.19
Неприятие русского


14-59907
Fenik
2003-04-28 00:18
2003.05.19
Прошу у всех прощения!