LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure for inactive window


@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:
  • 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 

0 Kudos
Message 21 of 27
(168 Views)

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:

 

button.gif

 

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.

0 Kudos
Message 22 of 27
(136 Views)

@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 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 23 of 27
(112 Views)

Here is a gif version.

small LV click.gif

 

 

In the video you posted are you using the original VI or the one with user32.dll call? 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 24 of 27
(67 Views)

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 😕

Message 25 of 27
(57 Views)

@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. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 26 of 27
(51 Views)

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.)

Message 27 of 27
(44 Views)