.net的代碼真木有寫過。
創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設(shè),龍州企業(yè)網(wǎng)站建設(shè),龍州品牌網(wǎng)站建設(shè),網(wǎng)站定制,龍州網(wǎng)站建設(shè)報價,網(wǎng)絡(luò)營銷,網(wǎng)絡(luò)優(yōu)化,龍州網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
VB 可以屏蔽 包括ctrl+alt+del在內(nèi)的所有鍵盤按鍵消息
其實(shí)你只要后臺截獲按鍵的消息后,直接屏蔽掉就可以了。
VB代碼我有 net木有。
使用VB.net編寫屏蔽熱鍵的方法有很多中,比如說使用系統(tǒng)的API函數(shù),也可以使用鉤子來進(jìn)行屏蔽.還有一種就是.net帶的一種方法,首先來判斷所按下去的鍵,然后再執(zhí)行操作等事件.比如說:if (e.keycode==keys.D){e.handle=true}在keydown事件里面處理!這樣就可以屏蔽了D鍵. 實(shí)例:if ((Control.ModifierKeys == Keys.Alt) (e.KeyCode == Keys.F4))
{
e.Handled = true;
}還有一種辦法就是不通過屏蔽熱鍵來實(shí)現(xiàn),就是通過設(shè)置焦點(diǎn).你可以把你程序窗口設(shè)置為主焦點(diǎn),這樣其他程序一般就無法在你的程序前面了.實(shí)現(xiàn)屏蔽的作用.至于任務(wù)管理器的話可以通過殺掉進(jìn)程的辦法做到.如下: Process[] p = Process.GetProcesses(); foreach (Process p1 in p)
{
try
{
if (p1.ProcessName.ToLower().Trim() == "taskmgr")//這里判斷是任務(wù)管理器
{
p1.Kill();
return;
}
}
catch
{
return;
}
}}以上是使用C#編寫的,稍微改下就可以了,在,NET里面都差不多!
Syntax
HHOOK SetWindowsHookEx( int idHook,
HOOKPROC lpfn,
HINSTANCE hMod,
DWORD dwThreadId
);
Parameters
idHook
[in] Specifies the type of hook procedure to be installed. This parameter can be one of the following values.
WH_CALLWNDPROC
Installs a hook procedure that monitors messages before the system sends them to the destination window procedure. For more information, see the CallWndProc hook procedure.
WH_CALLWNDPROCRET
Installs a hook procedure that monitors messages after they have been processed by the destination window procedure. For more information, see the CallWndRetProc hook procedure.
WH_CBT
Installs a hook procedure that receives notifications useful to a computer-based training (CBT) application. For more information, see the CBTProc hook procedure.
WH_DEBUG
Installs a hook procedure useful for debugging other hook procedures. For more information, see the DebugProc hook procedure.
WH_FOREGROUNDIDLE
Installs a hook procedure that will be called when the application's foreground thread is about to become idle. This hook is useful for performing low priority tasks during idle time. For more information, see the ForegroundIdleProc hook procedure.
WH_GETMESSAGE
Installs a hook procedure that monitors messages posted to a message queue. For more information, see the GetMsgProc hook procedure.
WH_JOURNALPLAYBACK
Installs a hook procedure that posts messages previously recorded by a WH_JOURNALRECORD hook procedure. For more information, see the JournalPlaybackProc hook procedure.
WH_JOURNALRECORD
Installs a hook procedure that records input messages posted to the system message queue. This hook is useful for recording macros. For more information, see the JournalRecordProc hook procedure.
WH_KEYBOARD
Installs a hook procedure that monitors keystroke messages. For more information, see the KeyboardProc hook procedure.
WH_KEYBOARD_LL
Windows NT/2000/XP: Installs a hook procedure that monitors low-level keyboard input events. For more information, see the LowLevelKeyboardProc hook procedure.
WH_MOUSE
Installs a hook procedure that monitors mouse messages. For more information, see the MouseProc hook procedure.
WH_MOUSE_LL
Windows NT/2000/XP: Installs a hook procedure that monitors low-level mouse input events. For more information, see the LowLevelMouseProc hook procedure.
WH_MSGFILTER
Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. For more information, see the MessageProc hook procedure.
WH_SHELL
Installs a hook procedure that receives notifications useful to shell applications. For more information, see the ShellProc hook procedure.
WH_SYSMSGFILTER
Installs a hook procedure that monitors messages generated as a result of an input event in a dialog box, message box, menu, or scroll bar. The hook procedure monitors these messages for all applications in the same desktop as the calling thread. For more information, see the SysMsgProc hook procedure.
lpfn
[in] Pointer to the hook procedure. If the dwThreadId parameter is zero or specifies the identifier of a thread created by a different process, the lpfn parameter must point to a hook procedure in a DLL. Otherwise, lpfn can point to a hook procedure in the code associated with the current process.
hMod
[in] Handle to the DLL containing the hook procedure pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the code associated with the current process.
dwThreadId
[in] Specifies the identifier of the thread with which the hook procedure is to be associated. If this parameter is zero, the hook procedure is associated with all existing threads running in the same desktop as the calling thread.