½
½£¾ªºè
Give an example:When user pressed "B" or "b",HOOK get that message and let
TextBox1.text display "a".
The executing founction is as following:
****************************************
IntPtr MyHookProc(int code, IntPtr wparam, IntPtr lparam)
{
if( code < 0 ) return CallNextHookEx(_nextHookPtr,code, wparam, lparam);
if( wparam.ToInt32() == 98 || wparam.ToInt32() == 66 )
{
this.textBox1.Text = "a";
return (IntPtr) 1;
}
else
{
return IntPtr.Zero;
}
}
****************************************
But if I want to use hook to catch and change the KeyPress Message what was
just made by user,that solution does not work.
My Problem is that using hook to catch the message "B" or "b",and then
change it as "a".Please modify the above function directly,thank you.
That problem confused me quite along time,I am nearly crazy!
TextBox1.text display "a".
The executing founction is as following:
****************************************
IntPtr MyHookProc(int code, IntPtr wparam, IntPtr lparam)
{
if( code < 0 ) return CallNextHookEx(_nextHookPtr,code, wparam, lparam);
if( wparam.ToInt32() == 98 || wparam.ToInt32() == 66 )
{
this.textBox1.Text = "a";
return (IntPtr) 1;
}
else
{
return IntPtr.Zero;
}
}
****************************************
But if I want to use hook to catch and change the KeyPress Message what was
just made by user,that solution does not work.
My Problem is that using hook to catch the message "B" or "b",and then
change it as "a".Please modify the above function directly,thank you.
That problem confused me quite along time,I am nearly crazy!