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
09-03-2025 09:50 AM
Here is a gif version.
In the video you posted are you using the original VI or the one with user32.dll call?
09-03-2025 10:23 AM - edited 09-03-2025 10:27 AM
Just the original one with the Event structure in it.
Edit: I deleted my LabVIEW.ini file and tried again (to let it autogenerate a "blank" one) and I have the same behavior; it DOES detect click-through. So perhaps I have a registry setting that's changed somehow? I haven't done a clean Windows install in a few years, so there's a chance I changed something in the registry or altered a program somewhere that's modifying my system's behavior. Sorry to not be much help 😕
09-03-2025 11:06 AM
@BertMcMahan wrote:
Just the original one with the Event structure in it.
Edit: I deleted my LabVIEW.ini file and tried again (to let it autogenerate a "blank" one) and I have the same behavior; it DOES detect click-through. So perhaps I have a registry setting that's changed somehow? I haven't done a clean Windows install in a few years, so there's a chance I changed something in the registry or altered a program somewhere that's modifying my system's behavior. Sorry to not be much help 😕
Thanks for checking, I don't think it is a general windows reg setting as other applications on my system allow click-through, just not for LabVIEW. It makes me think there is a LabVIEW setting somewhere that is in control of this behavior.
09-03-2025 11:15 AM
Try renaming your labview.ini file to labview.ini.jay (as a backup) and let it regenerate the ini file, and see if it resets things. Once you try the default ini values you can delete the autogenerated one and delete the .jay to get your old settings back.
(Don't forget to be out of LabVIEW before you rename it- I think the ini file will be written when you close LabVIEW, so if you rename your ini file before closing LabVIEW then it'll just get regenerated to your current settings- not a clean slate. I think.)