MenuGroups in Zero Document State

Discussion in 'AutoCAD' started by Maksim Sestic, Jan 23, 2004.

  1. Is there a way to kill ACAD's default menu for zero document state and
    replace it with my own menugroup via VBA (or whatever)?

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jan 23, 2004
    #1
  2. Maksim Sestic

    Ed Jobe Guest

    No. The programming environments are associated with the drawings. Thus when
    there are no drawings loaded, there is no way to do any customization. The
    0doc menu, is hard coded and is not accessible for customization.
     
    Ed Jobe, Jan 23, 2004
    #2
  3. That's what I expected. Anyway, I'm grabbing the BeginClose event of a
    document last being closed (application.documents.count = 1), ask if user
    wants to save data and then launch a dialog with my predefined set of
    options.

    Thanks,
    Maksim Sestic
     
    Maksim Sestic, Jan 24, 2004
    #3
  4. Do as you may, but I don't regard that as acceptable behavior.

    If I have two or more documents open, and none of them
    have been modified, then when I click on the "X" button
    on the AutoCAD main window to close the application, I
    want AutoCAD to close.... period... no questions asked.
     
    Tony Tanzillo, Jan 24, 2004
    #4
  5. Here's how it goes: I have my own project management system, but users
    doesn't have to use it (they may work with single drawings as they do in
    plain ACAD). This is one problem. The other is that I had to rewrite
    majority of menu UI as there's no ACAD localization for my native language.
    And then, imagine one non-english speaking user close the only active
    drawing and see unrecognizable zero-document-state menu ("File, Window,
    Help...").

    On the other hand, what I do is initially launching ACAD through an EXE file
    that asks the user if he/she wants to "Open new drawing", "Open new
    project", etc. just before ACAD main window pops up (it's there, but it's
    invisible). Then the EXE calls my DVB macros, depending on users choice, and
    kills itself. I wanted to implement the same startup dialog in zero-document
    state. As there's no EndClose event for the document object, I'm done with
    my zero-doc-state approach (alas). One of the solutions was to shut down the
    ACAD as user closes the last active drawing, which is overkill to me. The
    other valid solution is to let the EXE running through the complete
    life-cycle of ACAD session and deal with zero-doc state for itself...
    killing itself when the connection to the server is lost (ACAD shut down or
    some standard :) fatal error occured).

    This is what bothers me lately, but, thanks to this group therapy - I'm
    feeling better now :)

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jan 25, 2004
    #5
  6. Believe it or not, I localized complete Autodesk Land Development Desktop R2
    via ResHacker (the market I'm developing sw for seems too uninteresting for
    Autodesk). Then Autodesk released a new version of LDD and I felt sick for a
    month :) The applications I'm writing now have one thing in common - they
    do not interfere with original Autodesk platform settings/resources. My EXE
    launches ACAD and generates necessary profiles, menus, toolbars, etc. When
    it gets shut down it cleans up everything behind, and when the user runs
    standard ACAD (say, via Desktop shortcut) - he sees just what he sees when
    there was no my application installed onto the computer. The only viable
    solution is to develop my own ResHacker (which I tried, to be honest) that
    will do resource hacking when my EXE gets started.

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jan 27, 2004
    #6
  7. If you want to localize on the fly (at least menu labels),
    you can do that without altering resources. You just modify
    the loaded menus on the fly by using Windows API functions
    (see SetMenuItemInfo(), GetMenu(), etc.).
     
    Tony Tanzillo, Jan 27, 2004
    #7
  8. Good tip, I'll try to implement suggested API calls with little help of
    Spy++ application from VisualStudio...
     
    Maksim Sestic, Jan 27, 2004
    #8
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.