imho.ws
IMHO.WS  

Вернуться   IMHO.WS > Компьютеры > Программирование
Опции темы
Старый 02.04.2004, 23:42     # 1
Vitus.L
Newbie
 
Регистрация: 20.05.2003
Сообщения: 34

Vitus.L МолодецVitus.L МолодецVitus.L Молодец
WinExec, CreateProcess

Приветствую всех!!!
Вопрос простой, но я запарился честное слово.
Пробую программировать в Делфях (без литературы и пр.) - запускаю другой процесс, но ...
мне необходимо дождаться его завершения, а Делфя после функции WinExec шпарит дальше, отсюда облом. Раскидайте пож-та как энто пройти...
Vitus.L вне форума  
Старый 03.04.2004, 11:23     # 2
alexey_ma
Member
 
Регистрация: 10.03.2002
Адрес: Israel
Сообщения: 245

alexey_ma Нимб уже пробиваетсяalexey_ma Нимб уже пробивается
WaitForSingleObject -тебе поможет.
Только без документации совсем плохо. Хочешь работать с Windows - придется читать MSDN.

MSDN :

Код:
WaitForSingleObject

The WaitForSingleObject function returns when one of the following occurs:

The specified object is in the signaled state. 
The time-out interval elapses. 
To enter an alertable wait state, use the WaitForSingleObjectEx function. 
To wait for multiple objects, use the WaitForMultipleObjects.


DWORD WaitForSingleObject(
  HANDLE hHandle,
  DWORD dwMilliseconds
);

Parameters
hHandle 
[in] Handle to the object. For a list of the object types whose handles can be specified, 
see the following Remarks section. 
If this handle is closed while the wait is still pending, the function's behavior is undefined.

The handle must have the SYNCHRONIZE access right. For more information, see Standard Access Rights.

dwMilliseconds 
[in] Time-out interval, in milliseconds. The function returns if the interval elapses,
 even if the object's state is nonsignaled. If dwMilliseconds is zero, the function tests the
 object's state and returns immediately.
If dwMilliseconds is INFINITE, the function's time-out interval never elapses.
.......

The WaitForSingleObject function can wait for the following objects:

Change notification 
Console input 
Event 
Job 
Memory resource notification 
Mutex 
Process 
Semaphore 
Thread 
Waitable timer
__________________
Best Regards
alexey_ma вне форума  

Опции темы

Ваши права в разделе
Вы НЕ можете создавать новые темы
Вы не можете отвечать в темах.
Вы НЕ можете прикреплять вложения
Вы НЕ можете редактировать свои сообщения

BB код Вкл.
Смайлы Вкл.
[IMG] код Выкл.
HTML код Выкл.

Быстрый переход


Часовой пояс GMT +4, время: 11:20.




Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.