Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!europa.asd.contel.com!gatech!udel!sbcs.sunysb.edu!libws2.ic.sunysb.edu!jsstraub From: jsstraub@libws2.ic.sunysb.edu (James (von)Straub) Newsgroups: comp.windows.ms.programmer Subject: Getting calls to SetFocus/KillFocus first. Message-ID: <1991Jun28.201806.9367@sbcs.sunysb.edu> Date: 28 Jun 91 20:18:06 GMT Sender: usenet@sbcs.sunysb.edu (Usenet poster) Organization: State University of New York at Stony Brook Lines: 48 Originator: jsstraub@libws2.ic.sunysb.edu Nntp-Posting-Host: libws2.ic.sunysb.edu Please help... I'm writing a program that sub-classes the active window and draws a different caption bar. That part works fine (except for sub-classing White Water ToolKit, which crashes.) The only problem is moving to the active window. At the moment I'm looking for WM_ACTIVATE messages on the current sub-classed window. This message *sometimes* tells you what window is geting activated next. But *sometimes* is no good. What I need to do is to capture all calls to SetFocus and KIllFocus, sub-class the specified window then call SetFocus or KIllFocus! Here's what I mean: This is what I have... case WM_ACTIVATE: if (wParm == 0) { if (lParam != NULL) SubClassWindow((HWND) lParam); } This is what I would like... HWND FilterSetFocus(HWND hWnd) { SubClassWindow(hWnd); return(SetFocus(hWnd)); } /* FilterSetFocus */ This is as far as I got with this idea... hUserModual = GetModuleHandle((LPSTR)"USER"); fpSetFocus = GetProcAddress(hUserModual, "SetFocus"); Now that I have "fpSetFocus" what do I do? Is what I want to do feasible? Any help with this would be most appreciated and would gain notable honor in my program's about box. Thank you very much... James Straub -- _______________________________________________________________________________ | James S. Straub -> Life may be limited but your imagination isn't! <- | | InterNET: jsstraub@csserv1.ic.sunysb.edu BITNet: jsstraub@sbccvm.bitnet | ------------------------------------------------------------------------------- [0m