oageng Posted April 27, 2009 Posted April 27, 2009 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
KaFu Posted April 27, 2009 Posted April 27, 2009 HotKeySet("^!{PRINTSCREEN}", "DisablePrintScreen") OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
oageng Posted April 27, 2009 Author Posted April 27, 2009 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
Paulie Posted April 27, 2009 Posted April 27, 2009 Replace your loop with this While 1 Sleep(1000) WEnd
oageng Posted April 27, 2009 Author Posted April 27, 2009 Replace your loop with this While 1 Sleep(1000) WEnd Thank you very much
Bert Posted April 27, 2009 Posted April 27, 2009 You may want to change the sleep to sleep(10) to improve response time The Vollatran project My blog: http://www.vollysinterestingshit.com/
oageng Posted April 27, 2009 Author Posted April 27, 2009 Well it does wonders;but it does'nt block Ctrl+Shift+PrtScHow 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
KaFu Posted April 27, 2009 Posted April 27, 2009 Look in the help-file for keys used in send() command, those are the same for HotKeySet(). OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
oageng Posted April 27, 2009 Author Posted April 27, 2009 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
oageng Posted May 5, 2009 Author Posted May 5, 2009 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
lordicast Posted May 5, 2009 Posted May 5, 2009 Just curious why would you block printscreen? [Cheeky]Comment[/Cheeky]
oageng Posted May 5, 2009 Author Posted May 5, 2009 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
lordicast Posted May 5, 2009 Posted May 5, 2009 (edited) 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 May 5, 2009 by lordicast [Cheeky]Comment[/Cheeky]
Bert Posted May 5, 2009 Posted May 5, 2009 I looked, but I'm not sure on this. You could try to stop the print spooler and see if the printscreen still works. The Vollatran project My blog: http://www.vollysinterestingshit.com/
oageng Posted May 9, 2009 Author Posted May 9, 2009 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?
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