08-30-2025 08:54 AM
@Andrey_Dmitriev wrote:
@mcduff wrote:
. What other conditions, considerations are needed? A quick test showed that the call to the DLL worked. Am I corrupting the memory?I mean these:
The system restricts which processes can set the foreground window. A process can set the foreground window by calling SetForegroundWindow only if:
- All of the following conditions are true:
- The calling process belongs to a desktop application, not a UWP app or a Windows Store app designed for Windows 8 or 8.1.
- The foreground process has not disabled calls to SetForegroundWindow by a previous call to the LockSetForegroundWindow function.
- The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
- No menus are active.
- Additionally, at least one of the following conditions is true:
- The calling process is the foreground process.
- The calling process was started by the foreground process.
- There is currently no foreground window, and thus no foreground process.
- The calling process received the last input event.
- Either the foreground process or the calling process is being debugged.
For me (LV2025 Q3 x64 v.25.3.2f2 on Win11 LTSC 24H2 v.26100.4946) SetForegroundWindow doesn't work, the FP window was not brought to the foreground, and the return value is zero (and yesterday evening I was too lazy to check it why exactly).
That’s a lot to check. Thanks
09-01-2025 10:46 AM
Could you clarify the behavior you're looking for and not seeing? From your post it sounds like if the screen isn't active, you don't get the "mouse down" event, but that's not what I'm seeing:
When I put the focus back on the forum window, the Mouse in Button indicator works, and when I click it from outside of that window, I get the "mouse down" light coming up.
For what it's worth I'm on LV23, 64-bit in Windows 11. I may have changed a setting at some point.in Windows or my LabVIEW INI file to change from default behavior.
Or perhaps I'm misunderstanding the question.
09-02-2025 02:34 PM
@BertMcMahan wrote:
Could you clarify the behavior you're looking for and not seeing? From your post it sounds like if the screen isn't active, you don't get the "mouse down" event, but that's not what I'm seeing:
...
It must be either a setting or a LV version thing. In LV2021 I don't get "click through" as you are demonstrating in your video, see attached video