Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

get input focus on mouse over

[es] :: Pascal / Delphi / Kylix :: get input focus on mouse over

[ Pregleda: 2888 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

alxsabo
aleksandar sabo
Novi Sad

Član broj: 125775
Poruke: 19
*.ptt.yu.

Sajt: www.aleksandarsabo.info


Profil

icon get input focus on mouse over10.01.2007. u 23:03 - pre 210 meseci

Problem je sledeci u momentu kada neki drugi program ima keyboard input focus i korisnik predje misem preko prozora mog programa, tada moj program treba da dobije keyboard input focus. Tj. Ja treba da napisem neki kod koji ce na dogadjaj OnMouseOver da selektuje neku komponentu i dodeli joj navedeno.

Ja uspevam da uradim da drugom programu preko mog programa dam input focus, ali sebi ne. SetForegroundWindow ne funkcionise u ovom slucaju, kao ni SetActiveWindow.

Sta da radim?
Inspiration exists, but it has to find us working.
 
Odgovor na temu

savkic
Igor Savkić

Moderator
Član broj: 92186
Poruke: 2739



+92 Profil

icon Re: get input focus on mouse over11.01.2007. u 00:55 - pre 210 meseci
Code:

procedure ActivateApplication;
var
  ActiveThreadId, CurrentThreadId: DWORD;
begin
  if GetForegroundWindow <> Application.Handle then
  begin
    ActiveThreadId := GetWindowThreadProcessId(GetForegroundWindow, nil);
    CurrentThreadId := GetCurrentThreadId;
    AttachThreadInput(CurrentThreadId, ActiveThreadId, True);
    SetForegroundWindow(Application.Handle);
    AttachThreadInput(CurrentThreadId, ActiveThreadId, False);
    BringWindowToTop(Application.Handle);
  end;
end;


 
Odgovor na temu

alxsabo
aleksandar sabo
Novi Sad

Član broj: 125775
Poruke: 19
*.ptt.yu.

Sajt: www.aleksandarsabo.info


Profil

icon Re: get input focus on mouse over11.01.2007. u 01:12 - pre 210 meseci
Radi

Hvala puno,

Inspiration exists, but it has to find us working.
 
Odgovor na temu

[es] :: Pascal / Delphi / Kylix :: get input focus on mouse over

[ Pregleda: 2888 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.