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

Вниз

Соединение программ.   Найти похожие ветки 

 
Abu   (2002-05-21 13:11) [0]

Подскажите новичку. Есть работающая программа - одна Form и три Unit. Другая программа по событию должна вызывать первую. Мне для этого надо в нее(вторую) все (Form+3Unit) перенести ? или есть какой-то другой способ?

Извините за примитивный вопрос.
Спасибо.


 
JibSkeart   (2002-05-21 14:47) [1]

"Другая программа по событию должна вызывать первую."
А может вы имели ввиду Формы ??
Извиняюсь но можно по конкретней ??


 
Agent Smith   (2002-05-21 14:57) [2]

Согласен с JibSkeart, конкретизируйте. Но если это не опечатка и я все правильно понял, то вам помогут API-функции WinExec и ShellExecute. Как я понял обе программы - ваши. Тогда все просто.


 
Abu   (2002-05-21 14:59) [3]

Да, конечно, формы, и ,конечно, мои.


 
Agent Smith   (2002-05-21 15:03) [4]

Тогда вообще не вижу смысла: в программе одна форма; А откуда вторая форма?


 
Abu   (2002-05-21 15:23) [5]

Может я, вообще что-то не так делаю? Есть первая форма с кнопками, определяющими задачи, ну, например - анализ данных, баланс и т.д. По нажатию на каждую, возникает своя форма со своими задачами ... Одна из таких "подзадач" написана автономно, как сделать чтобы она вызывалась по соответствующему OnClick из первой? Надо ли исходники, форму перетягивать, или можно как-то по-другому?


 
VID   (2002-05-21 15:29) [6]

не надо. достаточно загрузить автономную прогу, посредством вызовы функции ShellExecute, о чём сказано выше. В принципе, можно использовать обёртку функции shellExecute - UBFPD.RunFile, из раздела "Взаимодействие приложений > Запуск внешних приложений".

Более того, автномной проге можно передать параметры, для конкретизации её действий при запуске.


 
Abu   (2002-05-21 16:53) [7]

Простите за назойливость, но в Help-e Delphi не могу найти ни shellExecute, ни UBFPD.RunFile, ни WinExec ... Где почитать? Подскажите, пожалуйста.
Sorry ...


 
AFROLOV   (2002-05-21 17:46) [8]

UBFPD - это коллекция функций и проледур на этом сайте.

Вот выдержка из help по ShellExecute:

ShellExecute function opens or prints a specified file. The file can be an executable file or a document file. See ShellExecuteEx also.

HINSTANCE ShellExecute(

HWND hwnd, // handle to parent window
LPCTSTR lpOperation, // pointer to string that specifies operation to perform
LPCTSTR lpFile, // pointer to filename or folder name string
LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters
LPCTSTR lpDirectory, // pointer to string that specifies default directory
INT nShowCmd // whether file is shown when opened
);


Parameters

hwnd

Specifies a parent window. This window receives any message boxes that an application produces. For example, an application may report an error by producing a message box.

lpOperation

Pointer to a null-terminated string that specifies the operation to perform. The following operation strings are valid:

String Meaning
"open" The function opens the file specified by lpFile. The file can be an executable file or a document file. The file can be a folder to open.
"print" The function prints the file specified by lpFile. The file should be a document file. If the file is an executable file, the function opens the file, as if "open" had been specified.
"explore" The function explores the folder specified by lpFile.


The lpOperation parameter can be NULL. In that case, the function opens the file specified by lpFile.

lpFile

Pointer to a null-terminated string that specifies the file to open or print or the folder to open or explore. The function can open an executable file or a document file. The function can print a document file.

lpParameters

If lpFile specifies an executable file, lpParameters is a pointer to a null-terminated string that specifies parameters to be passed to the application.
If lpFile specifies a document file, lpParameters should be NULL.

lpDirectory

Pointer to a null-terminated string that specifies the default directory.

nShowCmd

If lpFile specifies an executable file, nShowCmd specifies how the application is to be shown when it is opened. This parameter can be one of the following values:

Value Meaning
SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window.
SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the Z order.
SW_RESTORE Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. An application should call ShowWindow with this flag to set the initial show state of its main window.
SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window remains active.
SW_SHOWNA Displays the window in its current state. The active window remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.
SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.

......
ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);

or


ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);


To explore a folder, use the following call:

ShellExecute(handle, "explore", path_to_folder, NULL, NULL, SW_SHOWNORMAL);


 
Abu   (2002-05-21 18:25) [9]

Спасибо !!!


 
Agent Smith   (2002-05-21 19:11) [10]

Как я понял, тема себя исчерпала. Но если надо, то я могу подробно описать эти ф-ии.(на русском :))



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

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

Наверх





Память: 0.47 MB
Время: 0.006 c
1-7032
archey
2002-05-20 20:43
2002.06.03
OS function failed


3-6915
VAleksey
2002-05-13 15:30
2002.06.03
Изменение пути в алиасе


4-7268
Старик Бивис
2002-03-29 16:29
2002.06.03
Функция TreeView_GetItem - не могу добиться результата...


7-7244
Sun
2002-03-06 09:41
2002.06.03
Windows Address Book


7-7236
snoup
2002-03-08 01:15
2002.06.03
Какую функцию и какие команды содержит файл KRNL386.EXE?





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский