Click here to Skip to main content
15,886,026 members
Home / Discussions / C#
   

C#

 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
Paul Riley23-Sep-02 3:07
Paul Riley23-Sep-02 3:07 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
stephen woolhead23-Sep-02 5:31
stephen woolhead23-Sep-02 5:31 
GeneralRe: Maching the row in a datagrid to a row in a DataTable Pin
Paul Riley23-Sep-02 5:42
Paul Riley23-Sep-02 5:42 
Generalhelp Pin
imran_rafique22-Sep-02 13:53
imran_rafique22-Sep-02 13:53 
GeneralRe: help Pin
Stephane Rodriguez.22-Sep-02 20:15
Stephane Rodriguez.22-Sep-02 20:15 
GeneralDesktop Hierarchy Pin
Wjousts22-Sep-02 13:41
Wjousts22-Sep-02 13:41 
GeneralRe: Desktop Hierarchy Pin
Paul Riley22-Sep-02 15:07
Paul Riley22-Sep-02 15:07 
Questionhelp? Pin
imran_rafique22-Sep-02 13:35
imran_rafique22-Sep-02 13:35 
please read that code and solve my problem.
Given after that code.
///////////////////////////////////////////////////////////
>>><<<><
public class Win32Hook  {       [DllImport("kernel32")]       public static extern int GetCurrentThreadId();        [DllImport( "user32", CharSet=CharSet.Auto,CallingConvention=CallingConvention.StdCall)]       public static extern int SetWindowsHookEx( HookType idHook,                      HOOKPROC lpfn,                      int hmod,                      int dwThreadId                      );        public enum HookType       {            WH_KEYBOARD = 2       }       public delegate int HOOKPROC(int nCode, int wParam, int lParam);        private HOOKPROC hookProc; //private field with class scope        public void SetHook()       {             // set the keyboard hook            hookProc = new HOOKPROC(this.MyKeyboardProc);             SetWindowsHookEx(HookType.WH_KEYBOARD, hookProc, 0,                    GetCurrentThreadId());        }        public int MyKeyboardProc(int nCode, int wParam, int lParam)       {  	  //line of code           return 0;       }  } 

To install the hook procedure

Win32Hook hook = new Win32Hook();

hook.SetHook();
///////////////////////////////////////////////////////////

Above code is 100% correct but my problem here is that I want to execute it for each thread for that purpose I modify a line of code and that is
SetWindowsHookEx (HookType.WH_KEYBOARD, hookProc, IntPtr.Zero,0 );

But after changing that line of code it does not solve my problem because MyKeyboardProc function does not execute its code.
I don’t know why? Can any body give its solution?



r00d0034@yahoo.com
GeneralDragging files onto a windows form Pin
zimbar22-Sep-02 5:01
zimbar22-Sep-02 5:01 
GeneralRe: Dragging files onto a windows form Pin
Stephane Rodriguez.22-Sep-02 5:20
Stephane Rodriguez.22-Sep-02 5:20 
GeneralCustom Control Pin
Donald Blachly21-Sep-02 18:55
Donald Blachly21-Sep-02 18:55 
GeneralRe: Custom Control Pin
Stephane Rodriguez.21-Sep-02 21:24
Stephane Rodriguez.21-Sep-02 21:24 
GeneralRe: Custom Control Pin
James T. Johnson21-Sep-02 21:42
James T. Johnson21-Sep-02 21:42 
GeneralRe: Custom Control Pin
Stephane Rodriguez.21-Sep-02 22:59
Stephane Rodriguez.21-Sep-02 22:59 
GeneralRe: Custom Control Pin
James T. Johnson21-Sep-02 23:13
James T. Johnson21-Sep-02 23:13 
GeneralRe: Custom Control Pin
Donald Blachly22-Sep-02 3:47
Donald Blachly22-Sep-02 3:47 
QuestionCentering a window at runtime? Pin
Zinj21-Sep-02 14:00
sussZinj21-Sep-02 14:00 
AnswerRe: Centering a window at runtime? Pin
David Stone21-Sep-02 14:14
sitebuilderDavid Stone21-Sep-02 14:14 
AnswerRe: Centering a window at runtime? Pin
James T. Johnson21-Sep-02 14:30
James T. Johnson21-Sep-02 14:30 
GeneralRe: Centering a window at runtime? Pin
Zinj21-Sep-02 15:43
sussZinj21-Sep-02 15:43 
GeneralRe: Centering a window at runtime? Pin
James T. Johnson21-Sep-02 15:50
James T. Johnson21-Sep-02 15:50 
GeneralRe: Centering a window at runtime? Pin
Zinj22-Sep-02 4:51
sussZinj22-Sep-02 4:51 
GeneralRGB and HSV Pin
Tomas Petricek21-Sep-02 4:43
Tomas Petricek21-Sep-02 4:43 
GeneralRe: RGB and HSV Pin
leppie21-Sep-02 5:34
leppie21-Sep-02 5:34 
GeneralRe: RGB and HSV Pin
Stephane Rodriguez.21-Sep-02 5:42
Stephane Rodriguez.21-Sep-02 5: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.