Subclassing and Hooking with Visual Basic: Harnessing the Full Power of VB/VB.NET
Subclassing & Hooking with Visual Basic offers developers a unique way to customize Windows behavior. Windows is a message-based system. Every action you request creates one or more messages to carry out the action. These messages are passed between objects and carry with them information that gives the recipient more detail on how to interpret and act upon the message. With Subclassing and the Windows hooking mechanism ("hooks"), you can manipulate, modify, or even discard messages bound for other objects within the operating system, in the process changing the way the system behaves. What kinds of results can you achieve using the power of subclassing and hooking? Here are just a few of the possibilities:
  • Determine when a window is being activated or deactivated and respond to this change.
  • Display descriptions of menu items as the mouse moves across them.
  • Disallow a user to move or resize a window.
  • Determine where the mouse cursor is and respond accordingly.
  • Determine when the display resolution has been changed.
  • Monitor the system for a low system resource condition.
  • Modify or disallow keystrokes sent to a window or a control.
  • Create an automated testing application.
  • Determine when an application is idle.
Along with this power comes responsibility; Windows is very unforgiving if subclassing and hooking are used incorrectly. Subclassing & Hooking with Visual Basic demonstrates the various techniques for intercepting messages bound for one or more windows or controls: the intercepted message can be left in its original state or modified; afterwards, the message can be sent to its original destination or discarded. For both VB 6 and VB.NET developers, Subclassing & Hooking with Visual Basic opens up a wealth of possibilities that ordinarily would be completely unavailable, or at least not easy to implement.
1140203726
Subclassing and Hooking with Visual Basic: Harnessing the Full Power of VB/VB.NET
Subclassing & Hooking with Visual Basic offers developers a unique way to customize Windows behavior. Windows is a message-based system. Every action you request creates one or more messages to carry out the action. These messages are passed between objects and carry with them information that gives the recipient more detail on how to interpret and act upon the message. With Subclassing and the Windows hooking mechanism ("hooks"), you can manipulate, modify, or even discard messages bound for other objects within the operating system, in the process changing the way the system behaves. What kinds of results can you achieve using the power of subclassing and hooking? Here are just a few of the possibilities:
  • Determine when a window is being activated or deactivated and respond to this change.
  • Display descriptions of menu items as the mouse moves across them.
  • Disallow a user to move or resize a window.
  • Determine where the mouse cursor is and respond accordingly.
  • Determine when the display resolution has been changed.
  • Monitor the system for a low system resource condition.
  • Modify or disallow keystrokes sent to a window or a control.
  • Create an automated testing application.
  • Determine when an application is idle.
Along with this power comes responsibility; Windows is very unforgiving if subclassing and hooking are used incorrectly. Subclassing & Hooking with Visual Basic demonstrates the various techniques for intercepting messages bound for one or more windows or controls: the intercepted message can be left in its original state or modified; afterwards, the message can be sent to its original destination or discarded. For both VB 6 and VB.NET developers, Subclassing & Hooking with Visual Basic opens up a wealth of possibilities that ordinarily would be completely unavailable, or at least not easy to implement.
54.99 In Stock
Subclassing and Hooking with Visual Basic: Harnessing the Full Power of VB/VB.NET

Subclassing and Hooking with Visual Basic: Harnessing the Full Power of VB/VB.NET

by Stephen Teilhet
Subclassing and Hooking with Visual Basic: Harnessing the Full Power of VB/VB.NET

Subclassing and Hooking with Visual Basic: Harnessing the Full Power of VB/VB.NET

by Stephen Teilhet

Paperback

$54.99 
  • SHIP THIS ITEM
    In stock. Ships in 1-2 days.
  • PICK UP IN STORE

    Your local store may have stock of this item.

Related collections and offers


Overview

Subclassing & Hooking with Visual Basic offers developers a unique way to customize Windows behavior. Windows is a message-based system. Every action you request creates one or more messages to carry out the action. These messages are passed between objects and carry with them information that gives the recipient more detail on how to interpret and act upon the message. With Subclassing and the Windows hooking mechanism ("hooks"), you can manipulate, modify, or even discard messages bound for other objects within the operating system, in the process changing the way the system behaves. What kinds of results can you achieve using the power of subclassing and hooking? Here are just a few of the possibilities:
  • Determine when a window is being activated or deactivated and respond to this change.
  • Display descriptions of menu items as the mouse moves across them.
  • Disallow a user to move or resize a window.
  • Determine where the mouse cursor is and respond accordingly.
  • Determine when the display resolution has been changed.
  • Monitor the system for a low system resource condition.
  • Modify or disallow keystrokes sent to a window or a control.
  • Create an automated testing application.
  • Determine when an application is idle.
Along with this power comes responsibility; Windows is very unforgiving if subclassing and hooking are used incorrectly. Subclassing & Hooking with Visual Basic demonstrates the various techniques for intercepting messages bound for one or more windows or controls: the intercepted message can be left in its original state or modified; afterwards, the message can be sent to its original destination or discarded. For both VB 6 and VB.NET developers, Subclassing & Hooking with Visual Basic opens up a wealth of possibilities that ordinarily would be completely unavailable, or at least not easy to implement.

Product Details

ISBN-13: 9780596001186
Publisher: O'Reilly Media, Incorporated
Publication date: 07/06/2001
Pages: 704
Product dimensions: 7.00(w) x 9.19(h) x 1.26(d)

About the Author

Stephen Teilhet earned a degree in electrical engineering but soon afterwards began writing software for the Windows platform. For the last eight years, he has worked for several consulting firms on a wide range of projects, specializing in Visual Basic, Visual C++, MTS, COM, MSMQ, and SQL Server. Stephen currently works for Compuware Numega Labs in Nashua, New Hampshire, where he is immersed in the Microsoft .NET technologies.

Table of Contents

Preface; Who This Book Is For; How This Book Is Structured; Obtaining the Sample Code; Conventions Used in This Book; How to Contact Us; Acknowledgments; Introducing Subclassing and Hooking; Chapter 1: Introduction; 1.1 Subclassing; 1.2 The Window Hooking Mechanism; 1.3 Tools to Aid Us in Our Efforts; 1.4 A Word of Warning; Chapter 2: Windows System-Specific Information; 2.1 Inside a Windows Application; 2.2 Inside the Windows Messaging System; 2.3 Performance Considerations; Chapter 3: The Basics of Subclassing and Hooks; 3.1 What Is Subclassing?; 3.2 What Are Hooks?; Subclassing and Superclassing; Chapter 4: Subclassing; 4.1 The AddressOf Operator; 4.2 Some Subclassing Tips; 4.3 Instance Subclassing: An Example; 4.4 Global Subclassing; 4.5 Summary of Key Points in Subclassing; Chapter 5: Subclassing the Windows Common Dialog Boxes; 5.1 How Common Dialog BoxSubclassing Works; 5.2 Using the Resource; 5.3 Creating the Subclassing Application; 5.4 Subclassing Common Dialog Boxes Other Than Open and Save As; 5.5 Problems Subclassing the Find and Replace Common Dialogs; Chapter 6: ActiveX Controls and Subclassing; 6.1 Subclassing a Third-PartyActiveX Control; 6.2 Subclassing an ActiveX ControlCreated in VB; 6.3 Subclassing a UserControl from Within a VB-Created ActiveX Control; 6.4 Creating an ActiveX Control That Subclasses Other Windows; Chapter 7: Superclassing; 7.1 What Is Superclassing?; 7.2 How the Superclassing Example Works; 7.3 Peering into the Superclassing Application with Spy++; Chapter 8: Debugging Techniques for Subclassing; 8.1 Where to Start; 8.2 Microsoft Tools; 8.3 NuMega’s SmartCheck; Hooking; Chapter 9: WH_CALLWNDPROC; 9.1 How WH_CALLWNDPROC Works; 9.2 A Thread-Specific Example; 9.3 Caveats; Chapter 10: WH_CALLWNDPROCRET; 10.1 How WH_CALLWNDPROCRET Works; 10.2 A Thread-Specific Example; 10.3 Caveats; Chapter 11: WH_GETMESSAGE; 11.1 How WH_GETMESSAGE Works; 11.2 A Thread-Specific Example; 11.3 Caveats; Chapter 12: WH_KEYBOARD and WH_KEYBOARD_LL; 12.1 How Keyboard Messaging Operates; 12.2 Description of Hooks; 12.3 A Thread-Specific Example; 12.4 A System-Wide Example; 12.5 A Low-Level Hook Example; 12.6 Caveats; Chapter 13: WH_MOUSE and WH_MOUSE_LL; 13.1 How Mouse Messaging Operates; 13.2 Description of Hooks; 13.3 Location of This Hook in the System; 13.4 A Single-Thread Example; 13.5 A System-Wide Hook Example; 13.6 Caveats; Chapter 14: WH_FOREGROUNDIDLE; 14.1 Description; 14.2 Location of This Hook in the System; 14.3 Background Processing Example; 14.4 Caveats; Chapter 15: WH_MSGFILTER; 15.1 Description; 15.2 A Thread-Specific Example; 15.3 Caveats; Chapter 16: WH_SYSMSGFILTER; 16.1 Description; 16.2 A System-Wide Example; 16.3 Caveats; Chapter 17: WH_SHELL; 17.1 Description; 17.2 Location of This Hook in the System; 17.3 A Thread-Specific Example; 17.4 Caveats; Chapter 18: WH_CBT; 18.1 Description; 18.2 A Thread-Specific Example; 18.3 Caveats; Chapter 19: WH_JOURNALRECORD; 19.1 Description; 19.2 The Macro Recorder Example; 19.3 Caveats; Chapter 20: WH_JOURNALPLAYBACK; 20.1 Description; 20.2 The Macro Recorder/Playback Example; 20.3 Caveats; Chapter 21: WH_DEBUG; 21.1 Description; 21.2 A Thread-Specific Example; 21.3 Some WH_DEBUG Scenarios; 21.4 Caveats; The .NET Platform; Chapter 22: Subclassing .NET WinForms; 22.1 What Is a WinForm?; 22.2 Instance Subclassing; 22.3 Subclassing a Control; 22.4 Superclassing; 22.5 Superclassing a Control; 22.6 Intercepting Keystrokes in a WinForm; 22.7 Behind the Scenes with Spy++; Chapter 23: Implementing Hooks in VB.NET; 23.1 Hooks and VB.NET; 23.2 Delegates; 23.3 Implementing the WH_KEYBOARD Hook; 23.4 Implementing the WH_MOUSE Hook; Appendixes; Messages; Window Messages; Button Control-Specific Messages; Combo Box-Specific Messages; Edit Control-Specific Messages; Listbox-Specific Messages; Scroll Bar-Specific Messages; Messages Specific to the CommonDialog Boxes; Messages Specific to the Font Common Dialog Box; Messages Specific to the Page Setup Common Dialog Box; API Functions; Structures and Constants; CBT_CREATEWND; CBTACTIVATESTRUCT; CHOOSECOLOR; CHOOSEFONT; CWPRETSTRUCT; CWPSTRUCT; DEBUGHOOKINFO; EVENTMSG; FINDREPLACE; KBDLLHOOKSTRUCT; MOUSEHOOKSTRUCT; MOUSEHOOKSTRUCTEX; MSG; MSLLHOOKSTRUCT; NMHDR; OPENFILENAME; PAGESETUPDLG; POINTAPI; PRINTDLG; PRINTDLGEX; RECT; WNDCLASSEX; Message (.NET Structure); Constants; Colophon;
From the B&N Reads Blog

Customer Reviews