Announcement

Collapse
No announcement yet.

Prevent Dialogs to close when ESC key is pressed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Prevent Dialogs to close when ESC key is pressed

    Hello, I'm trying to prevent the dialog to close when the ESC key is pressed. Is it possible?

    Code:
    if e_Key == 27 then
        return false;
    end

  • #2
    Hi gutierrez107
    Try this, works for me.
    Dialog Disable ESC.apz

    Comment


    • #3
      Hey MrBryza thanks for reply!

      Take a look in this:

      Code:
      function QueryAllowDialogClose(strDialogName)
          result= Dialog.Message("Close Dialog", "Are you sure that you want to close the dialog?", MB_YESNO, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
          --if they choose yes
          if result == IDYES then
              --allow the dialog to close
              return true; 
          else
              --cancel close
              return false;
          end
      end

      Comment


      • #4
        here a working example


        Code:
        [ATTACH]n303863[/ATTACH]

        Comment


        • #5
          complete ......


          Code:
          [ATTACH]n303865[/ATTACH]

          Comment


          • #6
            herrin works very well 🙌

            Comment


            • #7
              Hey guys I'm using the Global Function QueryAllowDialogClose() to prevent to close the dialog. However, how to navigate between 3 dialogs?

              Code:
              function QueryAllowDialogClose()
                  return false;
              end

              Comment


              • #8
                ...............................example


                Code:
                [ATTACH]n303874[/ATTACH]

                Comment


                • #9
                  Hi herrin, thanks for reply! Unfortunately when add the global function QueryAllowDialogClose() your idea doesn't work :/

                  Comment


                  • #10
                    Code:
                    function QueryAllowDialogClose()
                    return false;
                    end


                    the script works very well, the problem is that you don't know what you're talking about .... before venturing into messy scripts you have to study and not a little.........


                    Click image for larger version

Name:	screen.PNG
Views:	146
Size:	91.5 KB
ID:	303877

                    You can open more than one dialog box at a time, but you cannot use more than one dialog box at a time without closing one, AMS does not support it.
                    You can also create a global variable for transferring data between dialog boxes or return a value after executing DialogEx.Close ()

                    my last help


                    Code:
                    [ATTACH]n303878[/ATTACH]

                    Comment


                    • #11
                      herrin your idea works very well with ESC button, but when we press ALT + F4 the dialog closes. So, I decided to use the function QueryAllowDialogClose. Anyway I really appreciate your help! Thank you very much!!!

                      Comment


                      • #12

                        repeat
                        the script works very well, the problem is that you don't know what you're talking about



                        an example is to make you understand how it works (then enter your code) ..........
                        but if you want to come to your home to define the project





                        Code:
                        [ATTACH]n303882[/ATTACH]

                        Comment

                        Working...
                        X