[VAZA] 0 Denunciar post Postado Maio 15, 2009 Pessoal, eu preciso saber como eu posso maximizar ou ativar um programa que já esteja aberto no windows? por exemplo: No clique de um botão, eu verifico se o programa IBExpert já está aberto no windows. Caso esteja aberto e eu não esteja nele, ele abre como se eu tivesse clicado nele na barra de tarefas. Compartilhar este post Link para o post Compartilhar em outros sites
Mateus_Uzumaki 0 Denunciar post Postado Maio 23, 2009 function AtivarJanela(Nome: String):String; var X: Word; H: THandle; Caption: Array[0..255] of Char; begin for X:=1 to 10000 do begin if((GetWindowText(x,Caption,255)<>0)and (GetWindowLong(x,GWL_EXSTYLE)<>0)and (GetWindowLong(x,GWL_HWNDPARENT)=0)and (GetWindowLong(x,GWL_HINSTANCE)<>0))then if(IsWindowVisible(x))then if(pos(Nome,Caption)>0) then begin H:=FindWindow(nil,Caption); SetForegroundWindow(H); end; end; end; Exemplo: AtivarJanela('Bloco'); Compartilhar este post Link para o post Compartilhar em outros sites