Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-26-2007, 04:56 AM
Junior Member
 
Join Date: Jun 2005
Posts: 22
Default How can I disable PrintScreen Btn ?

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 .
Reply With Quote
  #2 (permalink)  
Old 05-26-2007, 06:04 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:How can I disable PrintScreen Btn ?

Yes, there is a way to disable the print screen key. However, even if you have disabled it, your project still can be copied by any other screen capture programs.
Reply With Quote
  #3 (permalink)  
Old 05-26-2007, 06:37 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:How can I disable PrintScreen Btn ?

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);
}
Reply With Quote
  #4 (permalink)  
Old 05-26-2007, 10:05 AM
Junior Member
 
Join Date: Jun 2005
Posts: 22
Default Re:How can I disable PrintScreen Btn ?

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
Reply With Quote
  #5 (permalink)  
Old 05-26-2007, 11:43 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:How can I disable PrintScreen Btn ?

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
...
}
}
Reply With Quote
  #6 (permalink)  
Old 05-27-2007, 09:53 AM
Junior Member
 
Join Date: Jun 2005
Posts: 22
Default Re:How can I disable PrintScreen Btn ?

I like your product ..


Thank you :-*
Reply With Quote
  #7 (permalink)  
Old 05-27-2007, 10:34 AM
Junior Member
 
Join Date: Jun 2005
Posts: 22
Default Re:How can I disable PrintScreen Btn ?

Another question please ;

Your script is handles only the letters and numbers keys but not other keys such as F1 , F2 , F10 ..

How can I handle them ?

Thanks again .
Reply With Quote
  #8 (permalink)  
Old 05-28-2007, 05:34 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:How can I disable PrintScreen Btn ?

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

   }
}
Reply With Quote
  #9 (permalink)  
Old 05-28-2007, 05:48 AM
Junior Member
 
Join Date: Jun 2005
Posts: 22
Default Re:How can I disable PrintScreen Btn ?

Thank you for your help .

best wishes
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:20 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.