Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 69 lines (59 sloc) 2.272 kb
238b774 @martijnlaan Added files
martijnlaan authored
1 This patch to Delphi 6.02's Controls.pas fixes an AV issue with
2 combo boxes and Outlook Express; see:
3
4 http://groups.google.com/group/borland.public.delphi.vcl.components.using/browse_thread/thread/e012cea3ea1d258b
5
6 Delphi 2-5 have the same problem, but need a slightly different patch --
7 see VCL-Controls-D2D5-patch.txt.
8 Delphi 7 and later already incorporate an equivalent fix.
9
10 After applying the changes, recompile Controls.pas from the command
11 line as follows:
12
13 > c:\delphi\bin\dcc32 -$D- -$L- Controls.pas
14 > move Controls.dcu c:\delphi\lib
15
16
17 --- Controls.pas.orig Fri Feb 15 14:02:00 2002
18 +++ Controls.pas Tue Mar 19 21:04:58 2002
19 @@ -1743,14 +1743,20 @@
20 { The global atom table is trashed when the user logs off. The extra test
21 below protects UI interactive services after the user logs off. }
22 function FindControl(Handle: HWnd): TWinControl;
23 +var
24 + PID: DWORD;
25 begin
26 Result := nil;
27 if (Handle <> 0) then
28 begin
29 - if GlobalFindAtom(PChar(ControlAtomString)) = ControlAtom then
30 - Result := Pointer(GetProp(Handle, MakeIntAtom(ControlAtom)))
31 - else
32 - Result := ObjectFromHWnd(Handle);
33 + if (GetWindowThreadProcessId(Handle, @PID) <> 0) and
34 + (PID = GetCurrentProcessId) then
35 + begin
36 + if GlobalFindAtom(PChar(ControlAtomString)) = ControlAtom then
37 + Result := Pointer(GetProp(Handle, MakeIntAtom(ControlAtom)))
38 + else
39 + Result := ObjectFromHWnd(Handle);
40 + end;
41 end;
42 end;
43
44 @@ -2448,14 +2454,20 @@
45 // See comments for FindControl about global atom stability in service apps.
46
47 function IsDelphiHandle(Handle: HWND): Boolean;
48 +var
49 + PID: DWORD;
50 begin
51 Result := False;
52 if Handle <> 0 then
53 begin
54 - if GlobalFindAtom(PChar(WindowAtomString)) = WindowAtom then
55 - Result := GetProp(Handle, MakeIntAtom(WindowAtom)) <> 0
56 - else
57 - Result := ObjectFromHWnd(Handle) <> nil;
58 + if (GetWindowThreadProcessId(Handle, @PID) <> 0) and
59 + (PID = GetCurrentProcessId) then
60 + begin
61 + if GlobalFindAtom(PChar(WindowAtomString)) = WindowAtom then
62 + Result := GetProp(Handle, MakeIntAtom(WindowAtom)) <> 0
63 + else
64 + Result := ObjectFromHWnd(Handle) <> nil;
65 + end;
66 end;
67 end;
68
Something went wrong with that request. Please try again.