Форум: "Основная";
Текущий архив: 2005.02.06;
Скачать: [xml.tar.bz2];
ВнизКак активировать дочернее окно в чужом приложении? Найти похожие ветки
← →
Павел (2005-01-20 17:00) [0]Сак осуществить САБЖ?
← →
GuAV © (2005-01-20 17:11) [1]AttachThreadInput + SetFocus
← →
Павел (2005-01-20 17:15) [2]А примерчик ни у кого не заволялся?
← →
olookin © (2005-01-20 18:31) [3]procedure FindWnd(finds: string; var findh: hwnd);
var h,h1: hwnd;
s: string;
p: array [0..255] of char;
no,ist: boolean;
begin
h:=Form1.Handle; h1:=h; no:=false;
while no=false do begin ist:=false; h:=GetNextWindow(h,GW_HWNDNEXT);
if h=0 then no:=true; GetWindowText(h,p,255); s:=StrPas(p);
if s=finds then begin ist:=true; findh:=h; break; end; end;
h:=h1; no:=false;
while no=false do begin ist:=false; h:=GetNextWindow(h,GW_HWNDPREV);
if h=0 then no:=true; GetWindowText(h,p,255); s:=StrPas(p);
if s=finds then begin ist:=true; findh:=h; break; end; end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var h: Hwnd;
d,myd: dword;
c: array [0..255] of char;
begin
FindWnd("Безымянный - Блокнот",h);
d:=GetWindowThreadProcessId(h,0);
myd:=GetWindowThreadProcessId(Form1.Handle,0);
if AttachThreadInput(d,myd,true) then
Windows.SetFocus(h);
end;
А что кроме активации Блокнота и передачи ему фокуса делает этот код? По-моему, он совсем не активирует дочернего окна в чужом приложении.
← →
Павел (2005-01-21 09:17) [4]И мне так кажется.........Он активирует само окно.....Это я делал с помощью SetForegroundWindow(Handle) а мне нужно именно дочернее
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2005.02.06;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.032 c