Autor Beitrag
@strider
Hält's aus hier
Beiträge: 8



BeitragVerfasst: So 20.12.09 11:04 
Hallo,

ich bin vor kurzem von Delphi 7 auf Delphi 2005 Pro unter Windows 7 umgestiegen (ich habe zwar auch Delphi 2009 aber noch keine Lust, alles auf Unicode umzustellen). Alles klappt wunderbar, nur CreateEllipticRgn bleibt ohne Effekt (d. h. rechteckig).

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TDlgSplash.FormCreate(Sender: TObject);

var
  NewRegion: Hrgn;

begin
  NewRegion := CreateEllipticRgn(11500500);
  SetWindowRgn(Handle, NewRegion, True);
end;


:?: :?: :?:


P. S.: Beim alten Kompilat des Programms ist alles 'rund'.

Moderiert von user profile iconChristian S.: Quote- durch Delphi-Tags ersetzt
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 20.12.09 13:11 
Kannst Du mal schauen, was Handle für einen Wert hat? Dann mal die Deklarationen der beteiligten Funktionen vergleichen?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
@strider Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: So 20.12.09 15:06 
Hallo,

mir ist nicht klar, worauf Du hinaus willst. Welche beteiligten Funktionen meinst Du?

Newregion ist auf jeden Fall <> dem Ergebnis von SetWindowregion, beide sind > 0.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 20.12.09 16:42 
Ich meine insbesondere, ob das Handle für SetWindowRegion gültig ist.

Bzgl. den Deklarationen meine ich, ob alle API-Funktionen, die du nutzt, noch die gleiche Deklaration haben, oder ob sich da was geändert hat in den Borland-Headern.

Gibt GetLastError irgendeinen Fehler an?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
@strider Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: So 20.12.09 16:57 
Das Handle von SetWindowRgn ist gültig (> 0), GetLastError liefert 0, d. h. keinen Fehler.

Da ich die alte Version von Delphi nicht mehr habe, kann ich nicht nachsehen, ob sich die Deklaration geändert hat (kann ich mir aber eigentlich auch nicht vorstellen).
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 20.12.09 17:08 
Hmmm, schau mal bitte, ob sich etwas ändert, wenn du den Source in FormActivate ausführen lässt. Bzw. OnPaint.

Die VCL gibt auch gern mal Fenster-Handle wieder frei, wenn sie der Meinung ist, die werden grad nicht gebraucht. Das ist insbesondere beim Initialisieren manchmal recht nervig.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
@strider Threadstarter
Hält's aus hier
Beiträge: 8



BeitragVerfasst: So 20.12.09 20:35 
Zitat:

wenn du den Source in FormActivate ausführen lässt


Hallo BenBE,

das war der entscheidende Hinweis - in FormActivate klappt es.

Aber warum es in Vorversionen bei FormCreate fubktioniert hat und jetzt in Delphi 2005 nicht mehr ....


Danke für Deine Hilfe!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 20.12.09 20:42 
Borland Inprise CodeGear Embarcadero frickelt schon seit Jahren an der VCL rum. Und grad wenn man bestimmte Dinge mit dem Fenster-Handle anstellen will fliegt man regelmäßig auf die Fresse ^^

Es gibt noch eine alternative Möglichkeit, was man tun kann, die darin besteht, dass man die Routinen zum Erzeugen des Fensters (IIRC CreateWindowParams usw.) überschreibt. Das geht dann aber nicht mehr so ohne Weiteres in der IDE ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.