|
|
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Приветствую всех ! Кто подскажет как осуществить запуск программы с параметрами ? Я запускаю программу TServer_get_file.exe из другой программы Код: plaintext 1. 2. 3. 4. 5. Так вот, как строчку Код: plaintext Код: plaintext И чтобы загруженная программа TServer_get_file.exe могла вывести в Код: plaintext ??? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.12.2007, 09:33:59 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
автор CreateProcess The CreateProcess function creates a new process and its primary thread. The new process runs the specified executable file in the security context of the calling process. If the calling process is impersonating another user, the new process uses the token for the calling process, not the impersonation token. To run the new process in the security context of the user represented by the impersonation token, use the CreateProcessAsUser or CreateProcessWithLogonW function. BOOL CreateProcess( LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTUPINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation ); Parameters lpApplicationName [in] Pointer to a null-terminated string that specifies the module to execute. The specified module can be a Windows-based application. It can be some other type of module (for example, MS-DOS or OS/2) if the appropriate subsystem is available on the local computer. The string can specify the full path and file name of the module to execute or it can specify a partial name. In the case of a partial name, the function uses the current drive and current directory to complete the specification. The function will not use the search path. If the file name does not contain an extension, .exe is assumed. Therefore, if the file name extension is .com, this parameter must include the .com extension. The lpApplicationName parameter can be NULL. In that case, the module name must be the first white space-delimited token in the lpCommandLine string. If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin; otherwise, the file name is ambiguous. For example, consider the string "c:\program files\sub dir\program name". This string can be interpreted in a number of ways. The system tries to interpret the possibilities in the following order: c:\program.exe files\sub dir\program name c:\program files\sub.exe dir\program name c:\program files\sub dir\program.exe name c:\program files\sub dir\program name.exe If the executable module is a 16-bit application, lpApplicationName should be NULL, and the string pointed to by lpCommandLine should specify the executable module as well as its arguments. To run a batch file, you must start the command interpreter; set lpApplicationName to cmd.exe and set lpCommandLine to the name of the batch file. lpCommandLine [in, out] Pointer to a null-terminated string that specifies the command line to execute. The maximum length of this string is 32K characters. Windows 2000: The maximum length of this string is MAX_PATH characters. The Unicode version of this function, CreateProcessW, will fail if this parameter is a const string. The lpCommandLine parameter can be NULL. In that case, the function uses the string pointed to by lpApplicationName as the command line. If both lpApplicationName and lpCommandLine are non-NULL, the null-terminated string pointed to by lpApplicationName specifies the module to execute, and the null-terminated string pointed to by lpCommandLine specifies the command line. The new process can use GetCommandLine to retrieve the entire command line. Console processes written in C can use the argc and argv arguments to parse the command line. Because argv[0] is the module name, C programmers generally repeat the module name as the first token in the command line. If lpApplicationName is NULL, the first white-space – delimited token of the command line specifies the module name. If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin (see the explanation for the lpApplicationName parameter). If the file name does not contain an extension, .exe is appended. Therefore, if the file name extension is .com, this parameter must include the .com extension. If the file name ends in a period (.) with no extension, or if the file name contains a path, .exe is not appended. If the file name does not contain a directory path, the system searches for the executable file in the following sequence: The directory from which the application loaded. The current directory for the parent process. The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. Windows Me/98/95: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. The directories that are listed in the PATH environment variable. The system adds a null character to the command line string to separate the file name from the arguments. This divides the original string into two strings for internal processing. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.12.2007, 09:43:36 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
А ни как нельзя по подробнее и доступнее обьяснить ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.12.2007, 11:19:17 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль ГафаровА ни как нельзя по подробнее и доступнее обьяснить ? Разжевать и в рот положить? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.12.2007, 11:51:59 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
AkhРазжевать и в рот положить?лучше сразу закопать :) Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.12.2007, 11:54:35 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Код: plaintext 1. 2. 3. 4. 5. ссылка ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.12.2007, 12:23:44 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль Гафаров wrote: > А ни как нельзя по подробнее и доступнее обьяснить ? http://translate.google.com/translate?u=http%3A%2F%2Fmsdn2.microsoft.com%2Fen-us%2Flibrary%2Fms682425%28printer%29.aspx&langpair=en%7Cru&hl=en&ie=UTF8 -- We are all going to hell and I'm driving the bus Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 19.12.2007, 12:35:49 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Akh Рафаэль ГафаровА ни как нельзя по подробнее и доступнее обьяснить ? Разжевать и в рот положить? Если не знаешь ответа, а лишь можешь цитировать тех. документацию с интернета, так и скажи ! Я задал вопрос, надеясь получить на него ответ ! Реального ответа так и не получил. Мне нужен пример, вот и все, а не описание функций. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.12.2007, 13:33:54 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль Гафаров Akh Рафаэль ГафаровА ни как нельзя по подробнее и доступнее обьяснить ? Разжевать и в рот положить? Если не знаешь ответа, а лишь можешь цитировать тех. документацию с интернета, так и скажи ! Я задал вопрос, надеясь получить на него ответ ! Реального ответа так и не получил. Мне нужен пример, вот и все, а не описание функций. Ну, во первых, ответ знаю. Во вторых, она была не из интернета. В третих, ты получил исчерпывающий ответ. Вообщем, в твоем посте я вижу только наглость, лень, ложь и провокацию. ... ни одного хорошего качества, как это ни прискорбно звучит. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.12.2007, 13:42:18 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль Гафаров wrote: > Если не знаешь ответа, а лишь можешь цитировать тех. документацию с > интернета, так и скажи ! Я задал вопрос, надеясь получить на него > ответ ! Реального ответа так и не получил. > Мне нужен пример, вот и все, а не описание функций. В тех документации, в которую вас ткнули, есть ответ на ваш вопрос. А ежели бы вы ещё и соизволили залезть на msdn , то нашли бы ссылку на примеры . Ответа вы не получили, потому что лень читать пользоваться поиском. Привыкайте искать ответы самостоятельно, а не ждать чьей-то милости... -- We are all going to hell and I'm driving the bus Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.12.2007, 15:53:55 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Akh Рафаэль Гафаров Akh Рафаэль ГафаровА ни как нельзя по подробнее и доступнее обьяснить ? Разжевать и в рот положить? Если не знаешь ответа, а лишь можешь цитировать тех. документацию с интернета, так и скажи ! Я задал вопрос, надеясь получить на него ответ ! Реального ответа так и не получил. Мне нужен пример, вот и все, а не описание функций. Ну, во первых, ответ знаю. Во вторых, она была не из интернета. В третих, ты получил исчерпывающий ответ. Вообщем, в твоем посте я вижу только наглость, лень, ложь и провокацию. ... ни одного хорошего качества, как это ни прискорбно звучит. Зачем разводить демогогию ? Я задал вопрос, в надежде получить ответ ... собственно всегда так и было. ЕСЛИ ЕСТЬ ОТВЕТ И ВОЗМОЖНОСТЬ ПОМОЧЬ ЧЕЛОВЕКУ, ТО ЗАЧЕМ МОЛЧАТЬ. В одну ед. времени можно дать кучу советов на вопрос, можно просто ОТВЕТИТЬ. Если бы не моя срочность в получении желаемого результата, то сидел бы и искал. А так обычно всегда рашаю свои проблемы сам. .... у меня и вопросов то на этом форуме по пальцам можно пересчитать. Что касается тебя, то ты полный зазнавшийся придурок, никчемный слабак, который может трепаться таким макаром лишь по интернету. Уверен, что ты еще и ТРУС или БАБА. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.12.2007, 09:14:48 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Мне нужен пример. Первая программа запускает Вторую программу с парамертрами командной строки. При загрузке Вторая программа отображает полученные значения командной строки. Вот и все. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.12.2007, 09:18:31 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль ГафаровМне нужен пример. Первая программа запускает Вторую программу с парамертрами командной строки. При загрузке Вторая программа отображает полученные значения командной строки. Вот и все. Да я не знаю как это сделать, и не доходит ! Тяжело помочь ? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.12.2007, 09:19:41 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
тынць _________________ "Helo, word!" - 17 errors 56 warnings Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.12.2007, 09:24:57 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль Гафаровты полный зазнавшийся придурок, никчемный слабак, который может трепаться таким макаром лишь по интернету. Уверен, что ты еще и ТРУС или БАБА. Тебе то, уж точно, я не буду помогать. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.12.2007, 09:46:02 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль ГафаровМне нужен пример. Первая программа запускает Вторую программу с парамертрами командной строки. При загрузке Вторая программа отображает полученные значения командной строки. Вот и все. бл*, ну рядом же ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.12.2007, 10:46:51 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль ГафаровМне нужен пример. Первая программа запускает Вторую программу с парамертрами командной строки. При загрузке Вторая программа отображает полученные значения командной строки. Вот и все. Не злись. Опытные тебе дают возможность самому разобратся как и что надо сделать. Если надо - подскажут. Где не компилируется или выдаёт ошибку - помогут. Короче, помогают тем, кто сам себе помогает. А за готовыми решениями обычно ходят в другие форумы, где говорят о деньгах и сроках. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 21.12.2007, 13:04:32 |
|
||
|
Запуск программы с параметрами
|
|||
|---|---|---|---|
|
#18+
Рафаэль Гафаров wrote: > ... в игнор. ссылку уже давали. http://msdn2.microsoft.com/en-us/library/ms682425(printer).aspx второй параметр. -- We are all going to hell and I'm driving the bus Posted via ActualForum NNTP Server 1.4 ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 22.12.2007, 05:29:55 |
|
||
|
|

start [/forum/topic.php?fid=57&msg=35025222&tid=2027568]: |
0ms |
get settings: |
5ms |
get forum list: |
11ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
204ms |
get topic data: |
7ms |
get forum data: |
2ms |
get page messages: |
34ms |
get tp. blocked users: |
1ms |
| others: | 192ms |
| total: | 460ms |

| 0 / 0 |
