Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: Как в *.wcx узнать путь к Wincmd.ini? 
Author Message
vserd



PostPosted: Thu May 12, 2005 20:09    Post subject: Reply with quote

Maximus
Quote:

Но зачем там столько кода если путь к ини-файлам и к директории в которую командир проинстален валяются себе в реестре:
HKEY_LOCAL_MACHINE\Software\Ghisler\Total Commander

А затем что там правильная обработка текущего файла настроек.
К сожалению или скорее к счастью Total Commander поддерживает явное указание пути в командной строке, если там не задано, тогда нужно анализировать битовую маску UseIniInProgramDir, и в зависимости от нее считываем из реестра, а при отсутствии ключа, искать в %windir%.
Вобщем читайте доку, она вам поможет.


Quote:

А вот кто бы мне сказал как без лишних извратов узнать где валяется моя ДЛЛ т.е. откуда была запущена(хочу туды свой ини запихнуть),

Если изменить вопрос на такой: Куда правильно писать инишник для плугина. Тогда возможно воспользуйтесь структурой
PackDefaultParamStruct.DefaultIniName

DefaultIniName Suggested location+name of the ini file where the plugin could store its data. This is a fully qualified path+file name, and will be in the same directory as the wincmd.ini. It's recommended to store the plugin data in this file or at least in this directory, because the plugin directory or the Windows directory may not be writable!

Либо таким кодом:
С++ из multarc
GetModuleFileName(m_hInstance,szFullPath,MAX_PATH);

GetShortPathName(szFullPath, szPath, MAX_PATH);
m_strMAPath = szPath;

_splitpath(szFullPath,szDrive,szPath,szName,szExt);
strcpy(szExt,"ini");

_makepath(szFullPath,szDrive,szPath,szName,szExt);
m_strIniFile = szFullPath;
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group