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

Discussion in 'SolidWorks' started by Fontaine Guy, Jun 30, 2004.

  1. Fontaine Guy

    Fontaine Guy Guest

    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
     
    Fontaine Guy, Jun 30, 2004
    #1
  2. 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 http://support.microsoft.com/?kbid=210090 to maximize it.

    Tell me if it works... I didn't try but it should/must work.
     
    Philippe Guglielmetti, Jul 1, 2004
    #2
  3. Fontaine Guy

    Fontaine Guy Guest

    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.
     
    Fontaine Guy, Jul 1, 2004
    #3
  4. 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
     
    Corey Scheich, Jul 1, 2004
    #4
  5. Fontaine Guy

    rocheey Guest

    1) use SldWorks:Frame, then Frame.GetHWnd APIs to obtain a "HWnd" (Handle of


    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.
     
    rocheey, Jul 1, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.