Page 1 of 97 12341151 ... LastLast
Results 1 to 40 of 3853

Thread: CommonControls (Replacement of the MS common controls)

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    CommonControls (Replacement of the MS common controls)

    This project is intended to replace the MS common controls for VB6.

    The "MSCOMCTL.OCX" (respectively "COMCTL32.OCX") can be replaced completly.
    The "MSCOMCT2.OCX" (respectively "COMCT232.OCX") can be replaced completly.
    The "RICHTX32.OCX" can be replaced completly.
    The "COMDLG32.OCX" can be replaced completly.
    The "COMCT332.OCX" can be replaced completly.
    The "MCIWNDX.OCX" (shipped with VB5) can be replaced completly.
    The "SYSINFO.OCX" can be replaced completly.

    Following controls are available at the moment:

    - Animation
    - CheckBoxW
    - ComboBoxW
    - CommandButtonW
    - CommandLink
    - CoolBar
    - CommonDialog (Class Module)
    - DTPicker
    - FontCombo
    - FrameW
    - HotKey
    - ImageCombo
    - ImageList
    - IPAddress
    - LabelW
    - LinkLabel
    - ListBoxW
    - ListView
    - MCIWnd
    - MonthView
    - OptionButtonW
    - Pager
    - ProgressBar
    - RichTextBox
    - Slider
    - SpinBox
    - StatusBar
    - SysInfo
    - TabStrip
    - TextBoxW
    - ToolBar
    - TreeView
    - UpDown
    - VirtualCombo
    - VListBox
    - WindowedLabel

    Unicode is supported for all the stated controls. Also these are full DPI-Aware and ready for 64-bit.

    At design-time (IDE) there is only one dependency. (OLEGuids.tlb)
    This is a modified version of the original .tlb from the vbaccelerator website.
    But for the compiled .exe there are no dependencies, because the .tlb gets then compiled into the executable.

    Everything should be self explained, because all functions and properties have a description.

    The source code of the project can also be viewed on GitHub.

    This Demo shows of how to make the ToolBar control accessible per shortcut key on a MDIForm.

    This Demo shows of how to use the ImageCombo control as a DriveCombo. (Replacement of the DriveListBox control)

    ActiveX Control version, together with a Registration-Free (Side-by-side) solution:
    Version 1.8

    Thanks to MountainMan for the
    Documentation and Update/Compile Utility

    Notes:
    - When using the SetParent or MoveWindow API, pass .hWndUserControl and not .hWnd.
    - When changing the "Project Name", have all forms open, else all properties are lost. Because the library to which the controls are referring to is the "Project Name" itself. Having all forms open will ensure that the .frx files will be updated with the new "Project Name".

    List of revisions:
    Code:
    26-Sep-2024
    - Bugfix in the Text property (vbNullString) in the ImageCombo control.
    18-Sep-2024
    - The picture of the panels now considered in the internal SetMinHeight method in the StatusBar control.
      To "auto size" just set the .Height to 0. (e.g. after removing the pictures)
      The same you would do when changing from a large to a small font.
    17-Sep-2024
    - Bugfix that the Text property was not the default property in the SbrPanel object.
    - Included the PictureOnRight property of a Panel in the StatusBar control.
    - The Picture of a Panel will now be drawn embossed when the Enabled property is False in the StatusBar control.
      Also the grayed text is now drawn using TextOut instead of DrawState for standard VB-ish appearance.
    - Bug in the internal ReCreateToolBar method that the button menus picture property was not restored.
    14-Sep-2024
    - Bugfix in the internal DrawPanel method in the StatusBar control.
    09-Sep-2024
    - The height of the header will now be adjusted according to ColumnHeaderIcons in the ListView control. (like MS ListView)
    06-Sep-2024
    - UndoLimit now capped at 1000 in the RichTextBox control.
    23-Aug-2024
    - Internal improvement in the ToolBar/CoolBar control.
    - MaxTextRows property is now allowed to be set to 0 in the ToolBar control.
    11-Aug-2024
    - All Transparent properties improved to use LAYOUT_RTL on the memory DC, if applicable. (parent)
    09-Aug-2024
    - Bugfix in the VirtualItemCount property to add flag LVSICF_NOSCROLL. (same behavior as in non-virtual mode)
      That flag was meant to fix LVM_SETITEMCOUNT as of IE 3.0.
      LVSICF_NOINVALIDATEALL was not added intentionally because the underlying data could be changed for the current page as well.
    01-Aug-2024
    - Improved the HDN_DROPDOWN handler to remove any WM_LBUTTONDOWN/WM_LBUTTONDBLCLK message
      afterwards for the header window only so that we can get a toggle effect on the split button.
      This is exactly the same as the Button/ToolbarWindow32 window does for BCN_DROPDOWN/TBN_DROPDOWN. Bug in the SysListView32?
      The improvement is most useful when showing a popup menu as drop-down.
    26-Jul-2024
    - LB_SETTABSTOPS now cached in the VListBox control to replicate MS ListBox behavior.
      The ListBoxW control also caches these in case the Style property is 1 - Checkbox or 2 - Option.
      When an app is not using LB_SETTABSTOPS then the defaults are in use and no difference therefore.
    25-Jul-2024
    - Bugfix that the Text property was not the default property in the LvwListSubItem object.
    19-Jul-2024
    - Use of GetTabbedTextExtent instead of GetTextExtentPoint32 for the GetIdealHorizontalExtent function in the ListBoxW/VListBox control.
      When the UseTabStops property is False then GetTextExtentPoint32 is used.
    24-Jun-2024
    - Support for adding an .Image object from a PictureBox to the CoolBar/CbrBand/TbrButtonMenu.
      Prior to this update the .Image object needed to be persisted into the .Picture property of the PictureBox.
    22-Jun-2024
    - Use of integer division \ instead of double division / where applicable.
      This does not mean that \ was never used, just all division operators got reviewed.
    29-May-2024
    - Bugfix that setting SelectedItem to Nothing will not fire Click event, if index changed, in the ImageCombo control.
    25-May-2024
    - Improved the ImageList (Variant) property on each control to accept a handle value. (hImageList)
      This can be convenient to apply a system image list for example.
      To note is that a key (string) image index will then fail in this case of course.
    08-May-2024
    - Support for WMF/DIB/EMF/BMP and FileNameW clipboards in the PasteSpecialDlg method in the RichTextBox control.
    05-May-2024
    - Included the PasteSpecialDlg method in the RichTextBox control.
      Ctrl+Alt+V shortcut now invokes the paste special dialog box.
      The AutoVerbMenu is added with a paste special menu entry.
    01-May-2024
    - Included the hMenu run-time property in the TbrButton object.
      Returns/sets a handle to a popup menu which will be used as a button dropdown menu.
      This is useful when a menu with submenus is needed.
    - Included ButtonMenuClick2 event in the ToolBar control.
    28-Apr-2024
    - ClientWidth/ClientHeight property now Let-able in the TabStrip control.
    23-Apr-2024
    - Included the Span/UpTo method in the RichTextBox control. (richtx32.ocx compatibility)
    20-Apr-2024
    - Included optional wFormat for the CanPaste function.
    - Localized strings for the AutoVerbMenu.
    18-Apr-2024
    - Ctrl+Alt+V shortcut changed to Ctrl+Shift+V as this is common for Me.PasteSpecial CF_UNICODETEXT.
      Menu text changed from 'Paste Special' to 'Paste as plain text'.
      Ctrl+Alt+V should be reserved for a paste special dialog box to choose a format. (like Wordpad)
    17-Apr-2024
    - Included the AutoVerbMenu in the RichTextBox control.
      Ctrl+Alt+V shortcut does now a paste special.
    12-Apr-2024
    - Included the Resize event in the FrameW control. (like the VB.Picture control)
      A control container should have such event to re-arrange it's contained controls.
      However, the VB.Frame control does not have it.
    10-Apr-2024
    - Included the AlwaysFindExact property in the ComboBoxW/FontCombo/VirtualCombo control. (LB_FINDSTRING -> LB_FINDSTRINGEXACT)
      This also changes the behavior of automatically selecting an item when the user drops down the list of the control.
    23-Mar-2024
    - Accelerator keys support in a VBA environment. (PreTranslateMsg)
    07-Feb-2024
    - Included the BorderStyle property in the ProgressBar control.
    30-Jan-2024
    - Included the OLEDragDropScrollOrientation property in the ListView control.
    24-Jan-2024
    - Included the AllowDropFiles property and DropFiles event in the ListView control.
    - Included the Transparent property in the TabStrip control.
    21-Jan-2024
    - Included the OLEDragMode property in the RichTextBox control.
    18-Jan-2024
    - CoolBar control accepts now child objects that do not expose a hWnd property.
      New function GetWindowFromObject in VTableHandle.bas.
    17-Jan-2024
    - Included the MousePointer property in the UpDown control. (not exist in MS UpDown)
    - DownClick/UpClick for UpDown/SpinBox now fires upon WM_CAPTURECHANGED where
      cached delta value on UDN_DELTAPOS decided if down or up click. (like MS UpDown)
      ByRef Delta on BeforeChange event copied back to iDelta of the NMUPDOWN structure upon UDN_DELTAPOS.
    16-Jan-2024
    - Final bugfix in the UserControl_Resize for the ImageCombo control. (regression 18-Dec-2023)
    - MousePointer covers now the whole SpinBox. (incl. border and up down control)
      Also bugfix in the MouseTrack property as WM_NCMOUSEMOVE was not covered.
      WM_NCLBUTTONDOWN will set focus for the edit control as the border of the up down control does also.
    15-Jan-2024
    - Fixed focus issue for the up down button in the DTPicker control.
    14-Jan-2024
    - Improvement in the BuddyControl property in the UpDown control.
    10-Jan-2024
    - Bugfix for WM_LBUTTONDOWN/WM_RBUTTONDOWN handler on ListView/TreeView/ImageCombo control.
      Those windows controls do have an internal DragDetect modal message loop.
    08-Jan-2024
    - Update of edit text when changing list index by code in the VirtualCombo control.
      This is needed due to missing CBS_HASSTRINGS and set of LBS_NODATA. (which is correct so)
      It now also handles LB_FINDSTRINGEXACT message in the WindowProcList.
    06-Jan-2024
    - Included the CueBannerAlways property in the TextBoxW control.
    - "Object.Default" not written anymore to the property bag in CommandButtonW/CommandLink control.
    - The Default and Cancel property are now also available when setting to a shadow object. ('Set' command)
      Affected are only the CommandButtonW/CommandLink control.
    03-Jan-2024
    - Included the AllowDropFiles property and DropFiles event in the ListBoxW control.
    02-Jan-2024
    - Bugfix in the UserControl_Resize in the ComboBoxW/FontCombo/VirtualCombo/ImageCombo control. (regression 18-Dec-2023)
    01-Jan-2024
    - Included the WindowedLabel control.
    31-Dec-2023
    - Const VARIANT_CB now 24 instead of 16 for Win64.
    29-Dec-2023
    - Included the SingleLine property in the LabelW control.
    28-Dec-2023
    - Included the Resize event in the ToolBar control. (like in the CoolBar control)
    - Included the MimicTextBox property in the LabelW control. (DT_EDITCONTROL)
    22-Dec-2023
    - Included AllowDropFiles property in the RichTextBox/TextBoxW control.
    - Included DropFiles event in the TextBoxW control.
    20-Dec-2023
    - Included the DropFiles event in the RichTextBox control. (EN_DROPFILES)
    19-Dec-2023
    - Included OLEDragDropScroll/OLEDropMode and related UserControl events in the RichTextBox control.
      Renamed OLEDragDrop to OLEDragDropRTF. OLEDragDropRTF is the auto-mode by rich edit control.
    18-Dec-2023
    - Adjustment needed in the UserControl_Resize in the ComboBoxW/FontCombo/VirtualCombo/ImageCombo control. (regression 10-Dec-2023)
    10-Dec-2023
    - Improvement in the internal CheckDropDownHeight method in the ComboBoxW/FontCombo/VirtualCombo/ImageCombo control to match MS control on edge cases.
    11-Nov-2023
    - RichTextBox/LinkLabel now react upon WM_PAINT where wParam is a hDC.
    05-Nov-2023
    - CoolBar/ToolBar/TabStrip/StatusBar control now redirects to WM_PRINT (PRF_CLIENT Or PRF_ERASEBKGND) upon WM_PAINT when wParam is <> 0.
    - All Transparent properties improved to use GetParent() instead of .ContainerHwnd.
    24-Oct-2023
    - OLEDragDropScroll property now adds the scroll bar sizes for the auto scroll margin.
    22-Oct-2023
    - Proper error raising for mis-use of the ImageList/BuddyControl property on all controls.
    - Proper error raising for mis-use in the BackColor property of the ImageList control.
    09-Oct-2023
    - TabStrip's ClientLeft/ClientTop now matches to VBA and to VBFlexGrid. (CellLeft/ClientLeft etc.)
      So use .Left + .ClientLeft instead of just .ClientLeft for positioning from a container.
    06-Sep-2023
    - Passing vbNullString to the Let .List(i) property of the ComboBoxW/ListBoxW control does not cause an misbehavior anymore.
    - WM_CHAR now blocked in the list control if the Locked property is true in the ComboBoxW/FontCombo/VirtualCombo/ImageCombo control.
    25-Jul-2023
    - ODS_HOTLIGHT added to the OwnerDraw event in the CommandButtonW/CheckBoxW/OptionButtonW.
      Condition is that the MouseTrack property is set to True.
    08-Jul-2023
    - Fixed const FR_HIDEMATCHCASE.
    07-Jul-2023
    - Modified OLEGuids.tlb as following: (compiled with same uuid)
      - replaced LPSTR and LPWSTR to LONG StrPtr() to get compatibility with x64 OLEGuids twinBASIC package.
      Unregister to old OLEGuids.tlb is not necessary, just overwrite the file.
    06-Jul-2023
    - Changing font for ProgressBar will cause an invalidation when a Text property is set.
    02-Jul-2023
    - PtInRect/LBItemFromPt/WindowFromPoint/DragDetect API and code adaptions so it can be migrated to x64 more easily.
    17-May-2023
    - Support of icons and metafiles for the Picture property in the TbrButtonMenu of the ToolBar control.
      Selecting such a picture file (design-time) will show a warning message that the menu theme will be removed. (HBMMENU_CALLBACK)
    16-May-2023
    - Usage of MIM_MENUDATA for TbrButtonMenus in the ToolBar control.
      dwMenuData contains the ObjPtr() of the TbrButtonMenu.Parent. (TbrButton object)
      This can be helpful in a WM_INITMENUPOPUP subclass to get a TbrButton of that menu handle.
    11-May-2023
    - Removed TPM_NONOTIFY for TbrButtonMenus in the ToolBar control.
      This allows to subclass for WM_INITMENUPOPUP where wParam is the menu handle.
    10-May-2023
    - Included the Picture property in the TbrButtonMenu of the ToolBar control.
      It supports 32bpp alpha bitmaps, but no icons. (MIIM_BITMAP)
      Usage of MIIM_STRING instead of MIIM_TYPE/MFT_STRING for TbrButtonMenu.
    14-Apr-2023
    - Bugfix that the caret is not scrolled into view on SelStart/SelLength in the TextBoxW/RichTextBox control.
    11-Jan-2023
    - Unnecessary usage/variable of GetTopUserControl() removed in the ListView and SpinBox control.
    10-Sep-2022
    - Bugfix in the RightToLeft property in the RichTextBox control.
    30-Aug-2022
    - Critical bugfix in the StatusBar that the DrawState API is not allowed anymore to have lData as 0.
    26-Aug-2022
    - Improved the popup menu in the ToolBar to send WM_CANCELMODE upon recursive invocation.
      This is useful in the .ContainerKeyDown function to close the popup menu when it's already dropped down.
    22-Aug-2022
    - Minor internal improvement in the StatusBar control.
    15-Aug-2022
    - Exit Property for same value in the Text property of a Panel in the StatusBar control.
    27-Jun-2022
    - Bugfix in the internal OLEDragOver in the ListView control for report view.
    22-Jun-2022
    - Bugfix in the WM_NCPAINT handler for a themed RichTextBox that scrollbars are not drawn.
    30-May-2022
    - Support for adding an .Image object from a PictureBox to an ImageList.
      Prior to this update the .Image object needed to be persisted into the .Picture property of the PictureBox.
    18-Feb-2022
    - Included [_Default] property in ComboBoxW/FontCombo/VirtualCombo/ImageCombo.
    - Included the GetTextRange property in the RichTextBox control.
    04-Nov-2021
    - FilterBar now receives focus in the ListView control on an MDI child form when the previous control was an intrinsic VB.CommandButton.
      Reason is a unknown message &H105A pending on the MDI host form which brings focus back to the ActiveControl.
    26-Oct-2021
    - Bugfix on LvwListItems.Remove that no error was thrown for an non-existent numeric index.
      For a string index/key an error was already thrown.
    25-Oct-2021
    - Internal improvements in the UpDown control.
    - Included ES_AUTOHSCROLL for the edit window in the SpinBox control.
    22-Oct-2021
    - RichTextBox improvement when changing the RightToLeft property at run-time and when TextMode is RTF.
      It will not stream RTF out before re-create and not stream RTF in afterwards. This way the \rtlpar is properly in place.
    - Default value for MaxDate property in the DTPicker/MonthView control changed to 31-Dec-9999. (instead of 01-Jan-3000)
    13-Oct-2021
    - Included the run-time (read-only) TextLength property for the TextBoxW and RichTextBox control.
    - The RichTextBox control now uses EM_GETTEXTEX/EM_SETTEXTEX instead of EM_STREAMOUT/EM_STREAMIN for the Text property.
    - Included the UseCrLf property in the RichTextBox control.
      It defaults to False (compatibility break in VBCCR) but fixes the Text to match to internal positions.
      This affects the Text and TextLength property. (GT_USECRLF/GTL_USECRLF)
    07-Sep-2021
    - Fixed GDI leaks for DTPickerCalendarFontHandle, LinkLabelUnderlineFontHandle and ProgressBarFontHandle.
    04-Sep-2021
    - Bugfix in the internal CreatePrintJob method in the RichTextBox concerning the printing margins.
    10-Aug-2021
    - Removal of EM_EXLIMITTEXT (Flags = SF_RTF) in internal StreamStringIn/StreamFileIn in the RichTextBox control.
      It was probably put there by error or by misunderstanding of the MSDN documentation.
    05-Aug-2021
    - Small bugfix in the PPCoolBarBands that child controls can be in the list that have no window handle. (e.g. Label)
      This bug occured only when there were other child controls that have a window handle.
    24-Jul-2021
    - DrawStyle vbSolid now only when Single BorderStyle is set, otherwise it is vbInvisible. (refer to 21-Jul-2021 and 26-Mar-2021 update)
    21-Jul-2021
    - Bugfix in the LabelW control that the Single BorderStyle was not drawn anymore as of 26-Mar-2021 update.
    15-Jul-2021
    - Bugfix in the Text property of a Panel in the StatusBar control. (no immediate update of internal DisplayText)
    08-Jun-2021
    - CommandButtonW/CheckBoxW/OptionButtonW (vbButtonGraphical) can now render 32bpp alpha bitmaps and icons.
    04-Jun-2021
    - PPCoolBarBands can be switched now between CoolBars at design-time without issues.
    - PPStatusBarPanels can be switched now between StatusBars at design-time without issues.
    - PPToolBarButtons can be switched now between ToolBars at design-time without issues.
    29-May-2021
    - PPTabStripTabs can be switched now between TabStrips at design-time without issues.
    - PPImageListImages can be switched now between ImageLists at design-time without issues.
    23-May-2021
    - Improvement in the WM_SETCURSOR in the CoolBar control.
      This ensures the cursor handling for the child controls can walk up the chain properly.
    15-May-2021
    - Bugfix in the UseChevron property of a Band in the CoolBar control.
      The .CXHeader member (RBBIM_HEADERSIZE) will now be reset (= -1) whenever the property is set.
    - RP_CHEVRON/RP_CHEVRONVERT now included in the 'ImplementThemedReBarFix'.
    12-Apr-2021
    - Internal improvement in the StatusBar control.
    26-Mar-2021
    - UserControl.DrawStyle set to 5 = Transparent to avoid a wasted/unused GDI pen handle.
    17-Mar-2021
    - Improved CreateGDIFontFromOLEFont function.
    15-Mar-2021
    - HotTracking property improved in the ListView control.
    01-Mar-2021
    - Harmonization in the ContextMenu events. The X and Y parameters are now always originated to the control's hWnd.
      Problem was in some controls which have child windows, resulted in confusing X and Y parameters.
    19-Feb-2021
    - Bugfix in the NodeClick/NodeDblClick event in the TreeView control.
      Prior to this update it fired whenever hItem is <> 0.
      Now it fires only when when in addition the hit-test flags are TVHT_ONITEMICON or TVHT_ONITEMLABEL. (like the MS TreeView does)
    - Improved the Nodes.Clear method in the TreeView control.
      The selected item is now removed before clearing to have no unnecessary TVN_SELCHANGING/TVN_SELCHANGED notifications.
    18-Feb-2021
    - Bugfix in the Left/Width property (Get) of a Panel in the StatusBar control.
    
    [...]
    
    11-Nov-2012
    - First release.
    Name:  ComCtlsDemo.jpg
Views: 536
Size:  109.6 KB

    Warning: This Std-EXE version here is not really IDE-Safe as the design-time (form designer) user control subclassing (AddressOf pointer) can just become invalid when the IDE wants to. It is recommended to use the OCX version.
    Attached Files Attached Files
    Last edited by Krool; Sep 27th, 2024 at 05:22 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: CommonControlsEx (Replacement of the MS common controls)

    What is the benefit of using these over the existing controls?

    Does each control have the same properties? Do they have new properties?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    The benefit is that these controls are linked to the comctl32.dll, that means they support the latest API calls, functions, properties and visual styles (themes).

    The existing common controls 6.0 from MS are not linked to the comctl32.dll, so they doesn't support the visual styles (themes).
    Reason why: The controls of the comct32.dll are compiled directly into the common controls 6.0 from MS, but as of state of a old version of comctl32.dll

    Only the common controls 5.0 from MS are linked to the comctl32.dll, but the COM hull is very old and so they have a leak of the latest functions and properties. Also controls like the DTPicker, MonthView or UpDown are not included.
    Last edited by Krool; Feb 28th, 2014 at 12:59 PM.

  4. #4
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    The benefit is that these controls are linked to the comctl32.dll, that means they support the latest API calls, functions, properties and visual styles (themes).

    The existing common controls 6.0 from MS are not linked to the comctl32.dll, so they doesn't support the visual styles (themes).
    Reason why: The controls of the comct32.dll are compiled directly into the common controls 6.0 from MS, but as of state of a old version of comctl32.dll

    Only the common controls 5.0 from MS are linked to the comctl32.dll, but the COM hull is very old and so they have a leak of the latest functions and properties. Also controls like the DTPicker, MonthView or UpDown are not included.
    Can you please change the OLEGuids.tlb to a new name to avoid conflicts with my existing OLEGuids.tlb in system32 folder?

  5. #5
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Thumbs up Re: CommonControlsEx (Replacement of the MS common controls)

    Excellent work!

    Quote Originally Posted by Hack View Post
    What is the benefit of using these over the existing controls?

    Does each control have the same properties? Do they have new properties?
    In addition to what Krool stated, some folks, myself included, prefer that their apps have no dependencies whatsoever.

    The controls have most of the necessary (similarly named) properties and methods and many of them have some new ones as well (the VisualStyles property for instance).

    Quote Originally Posted by Jonney View Post
    Can you please change the OLEGuids.tlb to a new name to avoid conflicts with my existing OLEGuids.tlb in system32 folder?
    Open CommonControlsEx.vbp in any text editor and edit this line:

    Code:
    Reference=*\G{5B1EACE0-EDEB-11E1-AFF1-0800200C9A66}#1.0#0#..\..\..\..\WINDOWS\system32\OLEGuids.tlb#OLE Guid and interface definitions
    to:

    Code:
    Reference=*\G{5B1EACE0-EDEB-11E1-AFF1-0800200C9A66}#1.0#0#OLEGuids\OLEGuids.tlb#OLE Guid and interface definitions
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Jonney View Post
    Can you please change the OLEGuids.tlb to a new name to avoid conflicts with my existing OLEGuids.tlb in system32 folder?
    You can just rename the file "OLEGuids.tlb" at your own, for example to "OLEGuids2.tlb"
    That is no problem, because the uuid and library name differs from the original. They can co-exist without conflicts.
    You just need to re-register it in the IDE. (Project -> References... -> Browse for file)
    Last edited by Krool; Nov 12th, 2012 at 01:18 PM.

  7. #7
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    You can just rename the file "OLEGuids.tlb" at your own, for example to "OLEGuids2.tlb"
    That is no problem, because the uuid and library name differs from the original. They can co-exist without conflicts.
    You just need to re-register it in the IDE. (Project -> References... -> Browse for file)
    Thanks. I understood.
    If you can add Unicode support, then those control can be used on PC with whatever locale setting.
    How about others control built by CreateWindowEx such as Listview/Treeview? Listview support more new features such as Grouping now.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:02 AM.

  9. #9
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: CommonControlsEx (Replacement of the MS common controls)

    Thanks for the update!
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.

    All controls support now Unicode and some other minor improvements are done.
    Last edited by Krool; Dec 15th, 2012 at 12:24 PM.

  11. #11
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.

    All controls support now Unicode and some other minor improvements are done.
    Fairly support Unicode.
    But because of nature of MS BUTTON, it doesn't an unicode compatible control.
    Never mind, just leave this because it's hard to fully support Unicode for a Command button.

    DrawText hDC, StrPtr(Button.Caption), -1, RectText, DT_CALCRECT Or DT_WORDBREAK
    Button.Caption can never be held Unicode string, internal conversion has been done before you call DrawTextW.

  12. #12
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Jonney View Post
    Button.Caption can never be held Unicode string, internal conversion has been done before you call DrawTextW.
    This function will retrieve any button's caption, even if VB displays their Unicode captions as ?????.

    Code:
    Private Declare Function DefWindowProcW Lib "user32.dll" (ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    
    Private Function GetCaption(ByRef oButton As Object) As String
        Const WM_GETTEXT = &HD&, WM_GETTEXTLENGTH = &HE&
        Dim Button_hWnd As Long
    
        On Error GoTo 1
        Button_hWnd = oButton.hWnd
        GetCaption = Space$(DefWindowProcW(Button_hWnd, WM_GETTEXTLENGTH, 0&, 0&))
        DefWindowProcW Button_hWnd, WM_GETTEXT, Len(GetCaption) + 1&, StrPtr(GetCaption)
    1   On Error GoTo 0
    End Function
    VB's Button controls (CommandButton, CheckBox or OptionButton) can actually contain Unicode captions (via DefWindowProcW + WM_SETTEXT). VB doesn't display them properly though.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:04 AM.

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:06 AM.

  15. #15

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:09 AM.

  16. #16
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    Re: CommonControlsEx (Replacement of the MS common controls)

    Thanks for including the StatusBar control!
    Last edited by Bonnie West; Mar 1st, 2013 at 04:52 PM.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  17. #17

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:12 AM.

  18. #18

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Dec 15th, 2012 at 11:16 AM.

  19. #19

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.

  20. #20
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.
    Thank you for consistent update.

  21. #21
    gibra
    Guest

    Re: CommonControlsEx (Replacement of the MS common controls)

    Good Work!

  22. #22
    Lively Member
    Join Date
    Jun 2010
    Posts
    68

    Re: CommonControlsEx (Replacement of the MS common controls)

    its really an amazing work,god bless you.Bro can you add listview and treeview with displayable unicode support?
    it will great achievment if it possible

  23. #23
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Edited: Remove my Post regarding Balloon tooltips, Win8 has fixed the problem.
    Last edited by Jonney; Jan 26th, 2013 at 10:33 AM.

  24. #24
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Confirmed it is OS problem. The balloon tooltips works perfect on Win8.

    Edited: CommonControlsEx works On Win8.
    Last edited by Jonney; Jan 18th, 2013 at 02:32 AM.

  25. #25

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Update released.

    ListView control is added.

    Groups and 'Tile' View are for the moment not included.
    It can replace 100% the ListView from „MSCOMCTL.OCX". (Exception: ToolTipText of the ListSubItems)
    But it has also many properties, methods and events more than the original.
    Last edited by Krool; Feb 3rd, 2013 at 03:17 PM.

  26. #26
    Frenzied Member
    Join Date
    Jan 2010
    Posts
    1,103

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Krool View Post
    Update released.

    ListView control is added.

    Groups and 'Tile' View are for the moment not included.
    It can replace 100% the ListView from „MSCOMCTL.OCX". (Exception: ToolTipText of the ListSubItems)
    But it has also many properties, methods and events more than the original.
    Thank you for additional Listview.
    From Vista/Win7,MS added lots of new features into Listview, such as enhanced grouping, Checkbox on Header,etc.
    Please consider adding checkbox and Text Edit for subitems.

  27. #27

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControlsEx (Replacement of the MS common controls)

    Quote Originally Posted by Jonney View Post
    Please consider adding checkbox and Text Edit for subitems.
    The comctl32.dll does not provide the ability to edit the labels of the subitems.
    Last edited by Krool; Feb 6th, 2013 at 06:08 AM.

  28. #28

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    ImageList control is completly rewritten. (It is not compatible with the previous version)

    It works now like the original ImageList from MS but with some improvements, for example that the Style flag of the ListImages Draw method can be combined with multiples styles. (That was not possible in the original ImageList from MS) or that the Overlay function returns an icon instead of a bitmap or that the BackColor can be turned on or off (UseBackColor property).

  29. #29
    Addicted Member
    Join Date
    Sep 2008
    Posts
    141

    Re: CommonControls (Replacement of the MS common controls)

    Awesome work! I am by far not knocking the work but asking a question.. Is the tab control text a little too far to the right?
    Last edited by brandoncampbell; Feb 26th, 2013 at 11:27 AM.

  30. #30

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControls (Replacement of the MS common controls)

    Quote Originally Posted by brandoncampbell View Post
    Is the tab control text a little too far to the right?
    I noticed that too. I think that is due to the new appearance of Windows 7.
    Last edited by Krool; Feb 27th, 2013 at 02:06 AM.

  31. #31
    Addicted Member
    Join Date
    Sep 2008
    Posts
    141

    Re: CommonControls (Replacement of the MS common controls)

    I think it has something to do with Mnemonics if you don't put the _ before the text it looks fine.

  32. #32
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,703

    Re: CommonControls (Replacement of the MS common controls)

    I must say I'm truly impressed. Were I still using VB6, this would have been an incredible source of knowledge. I tended to write alot of my own controls(I still do in VB.Net) and I always want to learn as much as possible about creating them. I thought I had a good handle on it it but one glance at your source code, and even what you described about them being linked to ComCtl32.Dll showed me just how little I actually knew about control authoring in VB6. I tip my hat to you sir.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  33. #33

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

    ImageCombo control is added.

    The biggest advantage is that you can set the style property. ('DropDownCombo', 'DropDownList' or 'SimpleCombo')
    That was not possible on the original ImageCombo control. (It was always as 'DropDownCombo')
    Also new is the 'ItemDrag' event, similar to the one used in the ListView control.

  34. #34
    Addicted Member
    Join Date
    Sep 2008
    Posts
    141

    Re: CommonControls (Replacement of the MS common controls)

    Nice work dude
    Last edited by brandoncampbell; Mar 15th, 2013 at 02:01 PM.

  35. #35
    New Member
    Join Date
    Mar 2013
    Posts
    1

    Cool Re: CommonControls (Replacement of the MS common controls)

    Very, very good work. Many thanks to you. I do not like to link to Microsofts Ocx-files (Mscommctl.....). With your controls i don't need that. My exe work so without registrations on every PC. And: i can do more things. I can change the WM_PAINT - message to what i will. I can change the colors, i can add a picture, i can paint the control. I must only change your code a little bit. Awsome.
    Thank you very much!!!!!

  36. #36

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControls (Replacement of the MS common controls)

    Update released.
    Last edited by Krool; Apr 25th, 2013 at 03:02 PM.

  37. #37

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,495

    Re: CommonControls (Replacement of the MS common controls)

    Update released.

  38. #38
    Lively Member
    Join Date
    Mar 2012
    Posts
    68

    Re: CommonControls (Replacement of the MS common controls)

    Thank you for the work - it's a lovely change CommonControls.
    I have one problem, very often crashes when you compile an application (even an example), and the exe-file is created. And sometimes crashes when you press End in the course of the program.
    It would be nice if the progress bar for added display of progress on the taskbar. An example can be found here http://sourceforge.net/p/audica/code...skBarList3.cls

  39. #39
    Lively Member
    Join Date
    Mar 2012
    Posts
    68

    Re: CommonControls (Replacement of the MS common controls)

    Also for the beautiful subsclassing commandbutton think it will be good to make changes if there is a caption and a picture, you have the image on the left and the caption to the left of the picture. So the picture will not be imposed on the text.

    Code:
    Private Sub DrawButton(ByVal hWnd As Long, ByVal hDC As Long, Button As Object)
    .....
    If Not Button.Caption = vbNullString Or Len(Button.Caption) > 0 Then
        Set ButtonFont = Button.Font
        FontOld = SelectObject(hDC, ButtonFont.hFont)
        RectText = RectClient
        DrawText hDC, StrPtr(Button.Caption), -1, RectText, DT_CALCRECT Or DT_WORDBREAK
        RectText.Right = RectClient.Right
        If ButtonPic Is Nothing Then
            RectText.Left = RectClient.Left
            RectText.Top = ((RectClient.Bottom - RectText.Bottom) / 2) + 3
            RectText.Bottom = RectText.Top + RectText.Bottom
        Else
            RectText.Left = CInt(Button.Parent.ScaleX(ButtonPic.Width, vbHimetric, vbPixels)) + 4
            'RectText.Top = RectClient.Top '(RectClient.Bottom - RectText.Bottom) + 1
            RectText.Top = (((RectClient.Bottom - RectClient.Top) - (RectText.Bottom - RectText.Top)) / 2) + RectClient.Top
            RectText.Bottom = RectClient.Bottom
        End If
        DrawThemeText Theme, hDC, 1, ButtonState, StrPtr(Button.Caption), -1, DT_CENTER Or DT_WORDBREAK, 0, RectText
        SelectObject hDC, FontOld
    End If
    CloseThemeData Theme
    If Not ButtonPic Is Nothing Then
        W = CInt(Button.Parent.ScaleX(ButtonPic.Width, vbHimetric, vbPixels))
        H = CInt(Button.Parent.ScaleY(ButtonPic.Height, vbHimetric, vbPixels))
        If Not Button.Caption = vbNullString Or Len(Button.Caption) > 0 Then
            X = RectClient.Left
            'Y = RectClient.Top ' + ((RectClient.Bottom - RectClient.Left - H) / 2)
            Y = (((RectClient.Bottom - RectClient.Top) - H) / 2) + RectClient.Top
        Else
            RectClient.Bottom = RectText.Top
            X = RectClient.Left + ((RectClient.Right - RectClient.Left - W) / 2)
            Y = RectClient.Top + ((RectClient.Bottom - RectClient.Left - H) / 2)
        End If
        If Enabled = True Then
            If Button.UseMaskColor = True Then
                Call DrawTransparentPicture(ButtonPic, hDC, X, Y, W, H, WinColor(Button.MaskColor))
            Else
                ButtonPic.Render hDC, X, Y + H, W, -H, 0, 0, ButtonPic.Width, ButtonPic.Height, ByVal 0
            End If
        Else
            Call DrawDisabledPicture(ButtonPic, hDC, X, Y, W, H, WinColor(Button.MaskColor))
        End If
    End If

  40. #40
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: CommonControls (Replacement of the MS common controls)

    sleeeeeeeeeeeeeek

Page 1 of 97 12341151 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width