예제 #1
0
파일: NativeWindow.cs 프로젝트: korewa/Ren
        public NativeWindow(bool isDesignMode)
        {
            if (isDesignMode)
            {
                return;
            }

            ClassName = $"{nameof(NotifyIcon)}-{DateTime.Now.Ticks}";

            _messageReceiver = OnMessageReceived;

            _creationMessage = Native.RegisterWindowMessageW("TaskbarCreated");

            var windowClass = new WindowClassEx()
            {
                cbSize = (uint)Marshal.SizeOf(typeof(WindowClassEx)), lpszClassName = ClassName, lpfnWndProc = _messageReceiver
            };

            Native.RegisterClassExW(ref windowClass);

            Handle = Native.CreateWindowExW(0, ClassName, string.Empty, 0, 0, 0, 0, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
        }
예제 #2
0
파일: Native.cs 프로젝트: korewa/Ren
 public static extern ushort RegisterClassExW(
     [In] ref WindowClassEx lpwcx);