AustrianOak Posted July 31, 2008 Share Posted July 31, 2008 How can I script in my code a way to respond with a certain action if the tray icon was double clicked? Example, if user double clicks the tray a msgbox() will come up.. Link to comment Share on other sites More sharing options...
Paulie Posted July 31, 2008 Share Posted July 31, 2008 How can I script in my code a way to respond with a certain action if the tray icon was double clicked? Example, if user double clicks the tray a msgbox() will come up.. While 1 Tooltip("Double Click On the tray icon!!", 0,0) Switch TrayGetMsg() Case $TRAY_EVENT_PRIMARYDOUBLE Msgbox(0,"","You win!") EndSwitch WEnd Link to comment Share on other sites More sharing options...
AustrianOak Posted July 31, 2008 Author Share Posted July 31, 2008 says variable used without being declared while pointing to $TRAY_EVENT_PRIMARYDOUBLE Link to comment Share on other sites More sharing options...
Paulie Posted July 31, 2008 Share Posted July 31, 2008 (edited) #include <Constants.au3> Opt("TrayAutoPause",0) While 1 Tooltip("Double Click On the tray icon!!", 0,0) Switch TrayGetMsg() Case $TRAY_EVENT_PRIMARYDOUBLE Msgbox(0,"","You win!") EndSwitch WEnd Ever think of cracking open that dusty ol' helpfile and looking at "TrayGetMsg()"? If you had, You would have seen that include line in the example at the bottom. Edited July 31, 2008 by Paulie Link to comment Share on other sites More sharing options...
AustrianOak Posted July 31, 2008 Author Share Posted July 31, 2008 (edited) It doesn't work. All it does is pauses the script...Ever think of cracking open that dusty ol' helpfile and looking at "TrayGetMsg()"?If you had, You would have seen that include line in the example at the bottom. mellow.gifIt doesn't say to include anything. I'm probably running a different version than you. Edited July 31, 2008 by IWantIt Link to comment Share on other sites More sharing options...
Paulie Posted July 31, 2008 Share Posted July 31, 2008 Sigh... try this exact script, apparently you aren't in the mood to do any problem solving on your own. #include <Constants.au3> Opt("TrayAutoPause", 0) While 1 ToolTip("Double Click On the tray icon!!", 0, 0) Switch TrayGetMsg() Case $TRAY_EVENT_PRIMARYDOUBLE MsgBox(0, "", "You win!") EndSwitch WEnd Link to comment Share on other sites More sharing options...
AustrianOak Posted July 31, 2008 Author Share Posted July 31, 2008 Sigh... closedeyes.gif try this exact scriptDon't need to. Using a better method than what you suggested by doing a simple TraySetOnEvent.apparently you aren't in the mood to do any problem solving on your own.Apparently I am Link to comment Share on other sites More sharing options...
Paulie Posted July 31, 2008 Share Posted July 31, 2008 (edited) Don't need to. Using a better method than what you suggested by doing a simple TraySetOnEvent.Apparently I am Don't you " " at me. You obviously were not in a mood to do any problem solving, as I gave you a script that should have more than effectively pointed you in the right direction, but instead of debugging it on your own, you insisted on replying with multiple posts that could be basically summed up to say, "It doesn't work exactly as you posted it, make it work because i'm too lazy to do it myself."And saying that "TraySetOnEvent" is better than "TrayGetMsg" is the equivalent of saying "GuiSetOnEvent" is better than "GuiGetMsg." Both of which are not only wrong but just plain stupid.Most people learn to create GUIs(and consequently, TrayMenus) using GuiGetMsg(), not OnEventMode. Because you didn't post any damn code to indicate how your script was organized, I had no indication as to whether you even knew what OnEventMode was. So i replied with the method that is generally easier to understand.However, I'm glad my being poignant motivated you to do some damn legwork by yourself. Maybe you should try that BEFORE you create a thread next time. Edited July 31, 2008 by Paulie Link to comment Share on other sites More sharing options...
AustrianOak Posted July 31, 2008 Author Share Posted July 31, 2008 Poor Paulie. He's throwing a tantrum at me. Is it because you can't find your heart song? Poor little fellow... Listen dude, don't tell me what and what not throw at you. I'm not going to sit here and argue with a kid who's like 10 and get's his happiness of the day by coming to cyber world instead of facing reality. I didn't say TraySetOnEvent was better than TrayGetMsg(). I said it was better than what you suggested, and obviously it was. Because guess what? It worked, yours didn't. Link to comment Share on other sites More sharing options...
Vindicator209 Posted July 31, 2008 Share Posted July 31, 2008 His example would have helped you learn to use autoit better, even if it wasn't as "easy" for you to understand. but it doesn't make it "bad", the script he gave you was fine, he left out a line which could have easily been replaced if you did any research on your own.And if anything, paulie's like autoit elite, so I wouldn't bother fighting with him over a topic like this. So if you want to learn autoit YOU should quit acting like a child and solve your problems maturely. Anyway, I figure I minds well make this a useful post;The autoit helpfile is located in the autoit directory, or from your start menu, there you can find EVERYTHING you can possibly need to know to write a script. Once you have created SOMETHING, and run into a problem you really really can't solve, THEN post here, with your script, so that we may pinpoint the problem and help you.Cheers! [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
AustrianOak Posted July 31, 2008 Author Share Posted July 31, 2008 And if anything, paulie's like autoit elite, so I wouldn't bother fighting with him over a topic like this.That's why he so prideful and has a big attitude. Because people like you pump him up and suck up to him. I'm not disrespecting him, I'm just making a statement.Anyway, I figure I minds well make this a useful post;The autoit helpfile is located in the autoit directory, or from your start menu, there you can find EVERYTHING you can possibly need to know to write a script. Once you have created SOMETHING, and run into a problem you really really can't solve, THEN post here, with your script, so that we may pinpoint the problem and help you.Well that didn't make that a useful post anymore than what we're arguing about. I did come here on a last notice. Link to comment Share on other sites More sharing options...
TehWhale Posted July 31, 2008 Share Posted July 31, 2008 That's why he so prideful and has a big attitude. Because people like you pump him up and suck up to him. I'm not disrespecting him, I'm just making a statement.Well that didn't make that a useful post anymore than what we're arguing about. I did come here on a last notice.Paulie's post worked. It just takes some common sense to maybe add a small include at the top? It appears your disrespecting one of the coolest coders on here. If you would have just taken Paul's post, and added some common sense, or looked at the helpfile, you wouldn't be having this arguement. Apparently you didn't come here on a last notice. If you saw some nice code, and then checked the helpfile, you could of said: "Thanks Paulie!". Link to comment Share on other sites More sharing options...
Paulie Posted July 31, 2008 Share Posted July 31, 2008 (edited) Poor Paulie. He's throwing a tantrum at me. Is it because you can't find your heart song? Poor little fellow...Listen dude, don't tell me what and what not throw at you. I'm not going to sit here and argue with a kid who's like 10 and get's his happiness of the day by coming to cyber world instead of facing reality.I didn't say TraySetOnEvent was better than TrayGetMsg(). I said it was better than what you suggested, and obviously it was. Because guess what? It worked, yours didn't. See, what's funny is, I came into this thread with nothing but the intent to help you. And this is my return? Just goes to show the kind of person you really are. Personally, I would prefer to see you take your rude, disrespectful, and ungrateful attitude elsewhere. To be honest, you are lucky I'm not a moderator... because in my book, AutoIt doesn't need users like you. But until then, Welcome to my ignore list. Asshole. EDIT: You don't deserve a smiley. Edited July 31, 2008 by Paulie Link to comment Share on other sites More sharing options...
AustrianOak Posted July 31, 2008 Author Share Posted July 31, 2008 Ok Mr. 10 year old. If I'm going to be on your ignore list, I want to be at the top. Link to comment Share on other sites More sharing options...
TehWhale Posted July 31, 2008 Share Posted July 31, 2008 Ok Mr. 10 year old. If I'm going to be on your ignore list, I want to be at the top.Sorry, I'm pretty sure that spot is already taken by other noobs like you. Paulie isn't 10 either. Link to comment Share on other sites More sharing options...
Vindicator209 Posted July 31, 2008 Share Posted July 31, 2008 That's why he so prideful and has a big attitude. Because people like you pump him up and suck up to him. I'm not sucking up to him, hes had alot of experience, and has helped alot of people. That is a statement. Calling people ten year olds and what not for no apparent reason is not. Seeing as this thread isin't going anywhere, you can either actually accept people's help with respect and good intent, or continue to post pointless posts. However, seeing as your problem is resolved already, don't post here until you need more help on this topic. EDIT: You don't deserve a smiley. LOL [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now