wince: implements sending back key as backspace to controls

git-svn-id: trunk@26841 -
This commit is contained in:
sekelsenmat 2010-07-26 15:09:07 +00:00
parent 902ff34fcd
commit c3c6eb4583
3 changed files with 22 additions and 0 deletions

View File

@ -1936,6 +1936,16 @@ begin
Assigned(TWinCEWidgetSet(WidgetSet).FOnAsyncSocketMsg) then
exit(TWinCEWidgetSet(WidgetSet).FOnAsyncSocketMsg(WParam, LParam))
end;
WM_HOTKEY:
begin
// Implements back-key sending to edits, instead of hiding the form
// See http://bugs.freepascal.org/view.php?id=16699
if HIWORD(lParam) = VK_ESCAPE then
begin
SHSendBackToFocusWindow(Msg, wParam, lParam);
Exit;
end;
end;
else
// pass along user defined messages
if Msg >= WM_USER then

View File

@ -86,6 +86,10 @@ function ImageList_Copy(himlDst: HIMAGELIST; iDst: longint; himlSrc: HIMAGELIST;
function ImageList_Copy(himlDst: HIMAGELIST; iDst: longint; himlSrc: HIMAGELIST; Src: longint; uFlags: UINT): BOOL; cdecl; external KernelDLL;
{$endif}
{$ifdef wince}
procedure SHSendBackToFocusWindow(uMsg: UINT; wp: WPARAM; lp: LPARAM); cdecl; external 'aygshell' index 97;
{$endif}
const
// BlendOp flags
AC_SRC_OVER = $00;

View File

@ -232,6 +232,14 @@ begin
end;
end;
// Implements back-key sending to edits, instead of hiding the form
// See http://bugs.freepascal.org/view.php?id=16699
if mbi.hwndMB <> 0 then
begin
SendMessage(mbi.hwndMB, SHCMBM_OVERRIDEKEY, VK_ESCAPE,
MAKELPARAM(SHMBOF_NODEFAULT or SHMBOF_NOTIFY, SHMBOF_NODEFAULT or SHMBOF_NOTIFY));
end;
{$ifdef VerboseWinCEMenu}
DebugLn('[CeSetMenu] menu bar window = ' + IntToStr(mbi.hwndMB) +
' mbi.nToolBarId = ' + IntToStr(mbi.nToolBarId));