Implements threading synchronize on wince.

git-svn-id: trunk@13005 -
This commit is contained in:
sekelsenmat 2007-11-24 18:21:18 +00:00
parent 1d3c957dcb
commit f30565766c
2 changed files with 9 additions and 4 deletions

View File

@ -165,6 +165,8 @@ type
function CreateTimer(Interval: integer; TimerFunc: TFNTimerProc) : THandle; override;
function DestroyTimer(TimerHandle: THandle) : boolean; override;
// thread synchronize support
procedure HandleWakeMainThread(Sender: TObject);
{$I wincewinapih.inc}

View File

@ -142,7 +142,7 @@ begin
FMessageFont := Windows.CreateFontIndirect(@FMetrics.lfMessageFont);
end;
// Create parent of all windows, `button on taskbar'
// Create parent of all windows, 'button on taskbar'
//does this work on wince?!
FAppHandle := CreateWindow(@ClsName, StringToPWideChar(Application.Title),
WS_POPUP or WS_CLIPSIBLINGS or WS_CAPTION or WS_SYSMENU or WS_MINIMIZEBOX,
@ -173,9 +173,8 @@ begin
ScreenInfo.ColorDepth := GetDeviceCaps(DC, BITSPIXEL);
ReleaseDC(Handle, DC);
//roozbeh:what is this?!!
// Thread.Synchronize support
//WakeMainThread := @HandleWakeMainThread;
WakeMainThread := @HandleWakeMainThread;
end;
{------------------------------------------------------------------------------
@ -494,7 +493,11 @@ begin
Assert(False,'Trace:Destroy timer Result: '+ BOOL_RESULT[result]);
end;
procedure TWinCEWidgetSet.HandleWakeMainThread(Sender: TObject);
begin
// wake up GUI thread by sending a message to it
Windows.PostMessage(AppHandle, WM_NULL, 0, 0);
end;
procedure TWinCEWidgetSet.AttachMenuToWindow(AMenuObject: TComponent);
var