Hi everyone.

I'm facing a tricky problem with keyboard hooks in visual c++ (MFC).

I have two global keyboard hooks set in my application and everything works smoothly when windows explorer is running.
But my application needs to run without windows explorer (in kiosk mode), so i replace explorer.exe with my application in the following registry key :

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"Shell"="myapp.exe" (INSTEAD OF "explorer.exe")

On this situation my hooks stop working after a key press or two.

I'm pretty sure disabling explorer.exe as windows shell has something to do with it because i've been experiencing other similar problems on commercial applications too (not having to do with hooks although).

If anyone has got a clue... i'd be really thankful!

Recommended Answers

All 3 Replies

Update:

After some debugging i came across this:

When eplorer.exe is not loaded during windows startup, DLL_PROCESS_DETACH is never called in my dll although i call FreeLibrary() function inside my application.
To emphasize that, i repeat that none of this problems occurs when windows starts normally with explorer.exe.

Anyone got a clue?
Please help...

Thanks in advance!

You may ask it in the Microsoft forum since what you are asking is about Windows programming.

Do you mean microsoft's forum, or daniweb's windows section?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.