|
|||
|
Hey Everybody ;
Please help me to disable the Prt Sc button on the keyboard , cause I don't want to allow users to take a print screen of my project .. if it's not possible please tell me how can I destroy the clipboard when the user press the Prt Sc button ? or even I want to know how can I handle the copying event . thank you for your help regards . |
|
|||
|
Please insert the following code into the "initialize" script in swfkit pro, before "return true"
Code:
dllimport "user32.dll" stdcall Boolean RegisterHotKey(long, int, unsigned int, unsigned int);
dllimport "user32.dll" stdcall Boolean UnregisterHotKey(long, int);
var IDHOT_SNAPDESKTOP = -2;
var IDHOT_SNAPWINDOW = -1;
var MOD_ALT = 0x0001;
var VK_SNAPSHOT = 0x2c;
var wnd = getMainWnd();
// disable the print screen key
RegisterHotKey(wnd.handle, IDHOT_SNAPDESKTOP, 0, VK_SNAPSHOT);
// disable the alt + printscrn key combine
RegisterHotKey(wnd.handle, IDHOT_SNAPWINDOW, MOD_ALT, VK_SNAPSHOT);
wnd.onClose = function () {
UnregisterHotKey(wnd.handle, IDHOT_SNAPDESKTOP);
UnregisterHotKey(wnd.handle, IDHOT_SNAPWINDOW);
}
|
|
|||
|
Wow that's realy great . :-* :-* :-*
Thank you swfkit evry very very much for your help and for your quick reply .. Now I have a silly question :-[ Can I handle keyboard events using this script ? Regard |
|
|||
|
No, the above code just overrides the default system action of the printscrn key - the code makes system does nothing when the key is pressed. If you want to handle keyboard events, please use the following ffish script code:
Code:
FlashPlayer.window.onMessage = function (msg, wparam, lparam) {
if (msg == /*WM_CHAR*/0x0102) {
var ch = String.fromCharCode(wparam);
trace(ch);
// do somethind with ch
...
}
}
|
|
|||
|
Code:
FlashPlayer.window.onMessage = function (msg, wparam, lparam) {
if (msg == /*WM_CHAR*/0x0102) {
var ch = String.fromCharCode(wparam);
trace(ch);
} else if (msg == /*WM_KEYDOWN*/0x100) {
var key = wparam;
trace(key);
/* key codes can be found at
http://www.actionscript.org/forums/a...3/t-77405.html
*/
}
}
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|