3

Is there any way I can handle the WM_NCHITTEST message in the window procedure such that the mouse will "fall through" to the next application below?

Right now I draw a custom shadow decoration in a transparent area of my application window. When I mouse over the shadow, which should be "outside the application window", it is still intercepting the mouse from the window below.

I've tried sending HTNOWHERE and HTTRANSPARENT

vbyzjnlehi
  • 307
  • 2
  • 15
  • I don't know the answer to this, but perhaps you could hack the functionality you seek. When you detect a click on the show decoration in your JavaFX application, hide the shadow so the JavaFX window is resized to its size without the shadow, use a [robot to issue a new click at the same location](https://openjfx.io/javadoc/16/javafx.graphics/javafx/scene/robot/Robot.html#mouseClick(javafx.scene.input.MouseButton...)) (the new click should now be routed to the underlying window from another application). Show the shadow again. If it were me, I would try that over low-level jna processing. – jewelsea Aug 27 '21 at 21:11
  • I tried my suggested solution, it is less than ideal, at least on a Mac, because when you try to use the robot to send an event, the OS pops up a dialog "Your app name" would like to control this computer using accessibility features, then asks to go to System Preferences to enable that. For Windows, the behavior may be more acceptable, I don't know. Also synching event replay with shadow hide/show and trying to manually map the events which JavaFX receives to events to issue via the robot is tricky as there is not a one-to-one correspondence. – jewelsea Aug 27 '21 at 21:59

0 Answers0