Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2002.10.21;
Скачать: [xml.tar.bz2];

Вниз

CreateProcess не работает без полного пути к исп.файлу, а надо бы   Найти похожие ветки 

 
Sergey_Elf   (2002-10-10 12:56) [0]

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


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

ShellExecuteEx


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

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


 
Alx2   (2002-10-10 13:05) [3]

>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.


 
Sergey_Elf   (2002-10-10 13:13) [4]

Алексей, я читал хелп, вот что означает последний абзац
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:20) [5]

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


 
AL2002   (2002-10-10 13:22) [6]

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


 
Pumpkin   (2002-10-10 13:25) [7]

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


 
andrey_pst   (2002-10-10 13:27) [8]

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

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


 
Sergey_Elf   (2002-10-10 13:29) [9]

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


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

GetEnvironmentStrings()


 
Song   (2002-10-10 13:37) [11]

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


 
Pumpkin   (2002-10-10 13:37) [12]

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



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

Sergey_Elf (10.10.02 13:29)

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


 
Sergey_Elf   (2002-10-10 13:52) [14]

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



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2002.10.21;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.008 c
1-68842
User_OKA
2002-10-10 07:25
2002.10.21
Остановка цикла


3-68649
PAVELsinicinV
2002-09-30 14:47
2002.10.21
Сhar(2), в него заносятся номера строк другой таблицы ...


1-68841
Denis O.
2002-10-10 13:08
2002.10.21
Окно поверх всех


1-68724
jgu
2002-10-10 23:51
2002.10.21
длинна String


14-68927
RV
2002-10-01 14:50
2002.10.21
Так скажем, вопрос. :)





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский