Aassdd Posted January 26, 2008 Share Posted January 26, 2008 (edited) When I press F12 it doesn't execute the commands after the until line. #NoTrayIcon #include <Misc.au3> $wait = InputBox("Image pop-up", "Seconds:", "", "", Default, 125) * 1000 $img_name = InputBox("Image pop-up", "Image name:", "", "", Default, 125) $img_loc = (@ScriptDir & "\" & $img_name) Sleep($wait) BlockInput(1) MouseMove(@DesktopWidth, @DesktopHeight, 1) SplashImageOn("", $img_loc, @DesktopWidth, @DesktopHeight, 0, 0, 1) Do Sleep(100) Until _IsPressed("7B") SplashOff() BlockInput(0) Exit EDIT: Maybe because the keyboard is blocked? How can I make it work? Edited January 26, 2008 by Aassdd Link to comment Share on other sites More sharing options...
Danp2 Posted January 26, 2008 Share Posted January 26, 2008 Isn't 7B the code for "{"? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Aassdd Posted January 26, 2008 Author Share Posted January 26, 2008 No, http://msdn2.microsoft.com/en-us/library/ms645540.aspx.Anyone? Link to comment Share on other sites More sharing options...
Danp2 Posted January 26, 2008 Share Posted January 26, 2008 OIC. Further testing shows that it does work, but sporadically at times. Was going to suggest that you try HotKeySet, but help file states that F12 is reserved by Windows. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Aassdd Posted January 26, 2008 Author Share Posted January 26, 2008 (edited) I don't care if it's F12 or not. It can be any F key. I have tried with hotkeyset but it didn't work. I have to go now. If someone make it work and post it here I would be grateful. Edited January 26, 2008 by Aassdd Link to comment Share on other sites More sharing options...
Danp2 Posted January 26, 2008 Share Posted January 26, 2008 The issue is that you've blocked all input using BlockInput(1), so the _IsPressed() will never register. Not sure how to accomplish this, but the help file states that Ctrl+Alt+Del will re-enable input. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Aassdd Posted January 26, 2008 Author Share Posted January 26, 2008 (edited) Yes but I don't want ctrl-alt-del. If we forget the F key, how can I continue executing commands when input is re-enabled (ctrl-alt-del)? Edited January 26, 2008 by Aassdd Link to comment Share on other sites More sharing options...
Squirrely1 Posted January 26, 2008 Share Posted January 26, 2008 Yes but I don't want ctrl-alt-del. If we forget the F key, how can I continue executing commands when input is re-enabled (ctrl-alt-del)?We got your code man: #NoTrayIcon #include <Misc.au3> HotKeySet("{F9}", "Finish_Up") $wait = InputBox("Image pop-up", "Seconds:", "", "", Default, 125) * 1000 $img_name = InputBox("Image pop-up", "Image name:", "", "", Default, 125) $img_loc = (@ScriptDir & "\" & $img_name) Sleep($wait) ;BlockInput(1) MouseMove(@DesktopWidth, @DesktopHeight, 1) SplashImageOn("", $img_loc, @DesktopWidth, @DesktopHeight, 0, 0, 1) While 1 Sleep(80) WEnd Func Finish_Up() SplashOff() ;BlockInput(0) Exit EndFunc You need an error handler for your InputBox 's. Why is it - more precisely - you want to block user input ? Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
Aassdd Posted January 26, 2008 Author Share Posted January 26, 2008 (edited) I don't care about errors because it's for personal use and I want blockinput.If I comment out those 2 lines it wont work.(i'm making a prank) Edited January 26, 2008 by Aassdd Link to comment Share on other sites More sharing options...
Squirrely1 Posted January 26, 2008 Share Posted January 26, 2008 (edited) All you can do in your script once your script can only be affected by Ctrl-Alt-Del, is to terminate execution of the script at the line it is on, silly! Here is your whole prank, then: #NoTrayIcon #include <Misc.au3> $wait = InputBox("Image pop-up", "Seconds:", "", "", Default, 125) * 1000 $img_name = InputBox("Image pop-up", "Image name:", "", "", Default, 125) $img_loc = (@ScriptDir & "\" & $img_name) Sleep($wait) BlockInput(1) MouseMove(@DesktopWidth, @DesktopHeight, 1) SplashImageOn("", $img_loc, @DesktopWidth, @DesktopHeight, 0, 0, 1) While 1 Sleep(80) WEnd Once the script is terminated, the SplashImage thing will be gone, and input control be returned to the user. I don't see why you need the include file Misc.au3 ... And won't you please make an error handler for the InputBox 's ? What is supposed to happen if the user clicks Cancel on that second InputBox ? Edited January 26, 2008 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
Aassdd Posted January 26, 2008 Author Share Posted January 26, 2008 I dont need the a f* error handler, and misc.au3 is used for _IsPressed. Thanks, i'll try it later. Link to comment Share on other sites More sharing options...
Squirrely1 Posted January 26, 2008 Share Posted January 26, 2008 I dont need the a f* error handler, and misc.au3 is used for _IsPressed._IsPressed can never work while all user input is blocked by BlockInput ...I want the world to go right.The world always does what I tell it to do.I always tell the world to go left.Is there a flaw in my logic? Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
weaponx Posted January 27, 2008 Share Posted January 27, 2008 You can't use Blockinput() and expect _IsPressed() to work. What part isn't clear? Link to comment Share on other sites More sharing options...
The Kandie Man Posted January 27, 2008 Share Posted January 27, 2008 (edited) You can't use Blockinput() and expect _IsPressed() to work. What part isn't clear?<--------------He hasn't seen my avatar yet.- The Kandie Man ;-) Edited January 27, 2008 by The Kandie Man "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
Aassdd Posted January 27, 2008 Author Share Posted January 27, 2008 (edited) [] I UNDERSTAND THAT NO KEY CAN BE PRESSED BUT HOW CAN I CONTINUE EXECUTING COMMANDS AFTER PRESSING CTRL-ALT-DEL [/ ] EDIT: @The Kandie Man - you have that sig for 2 years. Edited January 27, 2008 by Aassdd Link to comment Share on other sites More sharing options...
BrettF Posted January 27, 2008 Share Posted January 27, 2008 [] I UNDERSTAND THAT NO KEY CAN BE PRESSED BUT HOW CAN I CONTINUE EXECUTING COMMANDS AFTER PRESSING CTRL-ALT-DEL [/ ] EDIT: @The Kandie Man - you have that sig for 2 years.mate. Take a few minutes to calm down, then come back and ask nicely. Then you will get a valid response. Maybe. Personally, because you are creating a prank, I wouldn't help. Just personal preference there. Just how I feel. Now you gonna take 10 now? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Squirrely1 Posted January 27, 2008 Share Posted January 27, 2008 (edited) [] I UNDERSTAND THAT NO KEY CAN BE PRESSED BUT HOW CAN I CONTINUE EXECUTING COMMANDS AFTER PRESSING CTRL-ALT-DEL [/ ]So far, we at the forums have you as an angry prankster. We don't know whose computer you want to mess with. How do we know that you aren't working for our government and need closer supervision while you work on a government computer? Anyway, pressing Ctrl-Alt-Del does not have much to do with your program. The only thing it will do on modern Windows systems is to bring up a legacy program called the task manager, which is a useful program for when all else fails. You have that one last way to terminate a rouge process, which is what you have successfully created. The answer to your question is to not depend on the task manager, unless you want to be more of a rouge. Otherwise, to quote Valik, "Whatever you are on, please list it so we know to stay off it." Edited January 27, 2008 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
Aassdd Posted January 27, 2008 Author Share Posted January 27, 2008 #NoTrayIcon $wait = InputBox("Image pop-up", "Seconds:", "", "", Default, 125) * 1000 $img_name = InputBox("Image pop-up", "Image name:", "", "", Default, 125) $img_loc = (@ScriptDir & "\" & $img_name) Sleep($wait) BlockInput(1) MouseMove(@DesktopWidth, @DesktopHeight, 1) SplashImageOn("", $img_loc, @DesktopWidth, @DesktopHeight, 0, 0, 1) Do Sleep(100) Until WinExists("Windows Task Manager") = 1 WinClose("Windows Task Manager") SplashOff() BlockInput(0) Exit Link to comment Share on other sites More sharing options...
Squirrely1 Posted January 27, 2008 Share Posted January 27, 2008 (edited) Well okay - so there is a way. Sometimes I guess you just have to get mad at it to get something done. The trick is, getting mad without throwing your monitor out the window, slamming your mouse down against the table, or getting arrested. Edited January 27, 2008 by Squirrely1 Das Häschen benutzt Radar 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