F
farseer
Hi,
based on some posts i read, i am using a dll to allow me to do some
keyboard hooking. this is being called from a C# compactfamework app,
which doesn't support delegates. so, i am using a MessageWindow to
send the key presses to the C# app. My question is: there are times,
depending on the key that is pressed, where i want to suppress the
key..so i'd prefer not to call CallNextHookEx in the dll for those
cases. But because i am sending a message to my MessageWindow, the
process is asynchronous. Does anyone have any idea how i can do this?
i was thinking maybe i could go into a lopp after sending the message,
then wait for the C# to set some global value before breaking out of
that loop and decide whether to call CallNextHookEx. would that work?
OR, maybe i can export CallNextHook and have the C# app decide whether
to call it or not?
But then i thought, what sort of timing issues would i run into if
another key is pressed while i'm still passing the last one?
here is my hook proc?
i have dll which allows me to do some keyboard hooking. I am calling
this
MY_API LRESULT CALLBACK keyboardHookProc(int ncode,WPARAM wparam,LPARAM
lparam)
{
if(ncode>=0)
{
SendMessage( _messageWindow, ncode, wparam, lparam);
}
return ( CallNextHookEx( _keyboardHook, ncode, wparam,lparam )
);//pass control to next hook in the hook chain.
}
based on some posts i read, i am using a dll to allow me to do some
keyboard hooking. this is being called from a C# compactfamework app,
which doesn't support delegates. so, i am using a MessageWindow to
send the key presses to the C# app. My question is: there are times,
depending on the key that is pressed, where i want to suppress the
key..so i'd prefer not to call CallNextHookEx in the dll for those
cases. But because i am sending a message to my MessageWindow, the
process is asynchronous. Does anyone have any idea how i can do this?
i was thinking maybe i could go into a lopp after sending the message,
then wait for the C# to set some global value before breaking out of
that loop and decide whether to call CallNextHookEx. would that work?
OR, maybe i can export CallNextHook and have the C# app decide whether
to call it or not?
But then i thought, what sort of timing issues would i run into if
another key is pressed while i'm still passing the last one?
here is my hook proc?
i have dll which allows me to do some keyboard hooking. I am calling
this
MY_API LRESULT CALLBACK keyboardHookProc(int ncode,WPARAM wparam,LPARAM
lparam)
{
if(ncode>=0)
{
SendMessage( _messageWindow, ncode, wparam, lparam);
}
return ( CallNextHookEx( _keyboardHook, ncode, wparam,lparam )
);//pass control to next hook in the hook chain.
}