Click here to Skip to main content
15,898,588 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalchar Pin
Mazdak21-May-02 21:13
Mazdak21-May-02 21:13 
GeneralRe: char Pin
Martin Speiser21-May-02 21:58
Martin Speiser21-May-02 21:58 
GeneralRe: char Pin
Mazdak22-May-02 1:08
Mazdak22-May-02 1:08 
GeneralRe: char Pin
Prem Kumar21-May-02 22:36
Prem Kumar21-May-02 22:36 
GeneralRe: char Pin
Alexandru Savescu22-May-02 0:06
Alexandru Savescu22-May-02 0:06 
GeneralUsing resources in static libraries Pin
SevereHammer21-May-02 20:29
SevereHammer21-May-02 20:29 
GeneralRe: Using resources in static libraries Pin
Martin Speiser21-May-02 22:43
Martin Speiser21-May-02 22:43 
GeneralGlobal hook performance... Pin
Dana Holt21-May-02 19:01
Dana Holt21-May-02 19:01 
I am working on a project that requires a global hook.

I only need to process a single message (WM_ACTIVATE), and I am using a WH_CALLWNDPROCRET type hook.

Basically if I get this message I fire off another thread in the DLL that runs at THREAD_PRIORITY_LOWEST that modifies some of the window's styles.

Anyway, when the hook is running taskmgr takes about 30% - 40% of the CPU time with nothing else going on. I assume this is from processing the messages because moving the mouse quickly increases this to 50% - 60%. The first thing I do in the hook is check if it is the message I want, and if it is not I call the next hook.

I am also checking for nCode < 0 and calling the next hook without executing mine if this is true.

Can anyone tell me what the best performance hook is? I think it is weird that the hook causes that much CPU usage in taskmgr.

Oh, yes I am using DisableThreadLibraryCalls() for each process that uses the DLL.

Thanks!

--
Dana Holt
Xenos Software
GeneralRe: Global hook performance... Pin
Alex Cramer21-May-02 19:56
Alex Cramer21-May-02 19:56 
QuestionSCSI Commands and VC++? Pin
chen21-May-02 18:15
chen21-May-02 18:15 
AnswerRe: SCSI Commands and VC++? Pin
Dana Holt21-May-02 19:22
Dana Holt21-May-02 19:22 
GeneralRe: SCSI Commands and VC++? Pin
chen21-May-02 21:17
chen21-May-02 21:17 
GeneralRe: SCSI Commands and VC++? Pin
Dana Holt22-May-02 7:04
Dana Holt22-May-02 7:04 
AnswerRe: SCSI Commands and VC++? Pin
Mike Nordell23-May-02 3:57
Mike Nordell23-May-02 3:57 
GeneralStatic control pops up Explorer window Pin
paulb21-May-02 16:29
paulb21-May-02 16:29 
GeneralRe: Static control pops up Explorer window Pin
Dana Holt21-May-02 19:25
Dana Holt21-May-02 19:25 
GeneralCMDIChildWnd - window arrangement Pin
Heywood21-May-02 15:35
Heywood21-May-02 15:35 
QuestionShrinking DIB StretchDIBits ? Pin
21-May-02 14:45
suss21-May-02 14:45 
AnswerRe: Shrinking DIB StretchDIBits ? Pin
Chris Losinger21-May-02 15:10
professionalChris Losinger21-May-02 15:10 
GeneralRe: Shrinking DIB StretchDIBits ? Pin
22-May-02 0:38
suss22-May-02 0:38 
AnswerRe: Shrinking DIB StretchDIBits ? Pin
Shog921-May-02 15:32
sitebuilderShog921-May-02 15:32 
GeneralRe: Shrinking DIB StretchDIBits ? Pin
22-May-02 0:29
suss22-May-02 0:29 
GeneralRe: Shrinking DIB StretchDIBits ? Pin
22-May-02 0:35
suss22-May-02 0:35 
GeneralSet View Position in CEditView :: MFC Pin
valikac21-May-02 14:33
valikac21-May-02 14:33 
GeneralRe: Set View Position in CEditView :: MFC Pin
Prem Kumar21-May-02 21:05
Prem Kumar21-May-02 21:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.