Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!hubcap!ncrcae!secola!ramspott From: ramspott@secola.Columbia.NCR.COM (John Ramspott) Newsgroups: comp.windows.ms Subject: Windows Hooks and Message Filters Keywords: SetWindowsHook, message filter Message-ID: <385@secola.Columbia.NCR.COM> Date: 25 Jul 89 23:46:06 GMT Organization: NCR SE-Columbia, West Columbia, SC Lines: 43 I am having trouble using the SetWindowsHook() routine with the WH_MSGFILTER option. I am interested in trapping when the user hits the help button on a dialog box, which is always control id 3 in my app. What I am expecting to see is a WM_COMMAND message with a wParam of 3. I never get any WM_COMMAND messages, yet I know that my dialog box is getting the message. The only thing I ever get are button up, button down, and paint messages, and that is for the push button control, and not the dialog box. Why is my filter function unable to get the other messages that go to my dialog box? I currently hacked a way to figure out if the help button has been hit by using the button up message, but this is very schlocky... The other complaint I have is an inaccuracy in the documentation. It claims that the nCode your filter function will get is one of three values -- MSGF_DIALOGBOX, MSGF_MENU, and MSGF_MESSAGEBOX, and ONLY one of these three. Not true. You can also get MSGF_SCROLLBAR if you have a list box, as well as some nCodes for resizing. And I get a lot more than just dialog box stuff with nCode = MSGF_DIALOGBOX. This seems to be a catch-all for Microsoft, which uses it for mouse movements and button activity in any window, not just a dialog box. Finally, I often get two copies of a message for modeless dialog boxes sent to my filter function. Any idea why?? I am currently recording the times of messages and ignoring ones I get with no time elapsed. The guy at Microsoft didn't have any clues, but said he will make a request of Microsoft Online, but he gets low priority!! I have seen few if any signs of intelligent life from either Microsoft help line, documentation, or their "KnowledgeBase". Has anyone gotten a real, accurate, and timely response from the Online group, or is this just another sham to get $500? Thanx. ---- John E. Ramspott-- These ideas are only my own. My employer will not acknowledge or understand them. -- John E. Ramspott, NCR, SE-Columbia. Usenet: ramspott@columbia.NCR.COM "Amiga's so fine, there's no telling where the money went..." Disclaimer: These ideas don't represent my company. In fact, they aren't mine either. I just found them laying on the sidewalk.