Jump to content

Sorry for no title


Aassdd
 Share

Recommended Posts

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 by Aassdd
Link to comment
Share on other sites

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 by Aassdd
Link to comment
Share on other sites

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 ? :D

Das Häschen benutzt Radar

Link to comment
Share on other sites

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! :D

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 by Squirrely1

Das Häschen benutzt Radar

Link to comment
Share on other sites

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? :D

Das Häschen benutzt Radar

Link to comment
Share on other sites

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 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

[:angry:] I UNDERSTAND THAT NO KEY CAN BE PRESSED BUT HOW CAN I CONTINUE EXECUTING COMMANDS AFTER PRESSING CTRL-ALT-DEL [/ :angry:]

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?
Link to comment
Share on other sites

[:angry:] I UNDERSTAND THAT NO KEY CAN BE PRESSED BUT HOW CAN I CONTINUE EXECUTING COMMANDS AFTER PRESSING CTRL-ALT-DEL [/ :angry:]

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 by Squirrely1

Das Häschen benutzt Radar

Link to comment
Share on other sites

#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

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 by Squirrely1

Das Häschen benutzt Radar

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...