LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Attempting to work around the button pressed but mouse held until released over another control bug.

References:

A similar issue 

The function the above uses.

Used this function too

 

The problem:

I have a button Show, that on button press, I want to unhide text in an "Edit string" (much like you might see with an eye for a password).  The functionality of what I want is show the real value while the button is pressed, when released, obscure it again.

 

My attempts:

 

1) I answer the event EVENT_LEFT_CLICK to set the text to the real value.  For any event other than WM_MOUSEACTIVATE or WM_NCMOUSEMOVE (or the equivalent from NI) I am (if my expose flag is set) putting my obscure text string back in the blank.

 

This works as long as the button is released OVER the button.  Realizing that I'd need to check for EVENT_LEFT_CLICK_UP in all of the other panels, which I did (always checking the flag before resetting the string).  This works mostly.  If the button is released OUSTIDE the main program window, I do not get the notification even with EnableExtendedMouseEvents() set.  This will also work if I release the button after moving the mouse down into an empty location.  Moving up, left, or right puts me over another control.  For some reason, I get no other notification from the Show control after that mouse move (is this an NI bug?).

 

2) Okay, not to be beaten by a silly little button, I next attempted to go down a level to the Windows level and snag messages from there.  So, I next did a

 

InstallWinMsgCallback(gPanel, WM_NCMOUSELEAVE, wm_msg_handler, VAL_MODE_INTERCEPT, NULL, &postHandle);

My handler has just a MessagePopup() in it to let me know that I got the event.

 

gPanel is the handle for the main app window.  I also registered this handler for every main window.

 

I never get a message to this handler.  Nothing.  I have tried additional messages to attempt to find SOMETHING that might help me to catch the bad clicking, but alas, I cannot.

 

System info:

 

LabWindows CVI version 17.0.

OS:  Windows 10.

 

I do not have an example application with this to post as I cannot take the time to do it.

 

My other option is to sprinkle code that will do what I need throughout all of the event handlers to obscure the text at a later time to protect the data in the Edit string.

 

Thanks in advance for any help that you may be able to provide,

Andy

 

 

0 Kudos
Message 1 of 2
(1,034 Views)

Maybe a better more simple question:  I see that, even with the mouse button held down, when the mouse leaves the area of the button, it releases -- that is, it is getting a lost focus message and consuming it.  Do I have access to the code that does that, or is that an internal-to-Windows handled event?

0 Kudos
Message 2 of 2
(992 Views)