From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

SetMouseCursor not working

Hello -

 

I'm trying to use SetMouseCursor to switch to VAL_HOUR_GLASS_CURSOR during a file processing operation that takes a few seconds. For some reason, the cursor appearance never changes from the default cursor. The operation is initiated by a button "commit" event, and the callback looks something like this:

 

int CVICALLBACK buttonCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
    switch (event)
    {
        case EVENT_COMMIT:
            SetMouseCursor(VAL_HOUR_GLASS_CURSOR);

            // Do the file processing here...
            SetMouseCursor(VAL_DEFAULT_CURSOR);
            break;
    }
    return 0;
}

 

I've also tried using SetPanelAttribute(panel, ATTR_MOUSE_CURSOR, ...) with the same results. The callback definitely executes, as the file processing works as expected - I just don't see the cursor change for some reason.

 

I'm using LabWindows CVI 2012 SP1, running under Windows 7. Thanks in advance!

 

Barry Wealand

 

0 Kudos
Message 1 of 4
(4,316 Views)
Can you try SetWaitCursor(1) and SetWaitCursor(0) first?
If that does not work try calling ProcessDrawEvents() after changing the cursor.
S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 4
(4,313 Views)

SetWaitCursor() seems to work fine. Thanks for the assist!  --Barry

 

0 Kudos
Message 3 of 4
(4,309 Views)

Great..! Nice to hear it worked.

Do not forget to mark the post as accepted solution.
Have a nice day 😉

S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 4
(4,307 Views)