Disable Print Screen? - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11) +--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2) +--- Thread: Disable Print Screen? (/showthread.php?tid=2257) Pages:
1
2
|
Disable Print Screen? - TerryRitchie - 12-15-2023 Does anyone have any ideas on how a QB64PE program can disable the print screen function when running? Ideally I would like to be able to hook the keyboard's PRINT SCREEN key to intercept keypresses while at the same time disabling the operating system from grabbing a screen shot. However, disabling the operating system's ability to perform screen shots while the program is running would be just as useful. Any thoughts, ideas? RE: Disable Print Screen? - TerryRitchie - 12-15-2023 One method I came up with was using _CLIPBOARDIMAGE to "poison the well" so to speak. Any program I write would need to write garbage to the clipboard periodically like the example below Code: (Select All) 'Poison the well RE: Disable Print Screen? - mnrvovrfc - 12-15-2023 (12-15-2023, 08:01 PM)TerryRitchie Wrote: However, disabling the operating system's ability to perform screen shots while the program is running would be just as useful. Many users expect to record entire videos of what they are doing in an operating system desktop session. With the big talk about the whole of Linux moving from "X-dot-org" to Wayland, it might become impossible to do what you are requesting. However, under Wayland it's already tough enough to record desktop sessions into video. Some people especially on Linux would not touch a program that disables [PRT SC] or any other key, would consider it spyware. If it comes directly from you this could affect your reputation as educator. An user could press the key without thinking much about it, or because he/she wants to show off to his/her friends on Facebook or wherever else online. If the program doesn't respond to some "system" keypress there better be a good reason why. But this might be the minority of the population using Windows anyway. It's bothersome that [CTRL][ALT][DEL] on Linux with GNOME desktop only opens the "shutdown" dialog. It does not reboot the computer, and it does not bring a dialog asking the user how to end the current desktop session. I would like to get a reason from the devs of AutoHotKey, besides "It's too hard!" why it has never been ported to Linux. There is an old version of AutoIt that somebody sort of fixed so it works on Linux reasonably, but it relies way too much on Python and it would probably be forbidden in Wayland session. RE: Disable Print Screen? - Steffan-68 - 12-15-2023 (12-15-2023, 09:11 PM)TerryRitchie Wrote: One method I came up with was using _CLIPBOARDIMAGE to "poison the well" so to speak. Any program I write would need to write garbage to the clipboard periodically like the example belowThis could also work under Windows. Code: (Select All)
But starting with Win 10, the clipboard can store more than one page. RE: Disable Print Screen? - SMcNeill - 12-15-2023 https://learn.microsoft.com/en-us/archive/msdn-magazine/2005/november/disabling-print-screen-calling-derived-destructors-and-more RE: Disable Print Screen? - SMcNeill - 12-15-2023 Code: (Select All) ////////////////// I think right there is what would be really relevant for you, but read the article itself, also. RE: Disable Print Screen? - TerryRitchie - 12-16-2023 (12-15-2023, 10:28 PM)Steffan-68 Wrote: But starting with Win 10, the clipboard can store more than one page.Yeah, I was wondering about that issue too. RE: Disable Print Screen? - TerryRitchie - 12-16-2023 (12-15-2023, 10:36 PM)SMcNeill Wrote:Thanks for the info Steve, I'll take a look. RE: Disable Print Screen? - SMcNeill - 12-24-2023 Finally having a little time to sit down and relax -- and try not to fall asleep with my stomach bursting with Christmas Eve Lunch -- I think I put the pieces together here for what you're looking for: Code: (Select All)
RE: Disable Print Screen? - SMcNeill - 12-24-2023 (That 1, I think is some sort of internal register that we first configure with the RegisterHotKey so that it represents Alt+Printscreen. It's why we use that same value with unregister so we unregister that combo of keystrokes from our program, with that singular value.) |