Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 22-04-2005
trex2000 trex2000 is offline
Miembro
 
Registrado: may 2003
Posts: 240
Poder: 21
trex2000 Va por buen camino
Question Detener aplicacion

Saludos:
Tengo una aplicación que cuando esta empezando a cargar ejecuta la funcion Winexecandwait32 y funciona bien en windows 98 y windows 2000 pero en windows Xp no funciona ¿alguien me podria decir el porque de esta situacion y como corregirlo?

De antemano muchas gracias
Responder Con Cita
  #2  
Antiguo 22-04-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
¿Es esta una función de la API de Windows? No he encontrado ninguna referencia a ella en el SDK de Windows.

// Saludos
Responder Con Cita
  #3  
Antiguo 22-04-2005
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
Yo he estado buscando y se trata de una función que utiliza algunas del api de Windows, por ejemplo en Torrys hay una, y he encontrad otras en otros sitios, unas son para Delphi2 y Win95....

Por lo que sería necesario ver el código que está utilizando para poderse hacer una idea de que es lo que falla.

Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita
  #4  
Antiguo 22-04-2005
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
Aquí una muestra:
Código Delphi [-]
      This unit is based upon the well-known and largely used WinExecAndWait function The former
    WinexecAndWait function doesn't compile under Delphi 2.0 because the GetModuleUsage function is no longer
   supported under Win95.
   
     I have simply updated the previous code so that it works with Delphi 2.0 under Windows 95.
   With this function you can call Windows-based applications as well as Dos-based commands.
   That is 'c:\myapp\app32.exe' as well as command.com /c del *.bak'.
   
     This new WinexecAndWait32 is intended for Delphi 2.0 Win95 only, it works for me but you use it at
  your own risk:
   
      http://www.delphifaq.com/images/e1.gif
    http://www.delphifaq.com/images/e2.gif
    unit WinExc32;
   // Author    : Francis Parlant.
   // Update    : Bill Rinko-Gay
   // Parameters:
   //    Path: a null terminated string with the command line
   //    Visibility: Windows SHOW constant such as WS_RESTORE
   //    Timeout: DWORD time in miliseconds or INFINITE to wait forever 
   //
   // The previous version went into a loop, constantly checking to see
   // if the exec'ed program had terminated.  This version uses the Win95
   // API call to WaitForSingleObject to block processing until the
   // exec'ed program has terminated.  The return value will be either
   // an error code from the CreateProcess function, or the result
   // of the wait.
   
   interface
   
   uses Windows;
   
   function WinExecAndWait32(Path: PChar; Visibility: Word;
     Timeout : DWORD): integer;
   
   implementation
   
   function WinExecAndWait32(Path: PChar; Visibility: Word;
     Timeout : DWORD): integer;
   var
     WaitResult : integer;
     StartupInfo: TStartupInfo;
     ProcessInfo: TProcessInformation;
     iResult : integer;
   begin
     FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
     with StartupInfo do
     begin
       cb := SizeOf(TStartupInfo);
       dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
       { you could pass sw_show or sw_hide as parameter: }
       wShowWindow := visibility;
     end;
     if CreateProcess(nil,path,nil, nil, False,
           NORMAL_PRIORITY_CLASS, nil, nil,
           StartupInfo, ProcessInfo) then
     begin
       WaitResult := WaitForSingleObject(ProcessInfo.hProcess, timeout);
       { timeout is in miliseconds or INFINITE if
         you want to wait forever }
       result := WaitResult;
     end
     else
     { error occurs during CreateProcess see help for details }
       result:=GetLastError;
   end;
   
   end.

Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.

Última edición por marcoszorrilla fecha: 22-04-2005 a las 23:12:06.
Responder Con Cita
  #5  
Antiguo 22-04-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Poder: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Sí, me imaginaba algo así por las búsquedas que había hecho pero no estaba seguro.

Al parecer WinExecAndWait32 es una función que publicó Peter Below
en los foros de Borland hace mucho tiempo y que más tarde actualizó
con WinExecAndWait32V2 para corregir problemas que presentaba.

Quizá esta otra le sirva.

// Saludos

Última edición por roman fecha: 22-04-2005 a las 23:11:06.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 18:33:13.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi