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.
- 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.
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.