!-----Example of a Shell Hook------- ! by Jim Kane ! ! The sample app will detect the opening of IE4. ! !1. add this class to your app: include('sethcl.inc') ! !2. Add the lib to your app. Press Project, Libs, add file: shook.lib ! !3. When the target window is opened, Event:TargetFound is posted the ! thread you specify in the init message. ! !4. Determine the windows class for the window you wish to detect. ! The api getclassName(HWND) can be used to find this. Open the window ! you want to ultimately detect and execute this: ! cWindowText = 'Exact Window Text on Target Text' ! hwnd = FindWindow(,cWindowText) ! GetClassName(Hwnd,cClassName,size(cClassName)) ! Message(cClassName,'ClassName') ! ! For example, MS Internet Explorer the class Name is IEFrame. ! This string, IEFrame, is passed to the SetHCl.Init() method. ! !5. In the sample app, clicking or Test, arms the shell hook. Next time ! internet explorer opens, a message is displayed. ! !6. C source code for the dll is included but not needed to impliment the project.