/[lcore]/trunk/lcoremessages.pas
ViewVC logotype

Diff of /trunk/lcoremessages.pas

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 42 by plugwash, Tue Feb 17 00:51:40 2009 UTC revision 135 by beware, Thu Mar 13 21:27:50 2014 UTC
# Line 73  Line 73 
73  const  const
74    WS_EX_TOOLWINDOW = $80;    WS_EX_TOOLWINDOW = $80;
75    WS_POPUP = longint($80000000);    WS_POPUP = longint($80000000);
76      CW_USEDEFAULT=$80000000;
77    hinstance=nil;    hinstance=nil;
78    PM_REMOVE = 1;    PM_REMOVE = 1;
79    WM_USER = 1024;    WM_USER = 1024;
80    WM_TIMER = 275;    WM_TIMER = 275;
81    INFINITE = syncobjs.infinite;    INFINITE = syncobjs.infinite;
82    
83  function getwindowlongptr(ahwnd:hwnd;nindex:integer) : taddrint;  function getwindowlongptr(ahwnd:hwnd;nindex:integer) : taddrint;
84  function setwindowlongptr(ahwnd:hwnd;nindex:integer;dwNewLong : taddrint) : taddrint;  function setwindowlongptr(ahwnd:hwnd;nindex:integer;dwNewLong : taddrint) : taddrint;
85  function DefWindowProc(ahWnd:HWND; auMsg:Integer; awParam:WPARAM; alParam:LPARAM):Integer; stdcall;  function DefWindowProc(ahWnd:HWND; auMsg:Integer; awParam:WPARAM; alParam:LPARAM):Integer; stdcall;
# Line 99  Line 101 
101    
102  implementation  implementation
103  uses  uses
104    baseunix,unix,lcore,unixutil;//,safewriteln;    baseunix,unix,lcore,unixutil,ltimevalstuff,sockets;//,safewriteln;
105  {$i unixstuff.inc}  {$i unixstuff.inc}
106    
107  type  type
108      
109    tmessageintransit = class    tmessageintransit = class
110      msg : tmsg;      msg : tmsg;
111      next : tmessageintransit;      next : tmessageintransit;
# Line 114  Line 117 
117      waiting : boolean;      waiting : boolean;
118      lcorethread : boolean;      lcorethread : boolean;
119      nexttimer : ttimeval;      nexttimer : ttimeval;
120      threadid : integer;      threadid : tthreadid;
121    end;    end;
122    twindow=class    twindow=class
123      hwnd : hwnd;      hwnd : hwnd;
# Line 135  Line 138 
138    //than crash after over four billion    //than crash after over four billion
139    //windows have been made ;)    //windows have been made ;)
140    nextwindowhandle : qword = $100000000;    nextwindowhandle : qword = $100000000;
141  {$i ltimevalstuff.inc}  
142    
143  //findthreaddata should only be called while holding the structurelock  //findthreaddata should only be called while holding the structurelock
144  function findthreaddata(threadid : integer) : tthreaddata;  function findthreaddata(threadid : tthreadid) : tthreaddata;
145  begin  begin
146    result := tthreaddata(findtree(@threaddata,inttostr(threadid)));    result := tthreaddata(findtree(@threaddata,inttostr(taddrint(threadid))));
147    if result = nil then begin    if result = nil then begin
148      result := tthreaddata.create;      result := tthreaddata.create;
149      result.messageevent := teventobject.create(nil,false,false,inttostr(taddrint(result)));      result.messageevent := teventobject.create(nil,false,false,inttostr(taddrint(result)));
150      result.nexttimer := tv_invalidtimebig;      result.nexttimer := tv_invalidtimebig;
151      result.threadid := threadid;      result.threadid := threadid;
152      addtree(@threaddata,inttostr(threadid),result);      addtree(@threaddata,inttostr(taddrint(threadid)),result);
153    end;    end;
154  end;  end;
155    
# Line 160  Line 163 
163      //writeln('freeing thread data object');      //writeln('freeing thread data object');
164      athreaddata.free;      athreaddata.free;
165      //writeln('deleting thread data object from hashtable');      //writeln('deleting thread data object from hashtable');
166      deltree(@threaddata,inttostr(athreaddata.threadid));      deltree(@threaddata,inttostr(taddrint(athreaddata.threadid)));
167      //writeln('finished deleting thread data');      //writeln('finished deleting thread data');
168    end else begin    end else begin
169      //writeln('thread data is not unused');      //writeln('thread data is not unused');
# Line 292  Line 295 
295        //writeln('aboute to delete window from windows structure');        //writeln('aboute to delete window from windows structure');
296        deltree(@windows,inttostr(ahwnd));        deltree(@windows,inttostr(ahwnd));
297        //writeln('deleted window from windows structure');        //writeln('deleted window from windows structure');
298        windowthreaddata := tthreaddata(findtree(@threaddata,inttostr(window.threadid)));        windowthreaddata := tthreaddata(findtree(@threaddata,inttostr(taddrint(window.threadid))));
299    
300        if windowthreaddata <> nil then begin        if windowthreaddata <> nil then begin
301          //writeln('found thread data scanning for messages to clean up');          //writeln('found thread data scanning for messages to clean up');

Legend:
Removed from v.42  
changed lines
  Added in v.135

No admin address has been configured">No admin address has been configured
ViewVC Help
Powered by ViewVC 1.1.22