Groups | Blog | Home
all groups > c# > march 2006 >

c# : keyboard hooks in C#


Hema
3/31/2006 10:20:06 PM
hello all,
I am working on a project related to Internet Explorer. I want my
application to be invoked by a keypress( single key stroke or a
combination). But this must get invoked only when the IE browser is
open. I learnt that SetWindowsHookEx must be used along with few
others. But my doubt is how to call my application? Can i implement the
keyboard hooks related methods in the same project as my application or
should this be else where(i.e as a new project)? wats the difference
between the keyboard hooks and hot keys... i have been serching abt
this for a long time that right now i am confused.
I am new to .NET and all these window hooks. Please help me.
thanks,
hema
Kevin Spencer
4/1/2006 7:56:15 AM
Your app has a dependency upon Internet Explorer. This means that you should
probably build your app so that it launches Internet Explorer when it
starts, rather then depending upon the user to launch Internet Explorer.
Otherwise, this is not something that you can fix by modifying your app, as
your app hasn't started yet before Internet Explorer is required to be
launched.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

[quoted text, click to view]

Vadym Stetsyak
4/1/2006 4:13:06 PM
SGVsbG8sIEtldmluIQ0KDQogS1M+IFlvdXIgYXBwIGhhcyBhIGRlcGVuZGVuY3kgdXBvbiBJbnRl
cm5ldCBFeHBsb3Jlci4gVGhpcyBtZWFucyB0aGF0IHlvdQ0KIEtTPiBzaG91bGQgcHJvYmFibHkg
YnVpbGQgeW91ciBhcHAgc28gdGhhdCBpdCBsYXVuY2hlcyBJbnRlcm5ldCBFeHBsb3Jlcg0KIEtT
PiB3aGVuIGl0IHN0YXJ0cywgcmF0aGVyIHRoZW4gZGVwZW5kaW5nIHVwb24gdGhlIHVzZXIgdG8g
bGF1bmNoIEludGVybmV0IA0KIEtTPiBFeHBsb3Jlci4gT3RoZXJ3aXNlLCB0aGlzIGlzIG5vdCBz
b21ldGhpbmcgdGhhdCB5b3UgY2FuIGZpeCBieQ0KIEtTPiBtb2RpZnlpbmcgeW91ciBhcHAsIGFz
IHlvdXIgYXBwIGhhc24ndCBzdGFydGVkIHlldCBiZWZvcmUgSW50ZXJuZXQNCiBLUz4gRXhwbG9y
ZXIgaXMgcmVxdWlyZWQgdG8gYmUgbGF1bmNoZWQuDQoNClRoZSBzb2x1dGlvbiBoZXJlIGNhbiBi
ZSBCcm93c2VyIEhlbHBlciBPYmplY3QsIHRoYXQgd2lsbCAnbGl2ZScgaW5zaWRlIElFIGFuZCBu
b3RpZnkgbWFpbiBhcHAgYWJvdXQgZGlmZmVyZW50IGV2ZW50cy4NCg0KDQotLQ0KUmVnYXJkcywg
VmFkeW0gU3RldHN5YWsNCnd3dzogaHR0cDovL3ZhZG15c3QuYmxvZ3Nwb3QuY29t
Kevin Spencer
4/1/2006 6:05:02 PM
Yeah, I misunderstood the question. I thought he meant that his app must
start up IE in order to work. It sounds more like he wants to add a keyboard
shortcut to IE to start his app.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

[quoted text, click to view]

GEETHA
4/3/2006 1:37:38 AM
Hello,
I have used the IObjectWithSite and IOleCommandTarget for my applciation
already.Will this hook that i am adding will come in the IObjectWithSite
again.How different is this going to be?

Thanks,
AddThis Social Bookmark Button