Index: lcl/forms.pp
===================================================================
--- lcl/forms.pp	(revision 10198)
+++ lcl/forms.pp	(working copy)
@@ -862,12 +862,15 @@
     Data: PtrInt;
     NextItem: PAsyncCallQueueItem;
   end;
+  
+  TApplicationType = (atDefault,atDesktop,atHandheld,atPDA,atSmartphone);
 
   { TApplication }
 
   TApplication = class(TCustomApplication)
   private
     FApplicationHandlers: array[TApplicationHandlerType] of TMethodList;
+    FApplicationType: TApplicationType;
     FCaptureExceptions: boolean;
     FFindGlobalComponentEnabled: boolean;
     FFlags: TApplicationFlags;
@@ -1061,6 +1064,7 @@
     property ShowHint: Boolean read FShowHint write SetShowHint;
     property ShowMainForm: Boolean read FShowMainForm write FShowMainForm default true;
     property Title: String read GetTitle write SetTitle;
+    property ApplicationType : TApplicationType read FApplicationType write FApplicationType;
   end;
 
 
@@ -1089,6 +1093,8 @@
     FOnUserInput: TOnUserInputEvent;
     FOnEndSession : TNotifyEvent;
     FOnQueryEndSession : TQueryEndSessionEvent;
+    function GetAppType: TApplicationType;
+    procedure SetAppType(const AValue: TApplicationType);
     procedure SetShowMainForm(const AValue: Boolean);
   protected
     Procedure SetCaptureExceptions(Const AValue : boolean);
@@ -1126,6 +1132,7 @@
     property ShowHint: Boolean read FShowHint write SetShowHint;
     property ShowMainForm: Boolean read FShowMainForm write SetShowMainForm default true;
     property Title: String read FTitle write SetTitle;
+    property ApplicationType :  TApplicationType read GetAppType write SetAppType;
 
     property OnException: TExceptionEvent read FOnException write SetOnException;
     property OnIdle: TIdleEvent read FOnIdle write SetOnIdle;
Index: lcl/include/applicationproperties.inc
===================================================================
--- lcl/include/applicationproperties.inc	(revision 10198)
+++ lcl/include/applicationproperties.inc	(working copy)
@@ -97,6 +97,16 @@
     Application.ShowMainForm := AValue;
 end;
 
+function TApplicationProperties.GetAppType: TApplicationType;
+begin
+  Result := Application.ApplicationType;
+end;
+
+procedure TApplicationProperties.SetAppType(const AValue: TApplicationType);
+begin
+  Application.ApplicationType := AValue;
+end;
+
 Procedure TApplicationProperties.SetTitle(Const AValue : String);
 begin
   FTitle := AValue;
Index: lcl/include/interfacebase.inc
===================================================================
--- lcl/include/interfacebase.inc	(revision 10198)
+++ lcl/include/interfacebase.inc	(working copy)
@@ -46,3 +46,4 @@
 begin
   Debugln('TWidgetSet.AppSetTitle not implemented by ', ClassName);
 end;
+
Index: lcl/interfaces/wince/winceobject.inc
===================================================================
--- lcl/interfaces/wince/winceobject.inc	(revision 10198)
+++ lcl/interfaces/wince/winceobject.inc	(working copy)
@@ -135,13 +135,13 @@
 procedure TWinCEWidgetSet.DCSetPixel(CanvasHandle: HDC; X, Y: integer;
   AColor: TGraphicsColor);
 begin
-
+  Windows.SetPixel(CanvasHandle, X, Y, AColor);
 end;
 
 function TWinCEWidgetSet.DCGetPixel(CanvasHandle: HDC; X, Y: integer
   ): TGraphicsColor;
 begin
-  Result:=clNone;
+  Result := Windows.GetPixel(CanvasHandle, X, Y);
 end;
 
 procedure TWinCEWidgetSet.DCRedraw(CanvasHandle: HDC);
@@ -298,6 +298,7 @@
 procedure TWinCEWidgetSet.AppTerminate;
 begin
   AppTerminated := True;
+  PostQuitMessage(0);
 end;
 
 function TWinCEWidgetSet.InitHintFont(HintFont: TObject): Boolean;
Index: lcl/interfaces/wince/winceproc.pp
===================================================================
--- lcl/interfaces/wince/winceproc.pp	(revision 10198)
+++ lcl/interfaces/wince/winceproc.pp	(working copy)
@@ -5,7 +5,8 @@
 interface
 
 uses
-  Windows, Classes, LMessages, LCLType, LCLProc, Controls, Forms, Menus,WinCEWinAPIEmu;
+  Windows, Classes, LMessages, LCLType, LCLProc, Controls, Forms, Menus,
+  WinCEWinAPIEmu;
   
   Type
   TEventType = (etNotify, etKey, etKeyPress, etMouseWheel, etMouseUpDown);
@@ -283,27 +284,48 @@
 
 function BorderStyleToWin32Flags(Style: TFormBorderStyle): DWORD;
 begin
-  Result := WS_CLIPCHILDREN or WS_CLIPSIBLINGS;
-  case Style of
-  bsSizeable, bsSizeToolWin:
-    Result := Result or (WS_OVERLAPPED or WS_THICKFRAME or WS_CAPTION);
-  bsSingle, bsToolWindow:
-    Result := Result or (WS_OVERLAPPED or WS_BORDER or WS_CAPTION);
-  bsDialog:
-    Result := Result or (WS_POPUP or WS_BORDER or WS_CAPTION);
-  bsNone:
-    Result := Result or WS_POPUP;
+  case Application.ApplicationType of
+  atDesktop,atHandheld:
+    begin
+      Result := WS_CLIPCHILDREN or WS_CLIPSIBLINGS;
+      case Style of
+      bsSizeable, bsSizeToolWin:
+        Result := Result or (WS_OVERLAPPED or WS_THICKFRAME or WS_CAPTION);
+      bsSingle, bsToolWindow:
+        Result := Result or (WS_OVERLAPPED or WS_BORDER or WS_CAPTION);
+      bsDialog:
+        Result := Result or (WS_POPUP or WS_BORDER or WS_CAPTION);
+      bsNone:
+        Result := Result or WS_POPUP;
+      end;
+    end;
+  atPDA,atSmartphone,atDefault:
+    begin
+      Result := WS_VISIBLE;
+    end;
   end;
 end;
 
 function BorderStyleToWin32FlagsEx(Style: TFormBorderStyle): DWORD;
 begin
   Result := 0;
-  case Style of
-  bsDialog:
-    Result := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE;
-  bsToolWindow, bsSizeToolWin:
-    Result := WS_EX_TOOLWINDOW;
+  case Application.ApplicationType of
+  atDesktop,atHandheld:
+    begin
+      case Style of
+      bsDialog:
+        Result := WS_EX_DLGMODALFRAME or WS_EX_WINDOWEDGE;
+      bsToolWindow, bsSizeToolWin:
+        Result := WS_EX_TOOLWINDOW;
+      end;
+    end;
+  atPDA,atSmartphone,atDefault:
+    begin
+      case Style of
+      bsDialog:
+        Result := WS_EX_CAPTIONOKBTN;
+      end;
+    end;
   end;
 end;
 
Index: lcl/interfaces/wince/wincewsforms.pp
===================================================================
--- lcl/interfaces/wince/wincewsforms.pp	(revision 10198)
+++ lcl/interfaces/wince/wincewsforms.pp	(working copy)
@@ -206,9 +206,9 @@
   if GetDesigningBorderStyle(AForm) in [bsNone, bsSingle, bsSizeable] then
   begin
     if biMinimize in BorderIcons then
-      Result := Result or WS_MINIMIZEBOX;
+      Result := Result or WS_MINIMIZE;
     if biMaximize in BorderIcons then
-      Result := Result or WS_MAXIMIZEBOX;
+      Result := Result or WS_MAXIMIZE;
   end;
 end;
 
