API - Launch SolidWorks from VB6 with Maximized window...

Jun 30, 2004 4 Replies

Hello to all,



I'm developping an application for SolidWorks 2004 under VB6. It works fine, except that I need to launch SolidWorks (if it's not already open) using:



Set swApp = CreateObject("SldWorks.Application") swApp.Visible (True) swApp.UserControl (True)



Trouble is, when SolidWorks starts, the window is not maximised... therefore, all my icons are screwed up (doh!).



Is there a way to force SolidWorks to open maximised? Also, for my knowledge, is it possible to control the window position and size when it is not maximised?



Since this application will be used on many computers, I'm very likely to get lynched if I don't correct this...



Thank you for your help!


FontaineGuy


AFAIK, no.

YES. In fact you should maximize the window once SW is open.

1) use SldWorks:Frame, then Frame.GetHWnd APIs to obtain a "HWnd" (Handle of a Windows window...) of SolidWorks 2) use code from
formatting link
to maximize it.

Tell me if it works... I didn't try but it should/must work.

Thanks for the info!

It may be a week until I have time to work again on my application, but when I do I will definitely tell you the results.

Fontaine Guy.

"Philippe Guglielmetti" a écrit dans le message de news:40e39ee7$0$26644$ snipped-for-privacy@news.sunrise.ch...

Some one asket the same question in Solidworks-API on yahoo you can edit the registry to maximize on startup I tried it using RegEdit.

My Computer\HKEY_CURRENT_USER\Software\Solidworks 2004\User

Interface\Settings

If you set it to the value below it seems the 2 in the front specifies whether the window is maximized or normal 2 is maximized 1 is normal and 0 should be minimized but I don't think windows lets you open a program minimized. The last two numbers control the size of the window and the two before that I believe control the location of the window but I am not certain. I don't know about the rest of them.

2,1,-1,-1,-1,-1,460,380,776,624

I have never had the need to directly edit the registry programmatically so I can't help you.

Corey

Saw the similar post on the yahoo group, and didnt reply because of your same concerns: ShowWindow is only reliable up to Win98, you need more O/S specific calls for reliably doing it on newer o/s'es.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required