Jump to content

Alt Tab Tusuna Basılmasını Engelleme


Amilo
 Share

Recommended Posts

  • Editor
[StructLayout(LayoutKind.Sequential)]

private struct KBDLLHOOKSTRUCT

{

public Keys key;

public int scanCode;

public int flags;

public int time;

public IntPtr extra;

}

int sCancel = 0;

//System level functions to be used for hook and unhook keyboard input

private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]

private static extern IntPtr SetWindowsHookEx(int id, LowLevelKeyboardProc callback, IntPtr hMod, uint dwThreadId);

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]

private static extern bool UnhookWindowsHookEx(IntPtr hook);

[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]

private static extern IntPtr CallNextHookEx(IntPtr hook, int nCode, IntPtr wp, IntPtr lp);

[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]

private static extern IntPtr GetModuleHandle(string name);

[DllImport("user32.dll", CharSet = CharSet.Auto)]

private static extern short GetAsyncKeyState(Keys key);

 

const int WM_COMMAND = 0x111;

const int MIN_ALL = 419;

const int MIN_ALL_UNDO = 416;

//Declaring Global objects

private IntPtr ptrHook;

private LowLevelKeyboardProc objKeyboardProcess;

public Form1()

{

ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;

objKeyboardProcess = new LowLevelKeyboardProc(captureKey);

ptrHook = SetWindowsHookEx(13, objKeyboardProcess, GetModuleHandle(objCurrentModule.ModuleName), 0);

DevExpress.Skins.SkinManager.EnableFormSkins();

DevExpress.UserSkins.BonusSkins.Register();

DevExpress.UserSkins.OfficeSkins.Register();

InitializeComponent();

}

private IntPtr captureKey(int nCode, IntPtr wp, IntPtr lp)

{

if (nCode >= 0)

{

KBDLLHOOKSTRUCT objKeyInfo = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lp, typeof(KBDLLHOOKSTRUCT));

if (objKeyInfo.key == Keys.Alt || objKeyInfo.key == Keys.Tab || objKeyInfo.key == Keys.LWin || objKeyInfo.key == Keys.RWin || objKeyInfo.key == Keys.ControlKey || objKeyInfo.key == Keys.LControlKey || objKeyInfo.key == Keys.RControlKey || objKeyInfo.key == Keys.Escape) // Disabling Windows keys

{

return (IntPtr)1;

}

}

return CallNextHookEx(ptrHook, nCode, wp, lp);

}

 

 

Ben c# ta bu şekilde engellemiştim özel tuşların hepsini Kullanılan DLL ler autoit ye nasılş uygulanır bilmem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...