Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
Reply
Message 1 of 3
schesser
317 Views, 2 Replies

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

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
2 REPLIES 2
Message 2 of 3
pciganek
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
Message 3 of 3
schesser
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

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

Post to forums  

Autodesk Design & Make Report

”Boost