Top.Mail.Ru
Мастера DELPHI, Delphi programming community Титульная страница Поиск, карта сайта Написать письмо 
| Новости | Поиск | FAQ | Статьи | Книги | Новости VCL |
| Форумы ЧАТ | Орешник | KOL и MCK |
Форумы -» Основная («Начинающим»)/ Базы / WinAPI / Компоненты / Сети / Media / Игры / Corba и COM / KOL / FreePascal / .Net / Прочее / RSDN.ORG

« предыдущая ветвь | форум | следующая ветвь »

CreateProcess не работает без полного пути к исп.файлу, а надо бы [D5, Win95/98]


Sergey_Elf ©   (2002-10-10 12:56:00) 

Пользовался shellexecute, но надо было знать когда заканчивается прога. Посоветовали (за что еще раз спасибо) CreateProcess.
Но он не работаетбез пути, а архиватор могет быть хоть где. И как жить-то дальше?


Sergey_Elf   (2002-10-10 13:52:00) [1]

Большое спасибо Игорь!
плохо матчасть не знать.........


Игорь Шевченко   (2002-10-10 13:40:00) [2]

Sergey_Elf (10.10.02 13:29)

По path искать очевидно функцией SearchPath :-)


Song   (2002-10-10 13:37:00) [3]

Если нужен путь, при наличии расширения можно воспользоваться FindExecutable()


Pumpkin   (2002-10-10 13:37:00) [4]

2Sergey_Elf (10.10.02 13:29)
как получить переменные окружения - в FAQ.
как разбить на пути: Pos + Copy или TStringList.CommaText
(вроде-бы, Delphi сейчас далекоооо).


AL2002   (2002-10-10 13:32:00) [5]

GetEnvironmentStrings()


Sergey_Elf   (2002-10-10 13:29:00) [6]

2 pumpkin: поскажи как по path искать?


andrey_pst   (2002-10-10 13:27:00) [7]

>>архиватор могет быть хоть где
Или с инсталляшкой своей программы архиватор поставляй, или предварительно поиск на его наличие делай.

Второе чем плохо - а если архиватора вообще нет, что делать бедете ?


Pumpkin   (2002-10-10 13:25:00) [8]

Что тебе мешает проделать пункты 1-6 из хелпа вручную, а потом вызывать CreateProcess.


AL2002   (2002-10-10 13:22:00) [9]

A ExtractFileDir разве не поможет?


Игорь Шевченко   (2002-10-10 13:20:00) [10]

Религия запрещает путь указывать ?


Sergey_Elf   (2002-10-10 13:13:00) [11]

Алексей, я читал хелп, вот что означает последний абзац
If the process to be created is an MS-DOS - based or Windows-based application, lpCommandLine should be a full command line in which the first element is the application name. Because this also works well for Win32-based applications, it is the most robust way to set lpCommandLine.
я так понял, что если это приложение, то лучше указывать путь.
по крайней мере, у меня ни фига не работает, если я не указываю путь. :(((((((((((


Alx2   (2002-10-10 13:05:00) [12]

>Sergey_Elf (10.10.02 12:56)
А вообще это есть и в CreateProcess, конечно.
Чтиаем хэлп про ЭТО:

If lpApplicationName is NULL, the first white space-delimited token of the command line specifies the module name. If the filename does not contain an extension, .EXE is assumed. If the filename ends in a period (.) with no extension, or the filename contains a path, .EXE is not appended. If the filename does not contain a directory path, Windows searches for the executable file in the following sequence:

1. The directory from which the application loaded.
2. The current directory for the parent process.
3. Windows 95: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.

Windows NT: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32.

4. Windows NT: The 16-bit Windows system directory. There is no Win32 function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM.
5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
6. The directories that are listed in the PATH environment variable.



If the process to be created is an MS-DOS - based or Windows-based application, lpCommandLine should be a full command line in which the first element is the application name. Because this also works well for Win32-based applications, it is the most robust way to set lpCommandLine.


Внук   (2002-10-10 13:01:00) [13]

Да равзе ж это жизнь...


Alx2   (2002-10-10 13:00:00) [14]

ShellExecuteEx


Наверх

Титульная страница Поиск, карта сайта Написать письмо