- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I am using ShellExecuteEx to invoke hh.exe with an appropriate mapid. When my help file does not contain a topic with the sent mapid hh.exe exits. I would like to be able to pick this up in the calling application possibly by checking whether the process is still running or not. I have set %fmask=See_Mask_NoCloseProcess and get a %hprocess number returned. I note from looking at the Task Manager that this number is not the PID of the process so first question is how does hprocess relate to PID. Second question is how to check whether or not hprocess has terminated?
- Marcas:
- Intel® Fortran Compiler
1 Solução
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Assuming that hh.exe exits with some non-zero status if the mapid is invalid, I'd suggest using GetExitCodeProcess. You could do this in a loop with a sleep of 100ms or so, calling repeatedly until it no longer returns STILL_ACTIVE (259). Make sure you close the handle when you are done with it.
Link copiado
4 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
hprocess is a handle, which is, in reality, the address of an OS data structure referring to the process. You use WaitForSingleObject to wait for the process to terminate.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
I wonder if you could give a little more information Steve. What I think I want is to be able to specify a routine to be called when the process started by ShellExecuteEx terminates and then to take some action if it terminated itself as a result of an invalid mapid. I don't see how WaitForSingleObject helps in this respect.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
Assuming that hh.exe exits with some non-zero status if the mapid is invalid, I'd suggest using GetExitCodeProcess. You could do this in a loop with a sleep of 100ms or so, calling repeatedly until it no longer returns STILL_ACTIVE (259). Make sure you close the handle when you are done with it.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
That works a treat. Thanks Steve.

Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora