Старый 21.05.2003, 15:00   #1   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Запуск приложения из другого

Приложение 1 запускает приложение 2 (точнее, конструкцию вида "start Document.doc" {только это не обязательно doc, может быть что угодно}).
Как приложение 1 может узнать, что приложение 2 завершено.
Отягчающие обстоятельства.
1. Приложение 2 должно запускать в фоне.
2. ShellExecute не подходит, потому что оно возвращает не настоящий Handle, а почти левое число.
2. Пробывал CreateProcess. Но CreateProcess вызывает cmd-окно, а оно уже нужное приложение, то есть CreateProcess на самом деле возвращает hInstance посредника, а не нужного приложения?
Все это на WinNT
Кто подскаже? А то я тут уже в сторону OLE копаю...
  Ответить с цитированием
Старый 21.05.2003, 15:14   #2   
Форумец
 
Аватар для fishca
 
Сообщений: 708
Регистрация: 23.12.2002
Возраст: 50
Записей в дневнике: 1

fishca вне форума Не в сети
Читай

The WaitForSingleObject function returns when one of the following occurs:

· The specified object is in the signaled state.
· The time-out interval elapses.



DWORD WaitForSingleObject(

HANDLE hHandle, // handle of object to wait for
DWORD dwMilliseconds // time-out interval in milliseconds
);


Parameters

hHandle

Identifies the object. For a list of the object types whose handles can be specified, see the following Remarks section.
Windows NT: The handle must have SYNCHRONIZE access. For more information, see Access Masks and Access Rights.

dwMilliseconds

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



Return Values

If the function succeeds, the return value indicates the event that caused the function to return.
If the function fails, the return value is WAIT_FAILED. To get extended error information, call GetLastError.
The return value on success is one of the following values:

Value Meaning
WAIT_ABANDONED The specified object is a mutex object that was not released by the thread that owned the mutex object before the owning thread terminated. Ownership of the mutex object is granted to the calling thread, and the mutex is set to nonsignaled.
WAIT_OBJECT_0 The state of the specified object is signaled.
WAIT_TIMEOUT The time-out interval elapsed, and the object's state is nonsignaled.


Remarks

The WaitForSingleObject function checks the current state of the specified object. If the object's state is nonsignaled, the calling thread enters an efficient wait state. The thread consumes very little processor time while waiting for the object state to become signaled or the time-out interval to elapse.
Before returning, a wait function modifies the state of some types of synchronization objects. Modification occurs only for the object or objects whose signaled state caused the function to return. For example, the count of a semaphore object is decreased by one.

The WaitForSingleObject function can wait for the following objects:

Object Description
Change notification The FindFirstChangeNotification function returns the handle. A change notification object's state is signaled when a specified type of change occurs within a specified directory or directory tree.
Console input The handle is returned by the CreateFile function when the CONIN$ value is specified, or by the GetStdHandle function. The object's state is signaled when there is unread input in the console's input buffer, and it is nonsignaled when the input buffer is empty.
Event The CreateEvent or OpenEvent function returns the handle. An event object's state is set explicitly to signaled by the SetEvent or PulseEvent function. A manual-reset event object's state must be reset explicitly to nonsignaled by the ResetEvent function. For an auto-reset event object, the wait function resets the object's state to nonsignaled before returning. Event objects are also used in overlapped operations, in which the state is set by the system.
Mutex The CreateMutex or OpenMutex function returns the handle. A mutex object's state is signaled when it is not owned by any thread. The wait function requests ownership of the mutex for the calling thread, changing the mutex's state to nonsignaled when ownership is granted.
Process The CreateProcess or OpenProcess function returns the handle. A process object's state is signaled when the process terminates.
Semaphore The CreateSemaphore or OpenSemaphore function returns the handle. A semaphore object maintains a count between zero and some maximum value. Its state is signaled when its count is greater than zero and nonsignaled when its count is zero. If the current state is signaled, the wait function decreases the count by one.
Thread The CreateProcess, CreateThread, or CreateRemoteThread function returns the handle. A thread object's state is signaled when the thread terminates.
Timer The CreateWaitableTimer or OpenWaitableTimer function returns the handle. Activate the timer by calling the SetWaitableTimer function. The state of an active timer is signaled when it reaches its due time. You can deactivate the timer by calling the CancelWaitableTimer function. The state of an active timer is signaled when it reaches its due time. You can deactivate the timer by calling the CancelWaitableTimer function.


In some circumstances, you can specify a handle of a file, named pipe, or communications device as a synchronization object in lpHandles. However, their use for this purpose is discouraged.
You have to be careful when using the wait functions and DDE. If a thread creates any windows, it must process messages. DDE sends messages to all windows in the system. If you have a thread that uses a wait function with no time-out interval, the system will deadlock. Therefore, if you have a thread that creates windows, use MsgWaitForMultipleObjects or MsgWaitForMultipleObjectsEx, rather than WaitForSingleObject.

See Also

CancelWaitableTimer, CreateEvent, CreateFile, CreateMutex, CreateProcess, CreateRemoteThread, CreateSemaphore, CreateThread, CreateWaitableTimer, FindFirstChangeNotification, GetStdHandle, MsgWaitForMultipleObjects, MsgWaitForMultipleObjectsEx, OpenEvent, OpenMutex, OpenProcess, OpenSemaphore, OpenWaitableTimer, PulseEvent, ResetEvent, SetEvent, SetWaitableTimer


Я думаю тебе это поможет. И CreateProcess может запускать приложение, не показывая его.


The STARTUPINFO structure is used with the CreateProcess function to specify main window properties if a new window is created for the new process. For graphical user interface (GUI) processes, this information affects the first window created by the CreateWindow function and shown by the ShowWindow function. For console processes, this information affects the console window if a new console is created for the process. A process can use the GetStartupInfo function to retrieve the STARTUPINFO structure specified when the process was created.

typedef struct _STARTUPINFO { // si
DWORD cb;
LPTSTR lpReserved;
LPTSTR lpDesktop;
LPTSTR lpTitle;
DWORD dwX;
DWORD dwY;
DWORD dwXSize;
DWORD dwYSize;
DWORD dwXCountChars;
DWORD dwYCountChars;
DWORD dwFillAttribute;
DWORD dwFlags;
WORD wShowWindow;
WORD cbReserved2;
LPBYTE lpReserved2;
HANDLE hStdInput;
HANDLE hStdOutput;
HANDLE hStdError;

} STARTUPINFO, *LPSTARTUPINFO;


Members

cb

Specifies the size, in bytes, of the structure.

lpReserved

Reserved. Set this member to NULL before passing the structure to CreateProcess.

lpDesktop

Windows NT only: Points to a zero-terminated string that specifies either the name of the desktop only or the name of both the window station and desktop for this process. A backslash in the string pointed to by lpDesktop indicates that the string includes both desktop and window station names. Otherwise, the lpDesktop string is interpreted as a desktop name. If lpDesktop is NULL, the new process inherits the window station and desktop of its parent process.

lpTitle

For console processes, this is the title displayed in the title bar if a new console window is created. If NULL, the name of the executable file is used as the window title instead. This parameter must be NULL for GUI or console processes that do not create a new console window.

dwX, dwY

Ignored unless dwFlags specifies STARTF_USEPOSITION. Specifies the x and y offsets, in pixels, of the upper left corner of a window if a new window is created. The offsets are from the upper left corner of the screen. For GUI processes, the specified position is used the first time the new process calls CreateWindow to create an overlapped window if the x parameter of CreateWindow is CW_USEDEFAULT.

dwXSize, dwYSize

Ignored unless dwFlags specifies STARTF_USESIZE. Specifies the width (dwXSize) and height (dwYSize), in pixels, of the window if a new window is created. For GUI processes, this is used only the first time the new process calls CreateWindow to create an overlapped window if the nWidth parameter of CreateWindow is CW_USEDEFAULT.

dwXCountChars, dwYCountChars

Ignored unless dwFlags specifies STARTF_USECOUNTCHARS. For console processes, if a new console window is created, dwXCountChars specifies the screen buffer width in character columns, and dwYCountChars specifies the screen buffer height in character rows. These values are ignored in GUI processes.

dwFillAttribute

Ignored unless dwFlags specifies STARTF_USEFILLATTRIBUTE. Specifies the initial text and background colors if a new console window is created in a console application. These values are ignored in GUI applications. This value can be any combination of the following values: FOREGROUND_BLUE, FOREGROUND_GREEN, FOREGROUND_RED, FOREGROUND_INTENSITY, BACKGROUND_BLUE, BACKGROUND_GREEN, BACKGROUND_RED, and BACKGROUND_INTENSITY. For example, the following combination of values produces red text on a whilte background:

FOREGROUND_RED | BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE


dwFlags

This is a bit field that determines whether certain STARTUPINFO members are used when the process creates a window. Any combination of the following values can be specified:

Value Meaning
STARTF_USESHOWWINDOW If this value is not specified, the wShowWindow member is ignored.
STARTF_USEPOSITION If this value is not specified, the dwX and dwY members are ignored.
STARTF_USESIZE If this value is not specified, the dwXSize and dwYSize members are ignored.
STARTF_USECOUNTCHARS If this value is not specified, the dwXCountChars and dwYCountChars members are ignored.
STARTF_USEFILLATTRIBUTE If this value is not specified, the dwFillAttribute member is ignored.
STARTF_FORCEONFEEDBACK If this value is specified, the cursor is in feedback mode for two seconds after CreateProcess is called. If during those two seconds the process makes the first GUI call, the system gives five more seconds to the process. If during those five seconds the process shows a window, the system gives five more seconds to the process to finish drawing the window.
The system turns the feedback cursor off after the first call to GetMessage, regardless of whether the process is drawing.
For more information on feedback, see the following Remarks section.
STARTF_FORCEOFFFEEDBACK If specified, the feedback cursor is forced off while the process is starting. The normal cursor is displayed. For more information on feedback, see the following Remarks section.
STARTF_USESTDHANDLES If this value is specified, sets the standard input of the process, standard output, and standard error handles to the handles specified in the hStdInput, hStdOutput, and hStdError members of the STARTUPINFO structure. The CreateProcess function's fInheritHandles parameter must be set to TRUE for this to work properly.
If this value is not specified, the hStdInput, hStdOutput, and hStdError members of the STARTUPINFO structure are ignored.


wShowWindow

Ignored unless dwFlags specifies STARTF_USESHOWWINDOW. The wshowWindow member can be any of the SW_ constants defined in WINUSER.H. For GUI processes, wShowWindow specifies the default value the first time ShowWindow is called. The nCmdShow parameter of ShowWindow is ignored. In subsequent calls to ShowWindow, the wShowWindow member is used if the nCmdShow parameter of ShowWindow is set to SW_SHOWDEFAULT.

cbReserved2

Reserved; must be zero.

lpReserved2

Reserved; must be NULL.

hStdInput

Ignored unless dwFlags specifies STARTF_USESTDHANDLES. Specifies a handle that will be used as the standard input handle of the process if STARTF_USESTDHANDLES is specified.

hStdOutput

Ignored unless dwFlags specifies STARTF_USESTDHANDLES. Specifies a handle that will be used as the standard output handle of the process if STARTF_USESTDHANDLES is specified.

hStdError

Ignored unless dwFlags specifies STARTF_USESTDHANDLES. Specifies a handle that will be used as the standard error handle of the process if STARTF_USESTDHANDLES is specified.



Remarks

If a GUI process is being started and neither STARTF_FORCEONFEEDBACK or STARTF_FORCEOFFFEEDBACK is specified, the process feedback cursor is used. A GUI process is one whose subsystem is specified as "windows."

See Also

CreateProcess, CreateWindow, GetMessage, GetStartupInfo, PeekMessage, ShowWindow, WinMain
  Ответить с цитированием
Старый 21.05.2003, 15:35   #3   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Ага, пробывал, пункт номер 2 в первом сообщении.
CreateProcess( NULL, // No module name (use command line).
"start c:\\Document.doc", // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
Это вызовет cmd-окно, которое вызовет Word с открытым файлом c:\Document.doc. Но pi->hProcess будет содержать handle не Word'а, а это черного окошка, которое закроется сразу же после того, как запустит Word. То есть я отлавлю момент окончания ЗАГРУЗКИ word'a, а не момент закрытия...
Мне это окно глаза не мозолит, но и хандл его мне как-то тоже по-боку...
Или я что-то неправильно делаю?

Все равно, спасибо, fishca!
  Ответить с цитированием
Старый 21.05.2003, 16:49   #4   
Форумец
 
Аватар для fishca
 
Сообщений: 708
Регистрация: 23.12.2002
Возраст: 50
Записей в дневнике: 1

fishca вне форума Не в сети
Цитата:
"start c:\\Document.doc",
А вот так попробуй и жди окончания работы Word-a.
Или тебе обязательно надо через start?
CreateProcess( NULL, // No module name (use command line).
"winword.exe Document.doc", // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
  Ответить с цитированием
Старый 21.05.2003, 16:58   #5   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
fishca
Дело в том, что я не знаю, какой тип файла будет запущен. Пользователь щелкает по файлу, и он должен у него открыться (если соответствующие приложения установлены).
А файлы могут быть txt, Word, Excel, картинки разные, даже папки, да все что угодно!

Кстати, про OLE... И она не помогает, компонент TOleContainer (Borland Builder / Delphi) не умеет правильно сохранять файлы...
  Ответить с цитированием
Старый 22.05.2003, 08:37   #6   
Форумец
 
Аватар для fishca
 
Сообщений: 708
Регистрация: 23.12.2002
Возраст: 50
Записей в дневнике: 1

fishca вне форума Не в сети
У тебя в системе прописано что какой программой открывать, вот и используй это. txt - Блокнот, doc - winword и т.д.
  Ответить с цитированием
Старый 22.05.2003, 09:21   #7   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
fishca
Да, это похоже, единственный путь... Только в реестре ковыряться тяжело, это же жуть... Это же мучений на два дня..

Народ, вы чем обсуждать, как прогу взломать (типа это проще, чем заплатить 100 рублей), мне типа подскажите, как сделать "start name.ext" и отловить момент закрытия этого окна. А я вам 100 рублев дам, типа купите прогу, кокую там хотели...
Я серьезно!
  Ответить с цитированием
Старый 29.05.2003, 14:50   #8   
Форумец
 
Аватар для Kent
 
Сообщений: 142
Регистрация: 17.12.2002
Возраст: 43

Kent вне форума Не в сети
Попробуй ShellExecute(.....). По расширению функция сама смотрит каким приложением открывать (напрямую ты к реестрам не лезешь, функция сама ищет). Насчёт Handle - есть функция, которая просматривает все открытые приложения, но что за функция не помню. Легче будет зайти на www.codenet.ru и в форуме по Builder посмотреть. Там такая задачка мелькала.
  Ответить с цитированием
Старый 29.05.2003, 15:09   #9   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Kent
ShellExecute(.....) - это да, запускает сама, что надо. Но хэндл не возвращает нужный. Искать окно тоже не понятно как. Если у меня 10 вордов открыто, то как понять какой нужный? И не понятно, какое окно искать - ворд, эксель, корэл, проводник...
Придется через реестр ковыряться, как руки дойдут...
  Ответить с цитированием
Старый 29.05.2003, 15:47   #10   
Форумец
 
Аватар для Kent
 
Сообщений: 142
Регистрация: 17.12.2002
Возраст: 43

Kent вне форума Не в сети
В Архангельском, либо на codenet пример поиска окна через заголовок. При открытии файла Doklad.doc заголовок будет чтото вроде Doklad - Документ Word. Сравнивай !!!
Да хотя это только для Word. Надо литературу поднять. Может можно определить имя файла каждого зарущенного приложения.
  Ответить с цитированием
Старый 29.05.2003, 15:58   #11   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Kent
Я не могу сказать за Word, но в общем случае не обязательно заголовок будет именно название файла.
  Ответить с цитированием
Старый 29.05.2003, 16:12   #12   
Форумец
 
Аватар для Kent
 
Сообщений: 142
Регистрация: 17.12.2002
Возраст: 43

Kent вне форума Не в сети
Ответы перехлестнулись.
Попробуй определить имя файла каждого зарущенного приложения.
  Ответить с цитированием
Старый 29.05.2003, 16:28   #13   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Цитата:
Ответы перехлестнулись.
В каком смысле перехлестнулись?

Цитата:
Попробуй определить имя файла каждого зарущенного приложения.
Тоже не понял
  Ответить с цитированием
Старый 29.05.2003, 16:44   #14   
Форумец
 
Аватар для Kent
 
Сообщений: 142
Регистрация: 17.12.2002
Возраст: 43

Kent вне форума Не в сети
Попробовать перебрать все запущенные окна и проверить каким приложением они запускались или перебрать имена запущенных файлов. Короче я над этим сильно не замарачивался, но обещаю до завтрого посмотреть.
Насчёт перехлестнулись - я редактировал своё прошлое сообщение пытаясь исправится, но неуспел.
  Ответить с цитированием
Старый 29.05.2003, 16:56   #15   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Kent
Не стоит так спешить - завтра меня все равно не будет.
  Ответить с цитированием
Старый 29.05.2003, 19:55   #16   
Форумец
 
Аватар для Spectator
 
Сообщений: 39,874
Регистрация: 27.05.2003
Возраст: 46

Spectator вне форума Не в сети
Kent
>перебрать имена запущенных файлов?
Это как?
  Ответить с цитированием
Старый 29.05.2003, 22:22   #17   
Форумец
 
Сообщений: 1,696
Регистрация: 24.11.2002
Возраст: 39

LSL вне форума Не в сети
Spectator
>перебрать имена запущенных файлов?
Это как?

Перебрать работающие процессы...
  Ответить с цитированием
Старый 29.05.2003, 22:45   #18   
Форумец
 
Аватар для Spectator
 
Сообщений: 39,874
Регистрация: 27.05.2003
Возраст: 46

Spectator вне форума Не в сети
Да, но речь шла о том, чтобы запустить файл (документ) а на программу. В этом контексте перебор запущенных файлов - вещь не понятная.
А вообще мой опыт показывеает, что если возникают такие проблемы, то ошибка в постановке задачи. Решение должно быть простым и красивым, а если задача решается через ж0пу, то значит, это неправильная задача.
  Ответить с цитированием
Старый 30.05.2003, 09:27   #19   
Форумец
 
Аватар для Kent
 
Сообщений: 142
Регистрация: 17.12.2002
Возраст: 43

Kent вне форума Не в сети
Настоящий програмист должен быть немного извращенцем. Так как максимальное количество запущенных приложений на компе строго ограничено (точно не помню, но по моему не больше 24-х) и Handle в оперативке то потери времени не столь велики, зато метод универсален.
Насчёт "неправильная задача" - попробуй заказщику, а в данном случае как я понял преподу, объясни что "задача неправильная".
  Ответить с цитированием
Старый 30.05.2003, 10:15   #20   
Форумец
 
Аватар для Spectator
 
Сообщений: 39,874
Регистрация: 27.05.2003
Возраст: 46

Spectator вне форума Не в сети
[B]Настоящий програмист должен быть немного извращенцем. [/B
Может быть, но в разумных пределах. Извращения тоже должны быть простыми и красивыми.

Так как максимальное количество запущенных приложений на компе строго ограничено (точно не помню, но по моему не больше 24-х)
ИМХО бред. Количество процессов ограничено только памятью, доступной ОС. Во всяком случае для современных приложений. Представь себе сервер с таким ограничением!

Насчёт "неправильная задача" - попробуй заказщику, а в данном случае как я понял преподу, объясни что "задача неправильная".
Задачи деляться на два типа:
1) те которые дал заказчик (изначальные) - их можно переформулировать и предложить в таком виде заказчику. Если заказчик баран - ну его нахрен, такого заказчика. Даже если это босс. Все равно потом еще больше проблем загребешь. Если это препод - то если он баран, его можно загрузить. Если нет - просто объяснить.
2) Те которые возникают по ходу решения основной задачи - подзадачи. Здесь еще проще - если уперлись в тупик, то надо вернуться на шаг назад и поискать другое направление, если не получается - еще на шаг назад. Если пришли к изначальной задаче. см пункт 1.
  Ответить с цитированием
Старый 30.05.2003, 10:45   #21   
Форумец
 
Аватар для Kent
 
Сообщений: 142
Регистрация: 17.12.2002
Возраст: 43

Kent вне форума Не в сети
Spectator
Количество процессов ограничено только памятью, доступной ОС. Во всяком случае для современных приложений. Представь себе сервер с таким ограничением!
С этим я теперь согласен (только что проверял). Но приложений запустилось не так много (максимум 54), так что периберать процессы считаю допустимым.
Насчёт "неправильная задача" - эта задача вполне реализуема. А тот, кто шишек не бьет - не учится.
  Ответить с цитированием
Старый 02.06.2003, 08:59   #22   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Kent Все же перебирать процессы не совсем корректно... КАК мы узнаем, что найденый процесс наш?

Spectator
Постановка задачи... Проект готов и работает достаточно стабильно. Переписывать постановку задачи (куска, касательно работы с файлами) означает перекурочить работающую базу данных (структуру), и что-то сделать с более чем гигобайтом накопленных данных.
Лучше я реестр расколупаю (благо, уже зааю, как это делать)
А вообще было бы прикольно сказать заказчику - "да это фигня, неверная постановка год задачи назад, я тепрь сделать не могу, увольняюсь к черту". Круто будет? Хоть заказчик и не баран. Просто надо реагировать на запросы пользователей, а не говорить, что это фигня. Конечно, когда запросы разумны и реализуемы (а этот запрос реализуем и нужен).
  Ответить с цитированием
Старый 02.06.2003, 16:19   #23   
Форумец
 
Аватар для Kent
 
Сообщений: 142
Регистрация: 17.12.2002
Возраст: 43

Kent вне форума Не в сети
Павел-Kikoz

Вот, что нашол за выходные.

FindExecutable
(Модуль ShellAPI)

HINSTANCE FindExecutable(
LPCTSTR lpFile,//строка с именем файла документа
LPCTSTR lpDirectory,//строка каталога по умолчанию
LPTSTR lpResult//строка с именем выполняемого файла
)

При успешном завершении возвращает значение > 32. Если меньше, то свидетельствует об ошибке.

Пример
char APchar[254];
FindExecutable("Doc.doc",NULL,APchar);
Label1->Caption=APchar;
Приведёт к тому, что в метку Label1 будет занесено имя приложения, связанного с файлом типа .doc.
Например:
C:\MSOFFICE\WINWORD\WINWORD.EXE


HWND GetNextWindow(hWnd,unsigned int wCmd);
Функция определяет дискриптор следующего или предыдущего окна. Параметр hWnd - дискриптор окна, от которого начинается отсчёт.
Параметр wCmd - определяет направление поиска. Если wCmd = GW_HWNDNEXT, то ищется следующее окно, находящееся ниже. Если wCmd = GW_HWNDPREV,
то ищется предыдущее окно, находящееся выше. Если результат выполнения функции = NULL, то в данном направлении больше окон нет.

Как мы узнаем, что процесс наш - по дискриптору (у тебя будет дискриптор твоего процесса (кстати запускать всёравно через CreatProcess) и дискрипторы запущенных приложений. Дискрипторы хранятся в ОПЕРАТИВКЕ - перебор мгновенный.
  Ответить с цитированием
Старый 02.06.2003, 16:30   #24   
Форумец
 
Сообщений: 94
Регистрация: 16.03.2003

Павел-Kikoz вне форума Не в сети
Kent
Ура! Спасибо! Вот именно FindExecutable меня и интересовала. 22-05-2003 07:21 я обещал 100 рублев
Выполняю обещание - отправляю письмо с подробностями
  Ответить с цитированием
Поиск в теме: 



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

  Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения
BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Support by DrIQ & Netwind