Jump to content
Sign in to follow this  
oageng

Set a Hotkey for Ctrl+Alt+PrtSc

Recommended Posts

oageng

I wanted to run a script compiled to .EXE that would disable Print Screen, and I came across this script:

.......................................................

Opt("TrayIconHide",1)

HotKeySet("{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("!{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("+{PRINTSCREEN}", "DisablePrintScreen")

While 1

WEnd

Func DisablePrintScreen()

EndFunc

........................................................

But this seems not to work for Ctrl+Alt+PrtSc. How do I set a Hotkey for Ctrl+Alt+PrtSc?

I'm not a programmer, but I do have some knowledge on prgramming. Please help, I need this

Share this post


Link to post
Share on other sites
KaFu
oageng

HotKeySet("^!{PRINTSCREEN}", "DisablePrintScreen")
Thanx very much in advance

But another problem of observation is that the script consumes a lot of CPU usage - about 100%. How can this script be optimized? to drop the CPU usage

Share this post


Link to post
Share on other sites
Paulie

Replace your loop with this

While 1
   Sleep(1000)
WEnd

Share this post


Link to post
Share on other sites
oageng

Replace your loop with this

While 1
   Sleep(1000)
WEnd

Thank you very much

Share this post


Link to post
Share on other sites
oageng

Well it does wonders;

but it does'nt block Ctrl+Shift+PrtSc

How do I do this? I hope I'm not asking too many questions!? I wish I could figure this out myself...

All I really want is to block all options or keyboard combinations for taking snapshots with PrtSc

Share this post


Link to post
Share on other sites
KaFu
oageng

Look in the help-file for keys used in send() command, those are the same for HotKeySet().

I looked at the help-file. Thank you very much I think I can just play around with these keys

Share this post


Link to post
Share on other sites
oageng

Hey the topics move really fast here!!

Thanks very much everyone for your help. Thank you KaFu

My code ended up like this:

Opt("TrayIconHide",1)


HotKeySet("{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("!{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("+{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("^{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("^!{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("^+{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("!+{PRINTSCREEN}", "DisablePrintScreen")

HotKeySet("^!+{PRINTSCREEN}", "DisablePrintScreen")


While 1
   Sleep(10)
WEnd

Func DisablePrintScreen()

EndFunc

It blocks all the combinations. I wonder if I did too much coding, may be unnecessary coding? Sometimes you can do less coding but still producing the same effect

I guess other people may benefit from this

Share this post


Link to post
Share on other sites
lordicast

Just curious why would you block printscreen?


[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites
oageng

Just curious why would you block printscreen?

I'm a Technician for an Education Institution. Students take the exam through an exam software, as in PrepLogic for example. I think the schools software was poorly written, so the students can take snapshots of the exams with printscreen and pass them around. Just circulate these questions. This has created a problem for a long time.

Now I think this will be no more since I was able to join the AutoIt community.

Thanx

Share this post


Link to post
Share on other sites
lordicast

Ah I see, if they smart they would insert a USB drive with a script that run commands in background and captures everything without the need of any keys.

If you are serious about this what you need to is go into safe mode get all the process that are needed. Then write a script to close any other .exe or process upon logon.

EDIT: Script Check

;example

If ProcessExists($NotOnList) then
ProcessClose($NotOnList)
EndIf

;Also check on disabling the Alt+Tab and Ctrl+Alt+ Del Functions
HotKeySet('!{tab}','Nothing')
;example 

If WinExists('Windows Task Manager') then
WinKill('Windows Task Manager')
EndIf

func nothing()
    MsgBox(0,'','Nothing')
EndFunc
Edited by lordicast

[Cheeky]Comment[/Cheeky]

Share this post


Link to post
Share on other sites
oageng

Ah I see, if they smart they would insert a USB drive with a script that run commands in background and captures everything without the need of any keys.

If you are serious about this what you need to is go into safe mode get all the process that are needed. Then write a script to close any other .exe or process upon logon.

EDIT: Script Check

;example

If ProcessExists($NotOnList) then
ProcessClose($NotOnList)
EndIf

;Also check on disabling the Alt+Tab and Ctrl+Alt+ Del Functions
HotKeySet('!{tab}','Nothing')
;example 

If WinExists('Windows Task Manager') then
WinKill('Windows Task Manager')
EndIf

func nothing()
    MsgBox(0,'','Nothing')
EndFunc

Hey its been a while. You are brilliant. I think this solution goes a long way

How do I create a list of processes and do the comparison of NotOnList? And weave the entire code with the existing disable printscreen?

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.