/ Forums / Advansys Formativ / Creating Solutions with Formativ / Close all open GW Windows except for GW Itself

  • Creator
    Topic
  • #4449
    tinymoth
    Participant

    Hi,

    We have a user that habitually opens mail after mail after mail without closing them that would like a Close All button.

    Can I iterate through the open GW windows with formativ and close all that don’t need an action?

    Closing and re-opening GW works, but takes about ten seconds before GW will start again.

    As an alternative, could I implement a reply-with-close button that closed a mail while opening a reply to type into?

    Thanks,
    Tim

  • Author
    Replies
  • #8201
    Support 3
    Participant

    quote:


    As an alternative, could I implement a reply-with-close button that closed a mail while opening a reply to type into?


    Following code will close the mail window. It make sure the mail window is opened. Incorrectly calling the “CloseWindow” can result closing the GroupWise client window.

     
      if (lcase(groupwise.EnvCurrentViewName) = "mail") then
        groupwise.CloseWindow()
      end if
     

    You can create a Formativ Applet with the code above:
    – Integrate the applet to Email – OnReply/OnForward event (In Formativ IDE, select the applet, select Integration tab)
    – Change the Applet execution direction (arrow symbol) to “Before GroupWise Event”, restart the GroupWise client.

    When the user press the reply/forward button then Applet will execute, it will close mail window if opened. If user press the reply/forward button from the message toolbar then Applet will close the message, however the draft message will not be closed.

    Hope this helps.

    Regards,
    Advansys Support

    #8205
    tinymoth
    Participant

    Thanks for that. I’ll have a go implementing the button.

    Is there a way to scan through all the open windows?

    Kind regards,
    Tim

    #8204
    Support 3
    Participant

    In Formativ Language guide, take a look at Utilities.FindWindow() method which returns the handle of an open window. Formativ wraps few common Windows function.

    I also suggest you to review available Windows API. If you unable call native API functions from VBScript/Applet then you could have your Applet to run a VB6/C#/etc executable that would call the APIs.

    Regards,
    Advansys Support

    #8203
    tinymoth
    Participant

    That’s something, perhaps, for a little further down the road 🙂

    Thanks,
    Tim

    #8202
    Support 3
    Participant

    Sure, make sense.

    Regards,
    Advansys Support

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.