WMSetCursor lazarus / 7-LCL ---------------------------------------------------------------------- tk · 2009-08-05 08:49 Hi, I am porting a control to Lazarus that uses several own mouse cursors. Here I found another major incompatibility with VCL. I don't want to put these to Screen.Cursors because there is no unique way to dynamically determine the first empty index for new cursors both in Delphi and Lazarus. Not only because of that I believe WMSetCursor should give the possibility to set cursor directly via WidgetSet.SetCursor as it was always meant in Delphi and should not be beaten by some non-overridable Upda]"]>BlockeduseCursor method in TControl class that is called from WMMouseMove. For custom cursors used only by components this is IMHO required. ---------------------------------------------------------------------- Marc · 2009-08-05 09:26 the problem is that cursor handing of windows is very different than other widgetsets. Using WMSetCursor is something you really don't want to simulate on those widgetsets. Therefore using WidgetSet.Setcursor should be avoided. You still can use screen.cursors, since the first empty index is 1 (all default cursors have a index <= 0) ---------------------------------------------------------------------- tk · 2009-08-05 10:23 This is the problem as there is no unique way how to determine if Screen.Cursors[1] is empty or not. ---------------------------------------------------------------------- tk · 2009-08-05 17:49 I solved this issue first with a tiny LCL modification (introduced TControl.WMSetcursor+some adds) and then better with win32callback.WindowProc subclassing. The control stays Windows only anyway. I think WMSetcursor effect (ability to use Windows.Setcursor) should not be beaten at least on the Windows target. If anybody is interested in this modification I can send the LCL sources (L. 0.9.26.2beta). ---------------------------------------------------------------------- Martin_fr · 2009-08-05 21:13 You may want to upgrade to the latest SVN or Snapshot, if you haven't. There is a modification, in that SetCursor on windows now acts immediately and not only on the next mouse move. The other thing is (but I do not know how guaranteed this is to be kept like this): At current the cursor is set from within TCONTROL__WMMOUSEMOVE calling TCONTROL__UPDA]"]>BlockedUSECURSOR calling TWINCONTROL__SETTEMPCURSOR SetTempcursor is virtual, so you can overwrite it. as for the WMsetMouse message, if your are on windows. If your control returns crDefault you may get an LM_SETMOUSE message, which you can capture ---------------------------------------------------------------------- tk · 2009-08-06 07:40 Thx. There is a stuff (HandleSetCursor) in win32callback.inc that is making problems here - with subclassing it can be solved now generally.