Autor Beitrag
lemming
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 470

Mac OS 10.3.1
Delphi 6 Pro, Kylix 3
BeitragVerfasst: Do 01.07.04 09:39 
Wenn mein Programm mit OnShow wieder aufgerufen wird, möchte ich gerne wissen, welches Programm zuletzt aktiv war. Wie bekomme ich dessen Handle heraus?
fuser
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23



BeitragVerfasst: Do 01.07.04 09:49 
Hallo lemming
Z.B. mit einem Timer und GetForegroundWindow bzw.
GetWindowThreadProcessId(GetForegroundWindow,0);
lemming Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 470

Mac OS 10.3.1
Delphi 6 Pro, Kylix 3
BeitragVerfasst: Do 01.07.04 09:54 
Gibt GetWindowThreadProcessId einen Handle zurück?

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
var
 Test: HWND;
begin
  Test := GetWindowThreadProcessId(GetForegroundWindow,nil);
  Image1.Picture.Bitmap := nil;
  FormularScreenshot(Image1.Picture.Bitmap, Test);
end;


Bei dem Code kommt eine Exception. FormularScreenshot setzt als zweite Variable HWND vorraus.
lemming Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 470

Mac OS 10.3.1
Delphi 6 Pro, Kylix 3
BeitragVerfasst: Do 01.07.04 09:55 
Ha, ich habs bereits. GetForegroundWindow gibt ja selber schon eine HWND zurück :oops:
Danke fuser.