Re: CBT hook and Subclassing
- From: "Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx>
- Date: Thu, 12 Oct 2006 08:56:40 +0200
If you don't want some apps run with your hook, you can return FALSE in your
hook DllMain, but if that not suit you the only way I see is to inject hook
code in each app you want to behave in such manner
Arkady
"MSB" <MSB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AA9AF7EB-F5E6-4499-90E0-05C05E54D528@xxxxxxxxxxxxxxxx
Yes. Thats how I setup CBT hook. I tried the AppInit_DLLs key to check if
its
solves the problem. It does partially solves the issue but it gives other
side effects like mmc windows do not come up.
"Arkady Frenkel" wrote:
Just a hint, didn't you tried SetWindowsHookEx() instead of AppInit_DLLs
key ?
Arkady
"MSB" <MSB@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:93771D01-B48C-4562-832D-2EF28C637DFA@xxxxxxxxxxxxxxxx
Hi,
I have developed an application which sets up a global CBT hook to
restrict
the resizing and movement of window within the monitor on which they
are
created ,on a multimonitor system. When this application exits, it
unhooks
the CBT hook.
Inside hook DLL, I have a logic of listening to HCBT_CREATEWND and
subsclass
windows. In NCDESTROY message of windows, subclassing is removed.
This Application is working fine. But I am having certain issues when I
shut
down the application.
If i launch MMC.exe ( ex. Services.msc ) , TaskMgr.exe( TaskManager ) ,
MsTsc.exe ( Remote desktop window ) etc. when the application is
running
AND
when I shutdown the application, these windows crash !!
I am having no clue why they are crashing. I digged documentation for
subclassing and found that when I set my hook DLL in following key :
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\
CurrentVersion\Windows\APPINIT_DLLS
TaskMgr and MsTsc doesn't crash. But MMC.exe never comes up when
application
is running ! and this approach doesnt sound very good.
Any ideas how can I prevent these applications from crashing when my
application shuts down ?
Thanks,
MSB
.
- References:
- Re: CBT hook and Subclassing
- From: Arkady Frenkel
- Re: CBT hook and Subclassing
- Prev by Date: Re: registry permission
- Next by Date: Re: service not capturing message
- Previous by thread: Re: CBT hook and Subclassing
- Next by thread: Re: CBT hook and Subclassing
- Index(es):
Relevant Pages
|