/ Forums / Advansys Formativ / Creating Solutions with Formativ / How to shut down GroupWise?

  • Creator
    Topic
  • #4226
    dgerisch
    Participant

      I’m modifying the Conditions of Use Applet, and would like to have Formativ cause the GroupWise Client to exit, should the user click “I disagree” when presented with the conditions of use terms.

      I don’t know what command would order GroupWise to exit.

      if not IsPolicyAccepted() then
      GroupWise. <— what should go here?
      end if

      Thanks!

    • Author
      Replies
    • #7541
      dgerisch
      Participant

        In theory, I found it. In practice, I’m still missing something.

        ‘ Exit GroupWise if the policy not accepted by the user
        if not IsPolicyAccepted() then
        Groupwise.AppAllowClose(Yes!)
        GroupWise.AppClose()
        end if

        I get an error on the Groupwise.AppAllowClose(Yes!) line.

        #7545
        dgerisch
        Participant

          By dinking around, I found that the proper syntax for AppAllowClose is just a one or a zero.

          Problem is, the code still does not work.

          GroupWise.AppAllowClose(0)
          GroupWise.AppClose()

          or

          GroupWise.AppAllowClose(1)
          GroupWise.AppClose()

          produces no discernable action (except that GroupWise.AppAllowClose(0) turns off the Exit option under the File menu.

          #7546
          Support 2
          Moderator

            From past experience, attempting to close GroupWise from a C3PO (i.e. Formativ) either did not work or resulted in unpredictable behavior. It is not recommended.

            What are trying to achieve?

            Regards,

            Advansys Support

            #7544
            Support 3
            Participant

              In theory, you can use the Windows Script Host to sends one or more keystrokes (close window) to the active window. You should be able to find some sample code in web about the Sendkeys method.

              We don’t know the impact of the SendKeys method or closing the GroupWise from C3PO. Please be aware of unpredictable behavior.

              Hope this helps.

              Regards,
              Advansys Support

              #7540
              Support 3
              Participant

                Hi dgerisch,

                While replying to your last post, accidently we have deleted your last posting. We’re extremely sorry for this inconvenience.

                Regards,
                Advansys Support

                #7542
                dgerisch
                Participant

                  Trying another way to shut down the GroupWise client, should a user decline the Acceptable Use Policy.

                  I have written a program which closes the GroupWise client – all I need now is a method to launch it when the user declines the AUP.

                  GroupWise.RunProgram(“CloseGW.exe”,””)

                  I hate this, because it is kludgy. But if I can get it to work, it will be better than admitting I just can’t get the job done.

                  Would have thought this would do it, except I get “Cannot use parentheses when calling a Sub at line… (specifies end of statement)”

                  How do I get this method to go?

                  Thank you.

                  #7543
                  Support 3
                  Participant

                    Use the keyword call to execute a method with parentheses. See below an example:

                    call groupwise.RunProgram(Executable, Parameters)  
                    

                    I haven’t heard any executable program called “CloseGW.exe”. Do you have any additional information about this EXE (i.e folder location)?

                    As I said earlier, you can use Windows Script Host to sends one or more keystrokes to the active window. One of the keystrokes you can send is close window. The example below should close the current window. You need to make sure when executing the code only GroupWise window is active. Once again we don’t know the impact of the SendKeys method or closing the GroupWise from C3PO so be aware of unpredictable behavior.

                    Set oShell = CreateObject("WScript.Shell")
                    oShell.Sendkeys "%{F4}"
                    set oShell = nothing
                    

                    Hope this helps.

                    Regards,
                    Advansys Support

                    #7538
                    dgerisch
                    Participant

                      Thank you very much for both pieces of advice.

                      “CloseGW.exe” is just a WinBatch I wrote myself. I’m not fond of that idea because it means I either have to run a shared .exe off a file server, -or- copy the freakin’ .exe to 1700 workstations. Yuck.

                      The example from the Windows Script Host worked great on my particular machine. I’ll try deploying it to the 60 people here in IT to see if it causes anyone any particular grief before deploying it wider.

                      Yes, you’ve been very helpful. Thank you.

                      #7539
                      Support 3
                      Participant

                        Thanks for your comments.

                        Regards,
                        Advansys Support

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