Example #1
0
 static Control()
 {
     NativeMethods.INITCOMMONCONTROLSEX init_struct = new NativeMethods.INITCOMMONCONTROLSEX();
     init_struct.dwSize = Marshal.SizeOf <NativeMethods.INITCOMMONCONTROLSEX>();
     init_struct.dwICC  = 0xFFFF;
     NativeMethods.InitCommonControlsEx(ref init_struct);
 }
Example #2
0
 protected override void CreateHandle()
 {
     if (!this.RecreatingHandle)
     {
         NativeMethods.INITCOMMONCONTROLSEX icc = new NativeMethods.INITCOMMONCONTROLSEX();
         icc.dwICC = NativeMethods.ICC_BAR_CLASSES | NativeMethods.ICC_COOL_CLASSES;
         UnsafeNativeMethods.InitCommonControlsEx(icc);
     }
     base.CreateHandle();
 }
Example #3
0
 /// <summary>
 /// Creates a handle for the control.
 /// Init CommonControls
 /// </summary>
 protected override void CreateHandle()
 {
     if (!this.RecreatingHandle && (!InitCC))
     {
         NativeMethods.INITCOMMONCONTROLSEX ic = new NativeMethods.INITCOMMONCONTROLSEX();
         ic.dwSize = Marshal.SizeOf(typeof(NativeMethods.INITCOMMONCONTROLSEX));
         ic.dwICC  = (int)NativeMethods.IPAMess.ICC_INTERNET_CLASSES;
         InitCC    = NativeMethods.InitCommonControlsEx(ic);
     }
     base.CreateHandle();// -> invoke CreateParams
 }
Example #4
0
		protected override void CreateHandle()
		{
			if (!this.RecreatingHandle)
			{
				NativeMethods.INITCOMMONCONTROLSEX icex = new NativeMethods.INITCOMMONCONTROLSEX();
				icex.Size = Marshal.SizeOf(typeof(NativeMethods.INITCOMMONCONTROLSEX));
				icex.Flags = NativeMethods.ICC_BAR_CLASSES | NativeMethods.ICC_COOL_CLASSES;
				NativeMethods.InitCommonControlsEx(icex);
			}

			base.CreateHandle();
		}
Example #5
0
 protected override void CreateHandle()
 {
     if (!RecreatingHandle)
     {
         NativeMethods.INITCOMMONCONTROLSEX iccex = new NativeMethods.INITCOMMONCONTROLSEX {
             dwSize = Marshal.SizeOf(typeof(NativeMethods.INITCOMMONCONTROLSEX)),
             dwICC  = NativeMethods.ICC_INTERNET_CLASSES
         };
         NativeMethods.InitCommonControlsEx(ref iccex);
     }
     base.CreateHandle();
 }
Example #6
0
 protected override void CreateHandle()
 {
     if (!RecreatingHandle)
     {
         IntPtr userCookie = NativeCOM.ThemingScope.Activate();
         try
         {
             NativeMethods.INITCOMMONCONTROLSEX icc = new NativeMethods.INITCOMMONCONTROLSEX();
             icc.dwICC = NativeMethods.ICC_BAR_CLASSES;
             UnsafeNativeMethods.InitCommonControlsEx(icc);
         }
         finally
         {
             NativeCOM.ThemingScope.Deactivate(userCookie);
         }
     }
     base.CreateHandle();
 }
Example #7
0
 private void CreateHandle()
 {
     if (!this.IsHandleCreated)
     {
         NativeMethods.INITCOMMONCONTROLSEX initcommoncontrolsex1 = new NativeMethods.INITCOMMONCONTROLSEX();
         initcommoncontrolsex1.dwICC = 8; // ICC_TAB_CLASSES : Load tab and ToolTip control classes.
         NativeMethods.InitCommonControlsEx(initcommoncontrolsex1);
         this.m_window.CreateHandle(this.CreateParams);
         NativeMethods.SetWindowPos(new HandleRef(this, this.Handle), NativeMethods.HWND_TOPMOST, 0, 0, 0, 0, NativeMethods.SWP_NOACTIVATE | NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOSIZE);
         NativeMethods.SendMessage(new HandleRef(this, this.Handle), NativeMethods.TTM_SETMAXTIPWIDTH, 0, SystemInformation.MaxWindowTrackSize.Width);
         NativeMethods.SendMessage(new HandleRef(this, this.Handle), NativeMethods.TTM_ACTIVATE, 1,0);
     }
 }
Example #8
0
 public static extern bool InitCommonControlsEx(NativeMethods.INITCOMMONCONTROLSEX icc);
            protected override void CreateHandle()
            {
                var icc = new NativeMethods.INITCOMMONCONTROLSEX();
                icc.dwICC = NativeMethods.ICC_TAB_CLASSES;
                NativeMethods.InitCommonControlsEx(icc);

                base.CreateHandle();
                if (IsHandleCreated)
                {
                    var ti = new NativeMethods.TOOLINFO();
                    ti.SetSize();
                    ti.uFlags = NativeMethods.TTF_IDISHWND | NativeMethods.TTF_TRANSPARENT;
                    ti.hwnd = myParent.Handle;
                    ti.uId = (int)ti.hwnd;
                    ti.lpszText = NativeMethods.LPSTR_TEXTCALLBACK;

                    NativeMethods.SendMessage(base.Handle, NativeMethods.TTM_ADDTOOL, 0, ref ti);
                    NativeMethods.SendMessage(base.Handle, NativeMethods.TTM_SETDELAYTIME, NativeMethods.TTDT_RESHOW, 0);
                }
            }
Example #10
0
 /// <summary>
 ///     Control.CreateHandle override. Ensures that the common controls dll is loaded.
 /// </summary>
 protected override void CreateHandle()
 {
     var icc = new NativeMethods.INITCOMMONCONTROLSEX();
     icc.dwICC = NativeMethods.ICC_LISTVIEW_CLASSES;
     NativeMethods.InitCommonControlsEx(icc);
     base.CreateHandle();
 }