mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 04:59:08 +02:00
fixed Criticalsection from Vincent
git-svn-id: trunk@4360 -
This commit is contained in:
parent
e6458fb8da
commit
2d5486cfdc
@ -57,6 +57,7 @@ Var
|
|||||||
R: TRect;
|
R: TRect;
|
||||||
OwnerObject: TObject;
|
OwnerObject: TObject;
|
||||||
WinProcess: Boolean;
|
WinProcess: Boolean;
|
||||||
|
C: integer;
|
||||||
procedure ShowHideTabPage(NotebookHandle: HWnd; Showing: boolean);
|
procedure ShowHideTabPage(NotebookHandle: HWnd; Showing: boolean);
|
||||||
var
|
var
|
||||||
NoteBook: TCustomNotebook;
|
NoteBook: TCustomNotebook;
|
||||||
@ -192,10 +193,8 @@ Begin
|
|||||||
WM_DESTROY:
|
WM_DESTROY:
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
|
Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
|
||||||
// The following lines cause an acces violation
|
For C := 0 To WndList.Count - 1 Do
|
||||||
// TODO: find out why.
|
EnumProps(HWND(WndList[C]), @PropEnumProc);
|
||||||
// For C := 0 To WndList.Count - 1 Do
|
|
||||||
// EnumProps(HWND(WndList[C]), @PropEnumProc);
|
|
||||||
LMessage.Msg := LM_DESTROY;
|
LMessage.Msg := LM_DESTROY;
|
||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
End;
|
End;
|
||||||
@ -555,6 +554,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.34 2003/07/03 08:05:53 mattias
|
||||||
|
fixed Criticalsection from Vincent
|
||||||
|
|
||||||
Revision 1.33 2003/07/02 20:18:28 mattias
|
Revision 1.33 2003/07/02 20:18:28 mattias
|
||||||
more cleanups from Micha
|
more cleanups from Micha
|
||||||
|
|
||||||
|
@ -136,18 +136,9 @@ Begin
|
|||||||
FToolTipWindow := CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nil, WS_POPUP Or TTS_NOPREFIX Or TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, FParentWindow, HMENU(nil), HInstance, nil);
|
FToolTipWindow := CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nil, WS_POPUP Or TTS_NOPREFIX Or TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, FParentWindow, HMENU(nil), HInstance, nil);
|
||||||
Windows.SendMessage(FParentWindow, TTM_ACTIVATE, WPARAM(True), 0);
|
Windows.SendMessage(FParentWindow, TTM_ACTIVATE, WPARAM(True), 0);
|
||||||
|
|
||||||
try
|
FTimerWindow :=CreateWindowEx(0, @TimerClsName, nil, WS_POPUPWINDOW, 0, 0, 640, 480, 0, 0, System.HInstance, nil);
|
||||||
FTimerWindow :=CreateWindowEx(0, @TimerClsName, nil, WS_POPUPWINDOW, 0, 0, 640, 480, 0, 0, System.HInstance, nil);
|
|
||||||
except
|
|
||||||
// Sometimes an access violation occurs, I don't know why
|
|
||||||
on E: Exception do
|
|
||||||
begin
|
|
||||||
FTimerWindow := 0;
|
|
||||||
writeln('Win32Object.Init: Failed to create a hidden window to receive timer messages');
|
|
||||||
writeln('Exception: ',E.Message);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
Assert(False,'Trace:FTimerWindow: ' + IntToStr(FTimerWindow));
|
Assert(False,'Trace:FTimerWindow: ' + IntToStr(FTimerWindow));
|
||||||
|
|
||||||
//Init stock objects;
|
//Init stock objects;
|
||||||
LogBrush.lbStyle := BS_NULL;
|
LogBrush.lbStyle := BS_NULL;
|
||||||
FStockNullBrush := CreateBrushIndirect(LogBrush);
|
FStockNullBrush := CreateBrushIndirect(LogBrush);
|
||||||
@ -2717,6 +2708,9 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.69 2003/07/03 08:05:53 mattias
|
||||||
|
fixed Criticalsection from Vincent
|
||||||
|
|
||||||
Revision 1.68 2003/07/02 20:18:28 mattias
|
Revision 1.68 2003/07/02 20:18:28 mattias
|
||||||
more cleanups from Micha
|
more cleanups from Micha
|
||||||
|
|
||||||
|
@ -2260,6 +2260,8 @@ Begin
|
|||||||
Result := Windows.WindowFromPoint(Windows.POINT(Point));
|
Result := Windows.WindowFromPoint(Windows.POINT(Point));
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
|
{We interprete CritSection as a pointer to a LPCRITICAL_SECTION structure}
|
||||||
Procedure TWin32Object.InitializeCriticalSection(var CritSection: TCriticalSection);
|
Procedure TWin32Object.InitializeCriticalSection(var CritSection: TCriticalSection);
|
||||||
var
|
var
|
||||||
Crit : LPCRITICAL_SECTION;
|
Crit : LPCRITICAL_SECTION;
|
||||||
@ -2268,8 +2270,8 @@ begin
|
|||||||
If CritSection <> 0 then
|
If CritSection <> 0 then
|
||||||
DeleteCriticalSection(CritSection);
|
DeleteCriticalSection(CritSection);
|
||||||
New(Crit);
|
New(Crit);
|
||||||
Windows.InitializeCriticalSection(Crit^);
|
Windows.InitializeCriticalSection(Crit);
|
||||||
CritSection := Longint(Crit);
|
CritSection := TCriticalSection(Crit);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TWin32Object.EnterCriticalSection(var CritSection: TCriticalSection);
|
Procedure TWin32Object.EnterCriticalSection(var CritSection: TCriticalSection);
|
||||||
@ -2287,11 +2289,14 @@ end;
|
|||||||
Procedure TWin32Object.DeleteCriticalSection(var CritSection: TCriticalSection);
|
Procedure TWin32Object.DeleteCriticalSection(var CritSection: TCriticalSection);
|
||||||
begin
|
begin
|
||||||
{ An OS Compatible TCriticalSection needs to be defined}
|
{ An OS Compatible TCriticalSection needs to be defined}
|
||||||
Windows.DeleteCriticalSection(LPCRITICAL_SECTION(CritSection));
|
if CritSection<>0 then
|
||||||
Try
|
begin
|
||||||
Dispose(LPCRITICAL_SECTION(CritSection));
|
Windows.DeleteCriticalSection(LPCRITICAL_SECTION(CritSection));
|
||||||
finally
|
Try
|
||||||
CritSection := 0;
|
Dispose(LPCRITICAL_SECTION(CritSection));
|
||||||
|
finally
|
||||||
|
CritSection := 0;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2305,6 +2310,9 @@ end;
|
|||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.39 2003/07/03 08:05:53 mattias
|
||||||
|
fixed Criticalsection from Vincent
|
||||||
|
|
||||||
Revision 1.38 2003/07/02 20:07:29 mattias
|
Revision 1.38 2003/07/02 20:07:29 mattias
|
||||||
fixed critical section from Micha
|
fixed critical section from Micha
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user