diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index 71dc1b2a45..4e6d34a514 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -194,7 +194,7 @@ Var procedure GetChildOwnerObject(ChildId: Integer); begin - OwnerObject := TObject(Windows.GetProp(Windows.GetDlgItem(Window, ChildId), 'WinControl')); + OwnerObject := TObject(GetProp(Windows.GetDlgItem(Window, ChildId), 'WinControl')); end; procedure SendPaintMessage; @@ -465,7 +465,7 @@ Begin if ScrollBar <> 0 then begin // send message to actual scrollbar window - OwnerObject := TObject(Windows.GetProp(ScrollBar, 'Wincontrol')); + OwnerObject := TObject(GetProp(ScrollBar, 'Wincontrol')); end; End; End; @@ -760,7 +760,7 @@ Begin if ScrollBar <> 0 then begin // send message to actual scrollbar window - OwnerObject := TObject(Windows.GetProp(ScrollBar, 'Wincontrol')); + OwnerObject := TObject(GetProp(ScrollBar, 'Wincontrol')); end; End; End; @@ -976,6 +976,9 @@ end; { $Log$ + Revision 1.89 2004/01/20 10:26:41 micha + try register globally unique properties + Revision 1.88 2004/01/19 21:51:50 micha prevent premature window destroy by default wm_close diff --git a/lcl/interfaces/win32/win32object.inc b/lcl/interfaces/win32/win32object.inc index 95f03eb2ce..aac463657d 100644 --- a/lcl/interfaces/win32/win32object.inc +++ b/lcl/interfaces/win32/win32object.inc @@ -605,7 +605,7 @@ Begin Begin If Handle <> 0 Then begin - DestroyAcceleratorTable(Windows.GetProp(Handle, 'Accel')); + DestroyAcceleratorTable(LongWord(GetProp(Handle, 'Accel'))); DestroyWindow(Handle); end; End @@ -1131,7 +1131,7 @@ var Begin While PeekMessage(AMessage, HWnd(Nil), 0, 0,PM_REMOVE) Do Begin - AccelTable := HACCEL(Windows.GetProp(AMessage.HWnd, 'Accel')); + AccelTable := HACCEL(GetProp(AMessage.HWnd, 'Accel')); If (AccelTable = HACCEL(nil)) or (TranslateAccelerator(AMessage.HWnd, AccelTable, @AMessage) = 0) Then Begin TranslateMessage(@AMessage); @@ -2963,6 +2963,9 @@ End; { $Log$ + Revision 1.159 2004/01/20 10:26:41 micha + try register globally unique properties + Revision 1.158 2004/01/12 08:36:34 micha statusbar interface dependent reimplementation (from vincent) diff --git a/lcl/interfaces/win32/win32proc.inc b/lcl/interfaces/win32/win32proc.inc index 5b1e2d307b..417772b87a 100644 --- a/lcl/interfaces/win32/win32proc.inc +++ b/lcl/interfaces/win32/win32proc.inc @@ -578,13 +578,13 @@ end; Procedure SetAccelGroup(Const Control: HWND; Const AnAccelGroup: HACCEL); Begin Assert(False, 'Trace:TODO: Code SetAccelGroup'); - Windows.SetProp(Control, 'AccelGroup', AnAccelGroup); + InterfaceObject.SetProp(Control, 'AccelGroup', Pointer(AnAccelGroup)); End; Function GetAccelGroup(Const Control: HWND): HACCEL; Begin Assert(False, 'Trace:TODO: Code GetAccelGroup'); - Result := HACCEL(Windows.GetProp(Control, 'AccelGroup')); + Result := HACCEL(InterfaceObject.GetProp(Control, 'AccelGroup')); End; Procedure SetAccelKey(Window: HWND; Const CommandId: Word; Const AKey: word; Const AModifier: TShiftState); @@ -620,7 +620,7 @@ var AccelCount: integer; {number of accelerators in table} end; Begin - OldAccel := Windows.GetProp(Window, 'Accel'); + OldAccel := LongWord(InterfaceObject.GetProp(Window, 'Accel')); NullAccel := nil; AccelCount := CopyAcceleratorTable(OldAccel, NullAccel, 0); Assert(False,Format('Trace: AccelCount=%d',[AccelCount])); @@ -639,7 +639,7 @@ Begin NewAccel[ControlIndex].fVirt := GetVirtFromState(AModifier); NewAccel[ControlIndex].key := AKey; DestroyAcceleratorTable(OldAccel); - Windows.SetProp(Window, 'Accel', CreateAcceleratorTable(NewAccel, NewCount)); + InterfaceObject.SetProp(Window, 'Accel', Pointer(CreateAcceleratorTable(NewAccel, NewCount))); End; Function GetAccelKey(Const Control: HWND): LPACCEL; @@ -736,6 +736,9 @@ End; { ============================================================================= $Log$ + Revision 1.36 2004/01/20 10:26:41 micha + try register globally unique properties + Revision 1.35 2003/12/29 14:22:22 micha fix a lot of range check errors win32 diff --git a/lcl/interfaces/win32/win32winapi.inc b/lcl/interfaces/win32/win32winapi.inc index d246bd82a8..0b5297cce4 100644 --- a/lcl/interfaces/win32/win32winapi.inc +++ b/lcl/interfaces/win32/win32winapi.inc @@ -160,7 +160,7 @@ var MoveWindowOrgEx(PaintMsg.DC,-ClientBoundRect.Left,-ClientBoundRect.Top); try // call win32 paint handler - PrevWndProc := Pointer(Windows.GetProp(Handle, 'DefWndProc')); + PrevWndProc := Pointer(GetProp(Handle, 'DefWndProc')); if PrevWndProc = nil then Windows.DefWindowProc(Handle, WM_PAINT, PaintMsg.DC, 0) else @@ -1251,7 +1251,7 @@ var Begin Result := Boolean(Windows.GetClientRect(Handle, @Rect)); if not Result then exit; - OwnerObject := TObject(Windows.GetProp(Handle, 'Wincontrol')); + OwnerObject := TObject(GetProp(Handle, 'Wincontrol')); if OwnerObject is TWinControl then begin TheWinControl:=TWinControl(OwnerObject); if TheWinControl is TCustomGroupBox then begin @@ -1368,7 +1368,7 @@ var OverlayWindow: HWND; ARect: Windows.RECT; begin - OverlayWindow := HWND(Windows.GetProp(WindowHandle, 'Overlay')); + OverlayWindow := HWND(GetProp(WindowHandle, 'Overlay')); if OverlayWindow = HWND(nil) then begin // create 'overlay' window @@ -1376,10 +1376,10 @@ begin OverlayWindow := Windows.CreateWindowEx(WS_EX_TRANSPARENT, 'STATIC', '', WS_CHILD or WS_VISIBLE, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom, - WindowHandle, HMENU(nil), HInstance, nil); - Windows.SetProp(OverlayWindow, 'DefWndProc', Windows.SetWindowLong( - OverlayWindow, GWL_WNDPROC, LongInt(@OverlayWindowProc))); - Windows.SetProp(WindowHandle, 'Overlay', OverlayWindow); + WindowHandle, HMENU(nil), System.HInstance, nil); + SetProp(OverlayWindow, 'DefWndProc', Pointer(Windows.SetWindowLong( + OverlayWindow, GWL_WNDPROC, LongInt(@OverlayWindowProc)))); + SetProp(WindowHandle, 'Overlay', Pointer(OverlayWindow)); end; Result := Windows.GetDC(OverlayWindow); end; @@ -1735,8 +1735,11 @@ End; Retrieves a pointer to data from the property list of the given window. ------------------------------------------------------------------------------} Function TWin32Object.GetProp(Handle: HWND; Str: PChar): Pointer; +Var + TempStr: string; Begin - Result := Pointer(Windows.GetProp(Handle, Str)); + TempStr := Format('%s%.8x', [Str, Windows.GetCurrentThreadId]); + Result := Pointer(Windows.GetProp(Handle, PChar(TempStr))); End; @@ -2590,9 +2593,12 @@ End; for a properties-enumeration function that's called when the program is quit. ------------------------------------------------------------------------------} Function TWin32Object.SetProp(Handle: HWND; Str: PChar; Data: Pointer): Boolean; +Var + TempStr: string; Begin Assert(False, 'Trace:TWin32Object.SetProp - Start'); - Result := Boolean(Windows.SetProp(Handle, Str, Windows.HANDLE(Data))); + TempStr := Format('%s%.8x', [Str, Windows.GetCurrentThreadId]); + Result := Boolean(Windows.SetProp(Handle, PChar(TempStr), Windows.HANDLE(Data))); Assert(False, Format('Trace:TWin32Object.SetProp --> Window handle: 0x%X, Propery to set: %S, Data to set: 0x%P, Property was successfully set: %S', [Handle, String(Str), Data, BOOL_RESULT[Result]])); End; @@ -2904,6 +2910,9 @@ end; { ============================================================================= $Log$ + Revision 1.94 2004/01/20 10:26:41 micha + try register globally unique properties + Revision 1.93 2004/01/17 11:11:42 micha scrollbar fix (from martin smat)