Article View: comp.windows.ms.programmer
Article #3307Hacking The Dialog Class
From: Ron Burk
Date: Mon, 17 Jun 1991 22:10
Date: Mon, 17 Jun 1991 22:10
15 lines
1420 bytes
1420 bytes
For obscure reasons, I have written a program that replaces the window function defined in window class "#32770" (a window class defined by USER.EXE). In effect, this puts my own callback function in the chain for many Windows dialog boxes. To accomplish this, I defined and exported a window callback function, created a dummy window of class "#32770", did a SetClassLong to poke in the address of my callback function (using MakeProcInstance, of course), then deleted the dummy window. This is fine and dandy and everything works as expected except for one small fact: when my callback function gets invoked, the data segment is set correctly, but the stack segment seems to belong to the application who put up the window (SS != DS). I made my application work simply by not depending on SS == DS, but what gives? How could my callback function get called with my data segment and someone else's stack? It's not a DLL, just a simple program.
Technical Details
Message-ID:
<c5HP41w163w@burklabs>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!stanford.edu!agate!spool.mu.edu!mips!cs.uoregon.edu!ogicse!milton!sumax!polari!rwing!seaeast!burklabs!ronbShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!stanford.edu!agate!spool.mu.edu!mips!cs.uoregon.edu!ogicse!milton!sumax!polari!rwing!seaeast!burklabs!ronb From: ronb@burklabs (Ron Burk ) Newsgroups: comp.windows.ms.programmer Subject: Hacking The Dialog Class Message-ID: <c5HP41w163w@burklabs> Date: 17 Jun 91 22:10:35 GMT Organization: Burk Labs, Redmond WA Lines: 15