VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Double Mouse pointer issue

1 REPLY 1
Reply
Message 1 of 2
CanonShooter
238 Views, 1 Reply

Double Mouse pointer issue

I run a program I wrote inside AutoCAD 2007 that uses a few VB forms. When I close the program, I am left with the typical AutoCAD crosshairs AND the system Mouse Pointer. No errors, just two pointers.

The AutoCAD crosshairs do NOT move, like AutoCAD does not have the focus. If I hit the ESC key, or click the mouse, the "system" mouse pointer goes away.

What am I missing when I close the application ot return to AutoCAD?
1 REPLY 1
Message 2 of 2
arcticad
in reply to: CanonShooter

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function SetActiveWindow Lib "user32" (ByVal hWnd As Long) As Long


Sub SwitchFocus()
Dim AcadHandle As Long
Dim FormHandle As Long
Dim acadApp As AcadApplication
Dim WindowReturn As Long
Set acadApp = GetObject(, "AutoCAD.Application")
AcadHandle = FindWindow(vbNullString, acadApp.Caption)
WindowReturn = SetActiveWindow(AcadHandle)
End Sub
---------------------------



(defun botsbuildbots() (botsbuildbots))

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost