Sign in to follow this  
Followers 0
vishu

Problem with Start Button in my Application

4 posts in this topic

#1 ·  Posted (edited)

Hi All,

Am new to this forum, but long time since I have been relying on this forum for my questions and for sure have found the answers at ease in this forum.

This time am stuck up with an issue. I have a script which creates a GUI and upon clicking start button execution starts once execution starts other button press is not being recognized even though I have declared "Opt("GUIOnEventMode",1)" , but much to my surprise all the buttons presses are recognized before pressing the start buttons but after pressing the same the other buttons are not recognized(Ex: I have Exit,Pause buttons in my App)

Pl Guide me.

Thanks to one and All.

My special thanks to AutoIt Admins for hosting such a wonder full site :-)

Note: Am attaching my Script for your reference too.

Cheers,

Vishu

Script.au3

Edited by vishu

Share this post


Link to post
Share on other sites



Hi All,

Am new to this forum, but long time since I have been relying on this forum for my questions and for sure have found the answers at ease in this forum.

This time am stuck up with an issue. I have a script which creates a GUI and upon clicking start button execution starts once execution starts other button press is not being recognized even though I have declared "Opt("GUIOnEventMode",1)" , but much to my surprise all the buttons presses are recognized before pressing the start buttons but after pressing the same the other buttons are not recognized(Ex: I have Exit,Pause buttons in my App)

Pl Guide me.

Thanks to one and All.

My special thanks to AutoIt Admins for hosting such a wonder full site :-)

Note: Am attaching my Script for your reference too.

Cheers,

Vishu

The description sounded familiar, and sure enough, I found the problem without even reading your script. I saw "GuiOnEventMode" at the top, and then search for any instance of GuiGetMsg()... bingo!

Once you enable "GuiOnEventMode", GuiGetMsg() cannot be used at all, and will only return 0. It's all-or-nothing. If you want to use events (which I prefer myself), use events for everything.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Hi PsaltyDS,

Wow that was amazing you excatly pinpoint the problem that was too good I could understand the conflict between GuiOnEventMode and GuiGetMsg().

But I have one doubt is their any alternative way wherein I could use any othe command other than GuiGetMsg().along with GuiOnEventMode. If so pl let me know it would be great.

Thanks once again PsaltyDS.

Cheers,

Vishu

Share this post


Link to post
Share on other sites

...is their any alternative way wherein I could use any othe command other than GuiGetMsg().along with GuiOnEventMode.

Say what? I didn't understand the question, but in general you have a choice to either code the entire script to use GuiGetMsg() loop, or code the entire script to use event mode for everything.

There are technically ways to try and play them both or switch between modes on the fly, but that's unnecessarily complicated and nobody would want to do that. If you haven't figured out how to get either method working by itself, you certainly aren't ready to try an absurdly complicated mixing of them.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0