X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/ac55319310f2e0b8ac5d848c1591b5e72d49c9b3..03b75b4c964d8b3ac97d4007f0e033549b01c92f:/lmessages.pas?ds=sidebyside diff --git a/lmessages.pas b/lmessages.pas old mode 100755 new mode 100644 index d7e4008..3edc463 --- a/lmessages.pas +++ b/lmessages.pas @@ -73,11 +73,13 @@ type const WS_EX_TOOLWINDOW = $80; WS_POPUP = longint($80000000); + CW_USEDEFAULT=$80000000; hinstance=nil; PM_REMOVE = 1; WM_USER = 1024; WM_TIMER = 275; INFINITE = syncobjs.infinite; + function getwindowlongptr(ahwnd:hwnd;nindex:integer) : taddrint; function setwindowlongptr(ahwnd:hwnd;nindex:integer;dwNewLong : taddrint) : taddrint; function DefWindowProc(ahWnd:HWND; auMsg:Integer; awParam:WPARAM; alParam:LPARAM):Integer; stdcall; @@ -99,10 +101,11 @@ procedure init; implementation uses - baseunix,unix,lcore,unixutil,ltimevalstuff;//,safewriteln; + baseunix,unix,lcore,unixutil,ltimevalstuff,sockets;//,safewriteln; {$i unixstuff.inc} type + tmessageintransit = class msg : tmsg; next : tmessageintransit; @@ -114,7 +117,7 @@ type waiting : boolean; lcorethread : boolean; nexttimer : ttimeval; - threadid : integer; + threadid : tthreadid; end; twindow=class hwnd : hwnd; @@ -138,15 +141,15 @@ var //findthreaddata should only be called while holding the structurelock -function findthreaddata(threadid : integer) : tthreaddata; +function findthreaddata(threadid : tthreadid) : tthreaddata; begin - result := tthreaddata(findtree(@threaddata,inttostr(threadid))); + result := tthreaddata(findtree(@threaddata,inttostr(taddrint(threadid)))); if result = nil then begin result := tthreaddata.create; result.messageevent := teventobject.create(nil,false,false,inttostr(taddrint(result))); result.nexttimer := tv_invalidtimebig; result.threadid := threadid; - addtree(@threaddata,inttostr(threadid),result); + addtree(@threaddata,inttostr(taddrint(threadid)),result); end; end; @@ -160,7 +163,7 @@ begin //writeln('freeing thread data object'); athreaddata.free; //writeln('deleting thread data object from hashtable'); - deltree(@threaddata,inttostr(athreaddata.threadid)); + deltree(@threaddata,inttostr(taddrint(athreaddata.threadid))); //writeln('finished deleting thread data'); end else begin //writeln('thread data is not unused'); @@ -292,7 +295,7 @@ begin //writeln('aboute to delete window from windows structure'); deltree(@windows,inttostr(ahwnd)); //writeln('deleted window from windows structure'); - windowthreaddata := tthreaddata(findtree(@threaddata,inttostr(window.threadid))); + windowthreaddata := tthreaddata(findtree(@threaddata,inttostr(taddrint(window.threadid)))); if windowthreaddata <> nil then begin //writeln('found thread data scanning for messages to clean up');