Beispiel #1
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            if (PlatformYardımcısı.MonodaÇalışıyor)
            {
                return;
            }

            if (PlatformYardımcısı.VistaYadaÜstü)
            {
                NativeMethods.SetWindowTheme(this.Handle, "explorer", null);
            }

            if (PlatformYardımcısı.XpYadaÜstü)
            {
                NativeMethods.SendMessage(this.Handle, WM_CHANGEUISTATE,
                                          NativeMethodsHelper.MakeLong(UIS_SET, UISF_HIDEFOCUS), 0);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Raises the <see cref="E:HandleCreated" /> event.
        /// </summary>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            if (PlatformHelper.RunningOnMono)
            {
                return;
            }

            if (PlatformHelper.VistaOrHigher)
            {
                // set window theme to explorer
                NativeMethods.SetWindowTheme(this.Handle, "explorer", null);
            }

            if (PlatformHelper.XpOrHigher)
            {
                // removes the ugly dotted line around focused item
                NativeMethods.SendMessage(this.Handle, WM_CHANGEUISTATE,
                                          NativeMethodsHelper.MakeLong(UIS_SET, UISF_HIDEFOCUS), 0);
            }
        }