private static void RegisterWindowClass() { WindowClassEx classEx = new WindowClassEx(); classEx.ClassName = MessageWindowClassName; classEx.WndProc = wndProc; classEx.Size = (uint)Marshal.SizeOf(typeof(WindowClassEx)); var atom = ShellObjectWatcherNativeMethods.RegisterClassEx(ref classEx); if (atom == 0) { throw new ShellException(LocalizedMessages.MessageListenerClassNotRegistered, Marshal.GetExceptionForHR(Marshal.GetHRForLastWin32Error())); } _atom = atom; }
public static extern uint RegisterClassEx( ref WindowClassEx windowClass );