Path: 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: Date: 17 Jun 91 22:10:35 GMT Organization: Burk Labs, Redmond WA Lines: 15 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.