Modeless forms loosing mouse pointer

Modeless forms loosing mouse pointer

Anonymous
Not applicable
307 Views
2 Replies
Message 1 of 3

Modeless forms loosing mouse pointer

Anonymous
Not applicable
I have a modeless form (with the AcFocusCtrl). There is a button on the form that hides it and calls any of the Utility.Getxx functions. When I'm finished with picking whatever is requested - the form is displayed but the cursor is "gone" - I have to move my mouse over the form or any of the Autocad toolbars/menubars etc to "repaint" it. This means that as long as it virtually stays (I guess it's position) over the black editor area - it is invisible. When I move it over some form/menu/bar etc - it is redrawn to the standard arrow.

Do I have to mention it's driving me crazy ...
I searched everywhere and found nothing, pls help !

my setup: WinXP Pro, Autocad 2006, VBA
0 Likes
308 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
As soon as your call to GetXxxxx() returns, do this:

PostMessage(ThisDrawing.HWND, 32, 0, 0);

You need to import the PostMessage API to do this.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com

wrote in message news:4894477@discussion.autodesk.com...
I have a modeless form (with the AcFocusCtrl). There is a button on the form that hides it and calls any of the Utility.Getxx
functions. When I'm finished with picking whatever is requested - the form is displayed but the cursor is "gone" - I have to move
my mouse over the form or any of the Autocad toolbars/menubars etc to "repaint" it. This means that as long as it virtually stays (I
guess it's position) over the black editor area - it is invisible. When I move it over some form/menu/bar etc - it is redrawn to the
standard arrow.

Do I have to mention it's driving me crazy ...
I searched everywhere and found nothing, pls help !

my setup: WinXP Pro, Autocad 2006, VBA
0 Likes
Message 3 of 3

Anonymous
Not applicable
That certainly does the job. Thanks a lot !

for the rest, this is how to declare the PostMessage function:

Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

and then just before form.Show insert this
PostMessage ThisDrawing.hWnd, 32, 0, 0

(or after any getxx function if you dont hide your form)

32 is the decimal value for WM_SETCURSOR
- The WM_SETCURSOR message is sent to a window if the mouse causes the cursor to move within a window and mouse input is not captured.

EOT 😄
0 Likes