ihuxihy Posted August 2, 2022 Report Share Posted August 2, 2022 Hello, I want that my macro display several buttons like this : And if I clic "Action 1", variable %action% = "1". And if I clic "Action 2", variable %action% = "2". etc. But I see nothing in MexPro 4.9 to do this simple thing. MULTIPLE CHOICE MENU can do it but it need several clics, that's not simple. Thanks for help. Quote Link to comment Share on other sites More sharing options...
rberq Posted August 2, 2022 Report Share Posted August 2, 2022 1 hour ago, ihuxihy said: MULTIPLE CHOICE MENU can do it but it need several clics This worked when I tested it: Use the Multiple Choice Menu, and make your selection by clicking with the mouse. BEFORE displaying the multiple choice menu, call a macro that waits for you to click the mouse. As soon as you click your choice, the second macro will press the ENTER key to close the multiple choice menu. So you have to do only one click. Macro where choice is made: Macro Run: wait_for_choice Multiple Choice Menu: How many? Macro wait_for_choice: Wait for Left Mouse Click Delay: 250 milliseconds // delay so ENTER will not happen until multiple choice selection happens Text Type (Simulate Keystrokes): <ENTER> Macro Return 1 Quote Link to comment Share on other sites More sharing options...
ihuxihy Posted August 2, 2022 Author Report Share Posted August 2, 2022 Hello, That's a funny yet sad way, but I guess it will work, thank you. I'll try it after a siesta, I'm hurry ! Quote Link to comment Share on other sites More sharing options...
Cory Posted August 2, 2022 Report Share Posted August 2, 2022 MEP has no means of designing forms like you're wanting. Floyd long ago wrote this instructional on how to use an HTA to do something similar. HTAs (HTML Application) are essentially active web pages that run scripts. I have made small simple programs to be a form for MEP. It takes only a few minutes in .NET. I had an idea once on creating a program that would take input from MEP that would make a custom arrangement of some simply controls like text boxes, buttons, and the like. There was no interest expressed so I never pursued it. 1 Quote Link to comment Share on other sites More sharing options...
rberq Posted August 2, 2022 Report Share Posted August 2, 2022 4 hours ago, ihuxihy said: That's a funny yet sad way, but I guess it will work, thank you. I think of it as cute, not sad.😋 It is not an ideal solution, and you have to watch the timings, and consider what other applications might be running, and what other mouse clicking might be going on. But if you have a relatively stand-alone application, and a user who won't get flustered if the "wait" times out, it should work OK. 1 Quote Link to comment Share on other sites More sharing options...
Cory Posted August 2, 2022 Report Share Posted August 2, 2022 I don't have time to try this but I might have an idea. But it is a kluge. Open a Notepad with a unique window title and have the macro paste whatever options. Macro terminates. Have a second macro that is scoped to that window and takes and activation of left mouse click. When the mouse is clicked, get the mouse position. Then you could evaluate the mouse Y position to see which item they selected. Or I could write you a little program 🙂 1 Quote Link to comment Share on other sites More sharing options...
ihuxihy Posted August 3, 2022 Author Report Share Posted August 3, 2022 It works very fine, thank you ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.