Ver Mensaje Individual
  #3  
Antiguo 17-03-2008
keyboy keyboy is offline
Miembro
 
Registrado: oct 2004
Posts: 367
Reputación: 20
keyboy Va por buen camino
Yo probaría esta función:

Código Delphi [-]
procedure ActivarAplicacion(Handle: HWnd);
var
  FgThreadId  : DWORD;
  AppThreadId : DWORD;

begin
  if IsIconic(Handle) then
    ShowWindow(Handle, SW_RESTORE)
  else
  begin
    FgThreadId  := GetWindowThreadProcessId(GetForegroundWindow, nil);
    AppThreadId := GetWindowThreadProcessId(Handle, nil);

    AttachThreadInput(AppThreadId, FgThreadId, true);
    SetForegroundWindow(Handle);
    AttachThreadInput(AppThreadId, FgThreadId, false);
  end;
end;

Handle debe ser el handle de la aplicación y no de la ventana principal.

Bye
Responder Con Cita