Change Visio's Mouse Cursor from C#

Started by Visio Guy, October 31, 2011, 05:31:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visio Guy

Anybody know if there is a (hack, I assume) to change the mouse cursor for Visio? There are plenty of mouse events, but nothing for the cursor. I'm guessing it is something that would have to be set often as Visio would continue to "take over", or done via Windows somehow, but I can't find anything via search.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Paul Herber

#1
No hack involved, I just use standard Windows API stuff:


var
  Save_Cursor: TCursor;
begin
    Save_Cursor := Screen.Cursor;
    Screen.Cursor := crHourGlass;
    ... stuff
    Screen.Cursor := Save_Cursor;
end;


P.S. this is Delphi, C# will be very similar.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Visio Guy

Thanks Paul, will give it a shot and report back!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Visio Guy

Well, now the question is: Does C# have something equivalent to Delphi's TScreen object? I've found nothing so far.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

Jumpy

If I remember correctly (Had C# in school only for a half year) every(?) component, has a cursor object. So there has to be a cursor class somewhere. I'd look for that.

Visio Guy

The .net stuff only applies cursors to components, ie: windows, buttons, text boxes, etc. Visio is none of these, unfortunately.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010