Click here to Skip to main content
15,906,081 members
Home / Discussions / C#
   

C#

 
GeneralRe: Audio & Video chat Pin
Anonymous30-May-04 17:05
Anonymous30-May-04 17:05 
GeneralEmbedding VC++.NET code in VC#.NET Project Pin
Nagendra Kamath K11-Apr-04 19:06
Nagendra Kamath K11-Apr-04 19:06 
GeneralRe: Embedding VC++.NET code in VC#.NET Project Pin
Jesse Squire12-Apr-04 2:13
Jesse Squire12-Apr-04 2:13 
GeneralImage trnasfer using Remoting Pin
Nagendra Kamath K11-Apr-04 19:03
Nagendra Kamath K11-Apr-04 19:03 
GeneralRe: Image trnasfer using Remoting Pin
Heath Stewart12-Apr-04 5:35
protectorHeath Stewart12-Apr-04 5:35 
Generaldatagrid cell updates Pin
DougW4811-Apr-04 19:01
DougW4811-Apr-04 19:01 
GeneralRe: datagrid cell updates Pin
Mazdak11-Apr-04 21:40
Mazdak11-Apr-04 21:40 
GeneralBlocking Task Keys Pin
Nagendra Kamath K11-Apr-04 18:01
Nagendra Kamath K11-Apr-04 18:01 
Following is the VC++.NET code for the Hook Procedure passed as a parameter for the "SetWindowsHookEx" API call. This code was downloaded from http://msdn.microsoft.com/msdnmag/issues/02/09/CQA/default.aspx

Can some one give the equivalent code for the following in C#. I tried a lot to do so but all in vain.

LRESULT CALLBACK MyTaskKeyHookLL(int nCode, WPARAM wp, LPARAM lp)
{
   KBDLLHOOKSTRUCT *pkh = (KBDLLHOOKSTRUCT *) lp;
   if (nCode==HC_ACTION)
   {
      BOOL bCtrlKeyDown = GetAsyncKeyState(VK_CONTROL)>>((sizeof(SHORT) * 8) - 1);
      if ((pkh->vkCode==VK_ESCAPE && bCtrlKeyDown) || 			   
          (pkh->vkCode==VK_TAB && pkh->flags & LLKHF_ALTDOWN) || 
          (pkh->vkCode==VK_ESCAPE && pkh->flags & LLKHF_ALTDOWN) ||
          (pkh->vkCode==VK_LWIN || pkh->vkCode==VK_RWIN))
          { 
              if (g_bBeep && (wp==WM_SYSKEYDOWN||wp==WM_KEYDOWN))
                  MessageBeep(0); 
              return 1; 		
          }
   }
   return CallNextHookEx(g_hHookKbdLL, nCode, wp, lp);
}

Even a sample project which blocks all Task Keys that is Alt+Tab, Ctrl+Esc, Alt+Esc etc..

CHEERS
GeneralRe: Blocking Task Keys Pin
Heath Stewart12-Apr-04 5:38
protectorHeath Stewart12-Apr-04 5:38 
GeneralRe: Blocking Task Keys Pin
Nagendra Kamath K12-Apr-04 7:17
Nagendra Kamath K12-Apr-04 7:17 
GeneralRe: Blocking Task Keys Pin
Heath Stewart12-Apr-04 8:23
protectorHeath Stewart12-Apr-04 8:23 
QuestionControl question??? Pin
Small Rat11-Apr-04 17:15
Small Rat11-Apr-04 17:15 
AnswerRe: Control question??? Pin
Heath Stewart12-Apr-04 5:42
protectorHeath Stewart12-Apr-04 5:42 
GeneralProhibit user enter key char Pin
DucLinh11-Apr-04 16:37
DucLinh11-Apr-04 16:37 
GeneralRe: Prohibit user enter key char Pin
Heath Stewart12-Apr-04 5:47
protectorHeath Stewart12-Apr-04 5:47 
GeneralCouldn't close my application Pin
yu-yu11-Apr-04 15:09
yu-yu11-Apr-04 15:09 
GeneralRe: Couldn't close my application Pin
Heath Stewart12-Apr-04 5:52
protectorHeath Stewart12-Apr-04 5:52 
GeneralRe: Couldn't close my application Pin
yu-yu13-Apr-04 17:20
yu-yu13-Apr-04 17:20 
GeneralRe: Couldn't close my application Pin
yu-yu13-Apr-04 18:12
yu-yu13-Apr-04 18:12 
GeneralDIsable Alt+F4 Pin
Michael Timoney11-Apr-04 14:57
Michael Timoney11-Apr-04 14:57 
GeneralRe: DIsable Alt+F4 Pin
Heath Stewart12-Apr-04 5:54
protectorHeath Stewart12-Apr-04 5:54 
GeneralRe: DIsable Alt+F4 Pin
Jay Shankar12-Apr-04 22:42
Jay Shankar12-Apr-04 22:42 
GeneralRe: DIsable Alt+F4 Pin
Michael Timoney14-Apr-04 6:08
Michael Timoney14-Apr-04 6:08 
GeneralRe: DIsable Alt+F4 Pin
Jay Shankar14-Apr-04 16:10
Jay Shankar14-Apr-04 16:10 
GeneralProblems with char typecast's Pin
Franz Pentenrieder11-Apr-04 14:42
Franz Pentenrieder11-Apr-04 14:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.