static HwndSubclass() { DetachMessage = UnsafeNativeMethods.RegisterWindowMessage("HwndSubclass.DetachMessage"); // Go find the address of DefWindowProc. IntPtr hModuleUser32 = UnsafeNativeMethods.GetModuleHandle(ExternDll.User32); IntPtr address = UnsafeNativeMethods.GetProcAddress(new HandleRef(null, hModuleUser32), "DefWindowProcW"); DefWndProc = address; }
static HwndWrapper() { s_msgGCMemory = UnsafeNativeMethods.RegisterWindowMessage("HwndWrapper.GetGCMemMessage"); }