diff --git a/lcl/interfaces/wince/wincecallback.inc b/lcl/interfaces/wince/wincecallback.inc index 590ce955f0..e4d4f4634a 100644 --- a/lcl/interfaces/wince/wincecallback.inc +++ b/lcl/interfaces/wince/wincecallback.inc @@ -1056,7 +1056,10 @@ begin { Handles the "OK" button in the title bar of dialogs } if Lo(wParam) = IDOK then begin - SendMessage(Window, WM_CLOSE, 0, 0); + if (lWinControl is TCustomForm) and (fsModal in TCustomForm(lWinControl).FormState) then + TCustomForm(lWinControl).ModalResult := mrOK + else + SendMessage(Window, WM_CLOSE, 0, 0); end else begin