Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Contributor
schesser
Posts: 11
Registered: ‎01-23-2004
Message 1 of 3 (119 Views)

VB6 form in AutoCAD 2005 inaccessible when SDI=0 and TASKBAR=1

119 Views, 2 Replies
07-06-2006 08:20 AM
Hello, all.
I am having a problem showing a VB6 form modally in AutoCAD 2005, when SDI=0, TASKBAR=1 and there are multiple drawings open. The problem is that the form does not display on the screen: it flashes briefly, then AutoCAD will not respond. If AutoCAD is the only program running, the user can use Alt+Tab to cycle through the AutoCAD windows until he/she reaches the VB6 form. However, if any other program is running, Alt+Tab does not cycle through the AutoCAD windows, so AutoCAD appears to remain locked up. The only way I have found to fix this is for the user to close all other programs, then use Alt+Tab.

I have tried to check the value of the system variable TASKBAR, but AutoLISP getvar returns nil, and VBA GetVariable produces an "Error getting system variable" error.

Does anyone know of a good solution for this? Any help will be appreciated.
Stephanie Chesser
Distinguished Contributor
pciganek
Posts: 285
Registered: ‎01-08-2004
Message 2 of 3 (119 Views)

Re: VB6 form in AutoCAD 2005 inaccessible when SDI=0 and TASKBAR=1

07-07-2006 12:29 AM in reply to: schesser
Stephanie -

You can get the Taskbar value from ...FixedProfile\General\Taskbar in the registry:

(defun f:taskbar ()
(vl-load-com)
(vl-registry-read
(strcat "HKEY_CURRENT_USER\\" (vlax-product-key) "\\FixedProfile\\General")
"Taskbar"
)
)

- the value in the registry seems to update when using the taskbar command only on exiting the application. (Acad2006 on XP Professional)

Unfortunately, I don't have a clue how to deal with the form display problem (bug?) - but I do use a number of vb6 forms in my functions so I guess I'll force the program to taskbar = 0 mode before calling the form. You can set the taskbar value with the command - i.e. (command "_.taskbar" 0).

I hope that some of the more advanced vb programmers on this forum will be able to come up with a more satisfactory solution.

-see also ng topic:

http://discussion.autodesk.com/thread.jspa?messageID=3994530


Regards,

Peter
Contributor
schesser
Posts: 11
Registered: ‎01-23-2004
Message 3 of 3 (119 Views)

Re: VB6 form in AutoCAD 2005 inaccessible when SDI=0 and TASKBAR=1

07-10-2006 11:57 AM in reply to: schesser
Hi, Peter
Thanks for the info. I am now using your f:taskbar function to check the value of the TASKBAR system variable, then using command to set its value. Initial testing looks like this will work most of the time. (Once, I still had the problem, even though I could see in the command line that TASKBAR had been set to 0.) I am hoping it will work consistently.

Using SetWindowPos as suggested in the other topic actually had an adverse effect: the form did not appear and I could not use Alt+Tab to bring it into focus!

Thanks again, and any further suggestions would be appreciated.

Stephanie Chesser
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.