Модератор: Модераторы
Лекс Айрин писал(а):включи отладку в проекте
zub писал(а):"Вызов" в строке 32 последний в коде лцл, от него и пляши
procedure TWidgetSet.AppRun(const ALoop: TApplicationMainLoop);
begin
if Assigned(ALoop) then ALoop;
end;
vitaly_l писал(а):художники в печали - это не наш уровень...
// This is called from the actual WindowProc.
function TWindowProcHelper.DoWindowProc: LResult;
var
ChildWindowInfo: PWin32WindowInfo;
TargetObject: TObject;
TargetWindow: HWND;
WmSysCommandProcess: Boolean;
CancelEndSession : Boolean; // used by WM_QUERYENDSESSION
// used by WM_CHAR, WM_SYSCHAR and WM_KEYDOWN, WM_KEYUP, WM_SYSKEYDOWN, WM_SYSKEYUP
CharCodeNotEmpty: boolean;
R: TRect;
ACtl: TWinControl;
LMouseEvent: TTRACKMOUSEEVENT;
{$IF NOT DECLARED(WM_DPICHANGED)} // WM_DPICHANGED was added in FPC 3.1.1
const
WM_DPICHANGED = $02E0;
{$ENDIF}
begin
FillChar(LMessage, SizeOf(LMessage), 0);
PLMsg := @LMessage;
WinProcess := True;
NotifyUserInput := False;
WindowInfo := GetWin32WindowInfo(Window);
if WindowInfo^.isChildEdit then
begin
if DoChildEdit(Result) then Exit;
end else begin
lWinControl := WindowInfo^.WinControl;
end;
if (IgnoreNextCharWindow <> 0) and ((Msg = WM_CHAR) or (Msg = WM_SYSCHAR)) then
begin
if IgnoreNextCharWindow = Window then
begin
IgnoreNextCharWindow := 0;
Result := 1;
Exit;
end;
IgnoreNextCharWindow := 0;
end;
if IgnoreKeyUp and (Msg = WM_KEYUP) then
Exit(1);
case Msg of
WM_MOUSEFIRST..WM_MOUSELAST:
if Application.MouseControl<>lWinControl then
begin
// register for WM_MOUSELEAVE
FillChar(LMouseEvent, SizeOf(TTRACKMOUSEEVENT), 0);
LMouseEvent.cbSize := SizeOf(TTRACKMOUSEEVENT);
LMouseEvent.dwFlags := TME_LEAVE;
LMouseEvent.hwndTrack := Window;
LMouseEvent.dwHoverTime := HOVER_DEFAULT;
_TrackMouseEvent(@LMouseEvent);
end;
end;
case Msg of
WM_NULL:
if (Window = Win32WidgetSet.AppHandle) then
begin
CheckSynchronize;
TWin32Widgetset(Widgetset).CheckPipeEvents;
end;
WM_ENTERIDLE: Application.Idle(False);
WM_ACTIVATE: SetLMessageAndParams(LM_ACTIVATE);
WM_DPICHANGED: SetLMessageAndParams(LM_DPICHANGED);
WM_IME_ENDCOMPOSITION:
begin
{IME Windows the composition has finished}
WindowInfo^.IMEComposed:=True;
SetLMessageAndParams(Msg); //WinProcess := False;
end;
WM_CANCELMODE: LMessage.Msg := LM_CANCELMODE;
WM_CAPTURECHANGED: LMessage.Msg := LM_CAPTURECHANGED;
WM_CHAR: DoMsgChar(Result);
WM_MENUCHAR:
begin
PLMsg^.Result := FindMenuItemAccelerator(LOWORD(WParam), HMENU(LParam));
WinProcess := false;
end;
WM_CLOSE:
begin
if (Window = Win32WidgetSet.AppHandle) and Assigned(Application.MainForm) then
Windows.SendMessage(Application.MainFormHandle, WM_CLOSE, 0, 0)
else
LMessage.Msg := LM_CLOSEQUERY;
// default is to destroy window, inhibit
WinProcess := false;
end;
WM_INITMENUPOPUP:
begin
if HIWORD(lParam) = 0 then //if not system menu
begin
TargetObject := GetPopMenuItemObject;
if TargetObject is TMenuItem then
begin
LMessage.Msg := LM_ACTIVATE;
TargetObject.Dispatch(LMessage);
lWinControl := nil;
end;
end;
end;
WM_MENUSELECT:
begin
TargetObject := GetMenuItemObject((HIWORD(Integer(WParam)) and MF_POPUP) <> 0);
if TargetObject is TMenuItem then
TMenuItem(TargetObject).IntfDoSelect
else
Application.Hint := '';
end;
WM_COMMAND:
begin
if LParam = 0 then
begin
{menuitem or shortcut}
TargetObject := GetMenuItemObject(False);
if TargetObject is TMenuItem then
begin
if (HIWORD(WParam) = 0) or (HIWORD(WParam) = 1) then
begin
LMessage.Msg := LM_ACTIVATE;
TargetObject.Dispatch(LMessage);
end;
lWinControl := nil;
end;
end
else begin
ChildWindowInfo := GetWin32WindowInfo(HWND(LParam));
lWinControl := ChildWindowInfo^.WinControl;
// buddy controls use 'awincontrol' to designate associated wincontrol
if lWinControl = nil then
lWinControl := ChildWindowInfo^.AWinControl;
if Assigned(ChildWindowInfo^.ParentMsgHandler) then
begin
if ChildWindowInfo^.ParentMsgHandler(lWinControl,
Window, WM_COMMAND, WParam, LParam, LMessage.Result, WinProcess) then Exit(LMessage.Result);
end;
// TToggleBox is a TCustomCheckBox too, but we don't want to handle
// state changes of TToggleBox ourselfves
if (lWinControl is TCustomCheckBox) and not (lWinControl is TToggleBox) then
DoCmdCheckBoxParam
else if lWinControl is TButtonControl then
case HIWORD(WParam) of
BN_CLICKED: LMessage.Msg := LM_CLICKED;
BN_KILLFOCUS: LMessage.Msg := LM_EXIT;
end
else
if (lWinControl is TCustomEdit) then
begin
if (lWinControl is TCustomMemo) then
case HIWORD(WParam) of
// multiline edit doesn't send EN_CHANGE, so use EN_UPDATE
EN_UPDATE: LMessage.Msg := CM_TEXTCHANGED;
end
else
case HIWORD(WParam) of
EN_CHANGE: LMessage.Msg := CM_TEXTCHANGED;
end;
end
else if (lWinControl is TCustomListBox) then
case HIWORD(WParam) of
LBN_SELCHANGE: LMessage.Msg := LM_SELCHANGE;
end
else if lWinControl is TCustomCombobox then
if DoCmdComboBoxParam then Exit;
end;
// no specific message found? try send a general msg
lWinControl.Perform(CN_COMMAND, WParam, LParam);
end;
WM_CTLCOLORMSGBOX..WM_CTLCOLORSTATIC:
begin
// it's needed for winxp themes where controls send the WM_ERASEBKGND
// message to their parent to clear their background and then draw
// transparently
// only static and button controls have transparent parts
// others need to erased with their window color
// scrollbar also has buttons
ChildWindowInfo := GetWin32WindowInfo(HWND(LParam));
if Assigned(ChildWindowInfo^.ParentMsgHandler)
and ChildWindowInfo^.ParentMsgHandler(lWinControl,
Window, Msg, WParam, LParam, LMessage.Result, WinProcess) then Exit(LMessage.Result);
DoMsgColor(ChildWindowInfo);
end;
WM_CLEAR: LMessage.Msg := LM_CLEAR;
WM_COPY: LMessage.Msg := LM_COPY;
WM_CUT: LMessage.Msg := LM_CUT;
{$ifndef RedirectDestroyMessages}
WM_DESTROY:
begin
if CurrentWindow=Window then
CurrentWindow := 0;
if lWinControl is TCustomComboBox then
DisposeComboEditWindowInfo(TCustomComboBox(lWinControl));
if WindowInfo^.Overlay<>HWND(nil) then
Windows.DestroyWindow(WindowInfo^.Overlay);
LMessage.Msg := LM_DESTROY;
end;
{$endif}
WM_DESTROYCLIPBOARD:
begin
if assigned(OnClipBoardRequest) then begin
{$IFDEF VerboseWin32Clipbrd}
debugln('WM_DESTROYCLIPBOARD');
{$ENDIF}
OnClipBoardRequest(0, nil);
OnClipBoardRequest := nil;
LMessage.Result := 0;
end;
end;
WM_DRAWITEM: DoMsgDrawItem;
WM_ENABLE: DoMsgEnable;
WM_ERASEBKGND:
if DoMsgEraseBkgnd(Result) then Exit;
WM_EXITMENULOOP:
// is it a popup menu
if longbool(WPARAM) and Assigned(WindowInfo^.PopupMenu) then
WindowInfo^.PopupMenu.Close;
WM_GETDLGCODE:
begin
LMessage.Result := DLGC_WANTALLKEYS;
WinProcess := False;
end;
WM_HELP:
// Don't ask windows to process the message here. It will be processed
// either by TCustomForm LM_HELP handler or passed to parent by DefaultHandler
SetLMessageAndParams(LM_HELP, True);
WM_HOTKEY:
SetLMessageAndParams(WM_HOTKEY, True);
WM_HSCROLL,
WM_VSCROLL:
begin
PLMsg := @LMScroll;
if LParam <> 0 then
begin
ChildWindowInfo := GetWin32WindowInfo(HWND(LParam));
lWinControl := ChildWindowInfo^.WinControl;
if Assigned(ChildWindowInfo^.ParentMsgHandler) then
if ChildWindowInfo^.ParentMsgHandler(lWinControl,
Window, Msg, WParam, LParam, PLMsg^.Result, WinProcess) then Exit(PLMsg^.Result);
end;
HandleScrollMessage(Msg);
end;
WM_KEYDOWN:
begin
DoMsgKeyDownUp(CN_KEYDOWN, Result);
WindowInfo^.IMEComposed:=False;
IgnoreNextCharWindow := Window;
IgnoreKeyUp := False;
end;
WM_KEYUP:
begin
DoMsgKeyDownUp(CN_KEYUP, Result);
if WindowInfo^.IMEComposed then
LMKey.Msg:=LM_NULL;
end;
WM_KILLFOCUS:
begin
{$ifdef DEBUG_CARET}
DebugLn(['WM_KILLFOCUS received for window ', IntToHex(Window, 8), ' NewFocus = ', IntToHex(WParam, 8), ' Text = ', WndText(WParam)]);
{$endif}
LMessage.Msg := LM_KILLFOCUS;
LMessage.WParam := WParam;
end;
//TODO:LM_KILLCHAR,LM_KILLWORD,LM_KILLLINE
WM_LBUTTONDBLCLK: DoMsgMouseDownUpClick(1, True, True);
WM_LBUTTONDOWN: DoMsgMouseDownUpClick(1, False, True);
WM_LBUTTONUP: DoMsgMouseDownUpClick(1, False, False);
WM_RBUTTONDBLCLK: DoMsgMouseDownUpClick(2, True, True);
WM_RBUTTONDOWN: DoMsgMouseDownUpClick(2, False, True);
WM_RBUTTONUP:
begin
DoMsgMouseDownUpClick(2, False, False);
WinProcess := false;
Result := 0;
end;
WM_MBUTTONDBLCLK: DoMsgMouseDownUpClick(3, True, True);
WM_MBUTTONDOWN: DoMsgMouseDownUpClick(3, False, True);
WM_MBUTTONUP: DoMsgMouseDownUpClick(3, False, False);
WM_XBUTTONDBLCLK: DoMsgMouseDownUpClick(4, True, True);
WM_XBUTTONDOWN: DoMsgMouseDownUpClick(4, False, True);
WM_XBUTTONUP: DoMsgMouseDownUpClick(4, False, False);
WM_MOUSEHOVER:
begin
NotifyUserInput := True;
LMessage.Msg := LM_MOUSEENTER;
end;
WM_MOUSELEAVE:
begin
NotifyUserInput := True;
LMessage.Msg := LM_MOUSELEAVE;
Application.DoBeforeMouseMessage(nil);
end;
WM_MOUSEMOVE: DoMsgMouseMove;
WM_MOUSEWHEEL: if DoMsgMouseWheel(Result) then Exit;
WM_DROPFILES:
begin
{$IFDEF EnableWMDropFiles}
SetLMessageAndParams(LM_DROPFILES);
{$ENDIF}
HandleDropFiles;
end;
//TODO:LM_MOVEPAGE,LM_MOVETOROW,LM_MOVETOCOLUMN
WM_NCHITTEST: SetLMessageAndParams(LM_NCHITTEST);
WM_NCLBUTTONDOWN: DoMsgNCLButtonDown;
WM_NCMOUSEMOVE,
WM_NCMOUSEHOVER:
begin
SetLMessageAndParams(Msg);
NotifyUserInput := True;
Application.DoBeforeMouseMessage(nil);
end;
WM_NOTIFY: if DoMsgNotify(Result) then Exit;
WM_PAINT: SendPaintMessage(HDC(WParam)); // SendPaintMessage sets winprocess to false
WM_PRINTCLIENT:
if ((LParam and PRF_CLIENT) = PRF_CLIENT) and (lWinControl <> nil) then
SendPaintMessage(HDC(WParam));
WM_PASTE: LMessage.Msg := LM_PASTE;
WM_CONTEXTMENU:
begin
DoMsgContextMenu;
Result := 0;
end;
WM_SETCURSOR: HandleSetCursor;
CM_ACTIVATE:
begin
if (Window = Win32WidgetSet.AppHandle) then
begin
// if application window is still focused then move the focus
// to the next top window
if not IsIconic(Window) and (GetFocus = Window) then
begin
TargetWindow := LookupTopWindow(Window);
if TargetWindow <> Window then
begin
// issues #26463, #29744
if (Application.ModalLevel > 0) and IsIconic(TargetWindow) then
begin
ACtl := FindControl(TargetWindow);
if (ACtl is TCustomForm) and (fsModal in TCustomForm(ACtl).FormState) then
Win32WidgetSet.AppRestore;
end;
SetFocus(TargetWindow);
end;
end;
Result := 0;
Exit;
end;
WinProcess := False;
end;
WM_SETFOCUS:
begin
{$ifdef DEBUG_CARET}
DebugLn('WM_SETFOCUS received for window ', IntToHex(Window, 8));
{$endif}
// move focus to another application window but process event first
if (Window = Win32WidgetSet.AppHandle) then
PostMessage(Window, CM_ACTIVATE, 0, 0);
LMessage.Msg := LM_SETFOCUS;
end;
WM_SHOWWINDOW: DoMsgShowWindow;
WM_SYSCHAR:
begin
PLMsg := @LMChar;
SetLMCharData(CN_SYSCHAR, True);
Result := 0;
WinProcess := false;
end;
WM_SYSCOMMAND:
begin
HandleSysCommand;
SetLMessageAndParams(Msg);
WmSysCommandProcess := WinProcess;
WinProcess := False;
end;
WM_SYSKEYDOWN:
begin
UpdateUIState(Word(WParam));
DoMsgSysKey(CN_SYSKEYDOWN);
Result := 0;
IgnoreNextCharWindow := Window;
end;
WM_SYSKEYUP:
begin
DoMsgSysKey(CN_SYSKEYUP);
Result := 0;
end;
WM_TIMER: SetLMessageAndParams(LM_TIMER);
WM_WINDOWPOSCHANGING:
begin
with TLMWindowPosMsg(LMessage) Do
begin
Msg := LM_WINDOWPOSCHANGING;
Unused := WParam;
WindowPos := PWindowPos(LParam);
end;
end;
WM_WINDOWPOSCHANGED:
begin
with TLMWindowPosMsg(LMessage) Do
begin
Msg := LM_WINDOWPOSCHANGED;
Unused := WParam;
WindowPos := PWindowPos(LParam);
end;
// cross-interface compatible: complete invalidate on resize
if (PWindowPos(LParam)^.flags and SWP_NOSIZE) = 0 then
Windows.InvalidateRect(Window, nil, True);
end;
WM_MEASUREITEM: DoMsgMeasureItem;
WM_SETTINGCHANGE: Application.IntfSettingsChange;
WM_THEMECHANGED:
// winxp theme changed, recheck whether themes are enabled
if Window = Win32WidgetSet.AppHandle then
begin
ThemeServices.UpdateThemes;
Graphics.UpdateHandleObjects;
ThemeServices.IntfDoOnThemeChange;
end;
WM_UPDATEUISTATE:
if ThemeServices.ThemesEnabled then
InvalidateRect(Window, nil, True);
{ >= WM_USER }
WM_LCL_SOCK_ASYNC:
begin
if (Window = Win32WidgetSet.AppHandle) and
Assigned(Win32WidgetSet.FOnAsyncSocketMsg) then
Exit(Win32WidgetSet.FOnAsyncSocketMsg(WParam, LParam))
end;
WM_IME_COMPOSITION,
WM_IME_COMPOSITIONFULL,
WM_IME_CONTROL,
//WM_IME_ENDCOMPOSITION,
WM_IME_NOTIFY,
WM_IME_REQUEST,
WM_IME_SELECT,
WM_IME_SETCONTEXT,
WM_IME_STARTCOMPOSITION:
SetLMessageAndParams(Msg, True);
WM_ACTIVATEAPP:
begin
if (Application<>nil) and Application.MainFormOnTaskBar and not Win32WidgetSet.AppMinimizing then
RestorePopups;
end;
WM_DISPLAYCHANGE:
begin
if Application.MainFormHandle = Window then
Screen.UpdateMonitors;
end;
else
// pass along user defined messages
if Msg >= WM_USER then
SetLMessageAndParams(Msg, True);
end; // case Msg of
if WinProcess then
begin
PLMsg^.Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
WinProcess := False;
end;
case Msg of
WM_ACTIVATEAPP: DoMsgActivateApp;
WM_MOVE: if DoMsgMove then Exit(0);
WM_SIZE: DoMsgSize;
BM_SETCHECK:
begin
//LParam holds BST_CHECKED, BST_UNCHECKED or SKIP_LMCHANGE;
if LParam <> SKIP_LMCHANGE then
LMessage.Msg := LM_CHANGED;
if lWinControl is TRadioButton then
begin
//Uncheck siblings
if WParam = BST_CHECKED then
ClearSiblingRadioButtons(TRadioButton(lWinControl));
end;
end;
WM_ENDSESSION:
begin
if Assigned(Application) and (Win32WidgetSet.AppHandle = Window) and
(WParam > 0) then
begin
// look at WM_QUERYENDSESSION about LParam
LMessage.Msg := LM_NULL; // no need to go through delivermessage
Application.IntfEndSession();
LMessage.Result := 0;
end;
end;
WM_QUERYENDSESSION:
begin
if Assigned(Application) and (Win32WidgetSet.AppHandle = Window) then
begin
LMessage.Msg := LM_NULL; // no need to go through delivermessage
CancelEndSession := LMessage.Result=0;
// it is possible to pass whether user LogOff or Shutdonw through a flag
// but seems there is no way to do this in a cross-platform way =>
// skip it for now
Application.IntfQueryEndSession(CancelEndSession);
if CancelEndSession
then LMessage.Result := 0
else LMessage.Result := 1;
end;
end;
WM_NCPAINT:
begin
if TWin32ThemeServices(ThemeServices).ThemesEnabled and
(lWinControl is TCustomControl) and not (lWinControl is TCustomForm) then
begin
TWin32ThemeServices(ThemeServices).PaintBorder(lWinControl, True);
LMessage.Result := 0;
end;
end;
end; // case Msg of
// convert from win32 client to lcl client pos.
//
// hack to prevent GetLCLClientBoundsOffset from changing mouse client
// coordinates for TScrollingWinControls, this is required in
// IsControlMouseMsg and ControlAtPos where unscrolled client coordinates
// are expected.
if (PLMsg = @LMMouseMove) and not (lWinControl is TScrollingWinControl) then
begin
if GetLCLClientBoundsOffset(lWinControl, R) then
begin
Dec(LMMouseMove.XPos, R.Left);
Dec(LMMouseMove.YPos, R.Top);
end;
end else
if (PLMsg = @LMMouse) and not (lWinControl is TScrollingWinControl) then
begin
if GetLCLClientBoundsOffset(lWinControl, R) then
begin
Dec(LMMouse.XPos, R.Left);
Dec(LMMouse.YPos, R.Top);
end;
end;
// application processing
if NotifyUserInput then
begin
CurrentWindow := Window;
NotifyApplicationUserInput(lWinControl, PLMsg^.Msg);
// Invalidate associated lWinControl if current window has been destroyed
if CurrentWindow = 0 then
lWinControl := nil;
end;
if Assigned(lWinControl) and (PLMsg^.Msg <> LM_NULL) then
DeliverMessage(lWinControl, PLMsg^);
// respond to result of LCL handling the message
case PLMsg^.Msg of
LM_ERASEBKGND, LM_SETCURSOR, LM_RBUTTONUP, LM_CONTEXTMENU:
if PLMsg^.Result = 0 then
WinProcess := True;
WM_SYSCOMMAND:
WinProcess := WmSysCommandProcess;
CN_CHAR, CN_SYSCHAR:
begin
// if key not yet processed, let windows process it
WinProcess := LMChar.Result = 0;
// if charcode was modified by LCL, convert ansi char
// to unicode char, if not change was made WParam has
// the right unicode char so just use it.
if (LMChar.Result = 1) or (OrgCharCode <> LMChar.CharCode) then
WParam := Word(WideChar(LMChar.CharCode));
end;
CN_KEYDOWN, CN_KEYUP, CN_SYSKEYDOWN, CN_SYSKEYUP:
begin
// if key not yet processed, let windows process it
WinProcess := LMKey.Result = 0;
WParam := LMKey.CharCode;
end;
WM_IME_COMPOSITION,
WM_IME_COMPOSITIONFULL,
WM_IME_CONTROL,
WM_IME_ENDCOMPOSITION,
WM_IME_NOTIFY,
WM_IME_REQUEST,
WM_IME_SELECT,
WM_IME_SETCONTEXT,
WM_IME_STARTCOMPOSITION:
begin
WinProcess := LMessage.Result = 0;
end;
else
case Msg of
{$ifndef RedirectDestroyMessages}
WM_NCDESTROY:
begin
// free our own data associated with window
if DisposeWindowInfo(Window) then
WindowInfo := nil;
EnumProps(Window, @PropEnumProc);
end;
{$endif}
end;
end;
if WinProcess then
begin
if ((Msg=WM_CHAR) and ((WParam=VK_RETURN) or (WPARAM=VK_ESCAPE)) and
((lWinControl is TCustomCombobox) or
((lWinControl is TCustomEdit) and not (lWinControl is TCustomMemo ))
))
or (Msg=WM_SYSCHAR) // Windows message processing is postponed
then
// this thing will beep, don't call defaultWindowProc
else
PLMsg^.Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
case Msg of
WM_CHAR, WM_KEYDOWN, WM_KEYUP,
WM_SYSCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP:
begin
PLMsg^.Result := 0;
case Msg of
WM_CHAR:
begin
// if want chars, then handled already
PLMsg^.Result := CallDefaultWindowProc(Window, WM_GETDLGCODE, 0, 0) and DLGC_WANTCHARS;
SetLMCharData(LM_CHAR);
end;
WM_SYSCHAR: SetLMCharData(LM_SYSCHAR);
WM_KEYDOWN: SetLMKeyData(LM_KEYDOWN);
WM_KEYUP: SetLMKeyData(LM_KEYUP);
WM_SYSKEYDOWN: SetLMKeyData(LM_SYSKEYDOWN);
WM_SYSKEYUP: SetLMKeyData(LM_SYSKEYUP);
end;
case Msg of
WM_CHAR, WM_SYSCHAR:
CharCodeNotEmpty := (LMChar.CharCode<>0);
else
CharCodeNotEmpty := (LMKey.CharCode<>0);
end;
// we cannot tell for sure windows didn't want the key
// for WM_CHAR check WM_GETDLGCODE/DLGC_WANTCHARS
// winapi too inconsistent about return value
if (lWinControl <> nil) and (PLMsg^.Result = 0) and CharCodeNotEmpty then
DeliverMessage(lWinControl, PLMsg^);
// Windows message processing for WM_SYSCHAR not processed (will get WM_MENUCHAR)
if (Msg=WM_SYSCHAR) and (PLMsg^.Result = 0) and CharCodeNotEmpty then
PLMsg^.Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
// handle Ctrl-A for edit controls
if (PLMsg^.Result = 0) and (Msg = WM_KEYDOWN) and (WParam = Ord('A'))
and (GetKeyState(VK_CONTROL) < 0) and (GetKeyState(VK_MENU) >= 0) then
begin
if WndClassName(Window) = EditClsName then
Windows.SendMessage(Window, EM_SETSEL, 0, -1); // select all
end;
end;
end;
end;
// ignore WM_(SYS)CHAR message if LCL handled WM_(SYS)KEYDOWN
if ((Msg = WM_KEYDOWN) or (Msg = WM_SYSKEYDOWN)) then
if (PLMsg^.Result = 0) then
IgnoreNextCharWindow := 0;
{ LMInsertText has no Result field }
if PLMsg = @LMScroll then Result := LMScroll.Result
else if PLMsg = @LMKey then Result := LMKey.Result
else if PLMsg = @LMChar then Result := LMChar.Result
else if PLMsg = @LMMouse then Result := LMMouse.Result
else if PLMsg = @LMMouseMove then Result := LMMouseMove.Result
else if PLMsg = @LMMove then Result := LMMove.Result
else if PLMsg = @LMNotify then Result := LMNotify.Result
else if PLMsg = @LMMouseEvent then Result := LMMouseEvent.Result
else Result := PLMsg^.Result;
end;
vitaly_l писал(а):Нет в LCL моего кода.
vitaly_l писал(а): Но вы станете седыми когда увидите её длину, а номер строки указывает на название функции:
Лекс Айрин писал(а):Программа-то твоя.
Лекс Айрин писал(а):не видишь правильного места ошибки. Данная функция дно программы.
vitaly_l писал(а):Ещё раз говорю - сбой наблюдается и в самом лазарусе, без моей программы.
vitaly_l писал(а):А где не дно?
Лекс Айрин писал(а):Строки 1-31.
Лекс Айрин писал(а):проверка на недопустимые данные идет в созданном тобой обработчике
vitaly_l писал(а):Я никаких обработчиков не создавал.
vitaly_l писал(а): И тогда на 10 или 100 раз можно получить exception. Моего кода или обработчика тут нет.
vitaly_l писал(а):Но это воспроизводится только с графическим планшетом.
Лекс Айрин писал(а):его клинит при попытке обработать данную ситуацию.
vitaly_l писал(а):при клике на кнопку, иногда - отправляет данные от мышки, а там сила нажатия естественно равна nil,
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 18