赞助

VC++ 禁止WebBrowser网页跳转时发出的声音和禁止网页上的文字被选择

转载:http://blog.csdn.net/cometnet/article/details/51082091

 

 1 #include <urlmon.h>
 2 #ifndef FEATURE_DISABLE_NAVIGATION_SOUNDS
 3 #define FEATURE_DISABLE_NAVIGATION_SOUNDS 21
 4 #endif
 5 #ifndef SET_FEATURE_ON_PROCESS
 6 #define SET_FEATURE_ON_PROCESS 0x00000002
 7 #endif
 8 
 9 void DisableClickSounds()  
10 {  
11     CoInternetSetFeatureEnabled((INTERNETFEATURELIST)FEATURE_DISABLE_NAVIGATION_SOUNDS,SET_FEATURE_ON_PROCESS,true);  
12 } 

 2.禁止网页上的文字被选择

转载:http://www.cnblogs.com/tingchen/archive/2013/10/08/web%E6%8B%BE%E9%81%97%E5%BD%95.html

 1 <html>
 2     <head>
 3         <style type="text/css">
 4             body{-moz-user-select:none}
 5         </style>
 6     </head>
 7 
 8 <body onselectstart="return false;">
 9     this is a test!
10 </body>
11 </html>

 

posted @ 2016-07-27 18:10  车臣  阅读(300)  评论(0编辑  收藏  举报