I am wondering how it is possible to select between the versions 5 and 6 of the Comctl32.dll controls library?
I am using Windows XP Professional with recent service packs installed so version 6 of Comctl32.dll is present on the PC (although version 5 is also present elsewhere).
I note that what is in C:\WINDOWS\System32
is 5.82.2900.5512
However other more recent versions are also present elsewhere in other directories (presumably resulting from installation of the service pack upgrades).
The most recent is in:
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83
which contains 6.0.2900.5512
It is not completely clear which version SwifthForth is using although it seems that the controls produced in a SwiftForth programme are those of the version 5 type.
I have this impression since the edit control in a SwiftForth programme with the ES_PASSWORD style displays asterisks rather than black circles.
http://msdn.microsoft.com/en-us/library/bb775464(VS.85).aspx
states:
=== begin ===
Windows XP: If the edit control is from user32.dll, the default password character is an asterisk.
However, if the edit control is from comctl32.dll version 6, the default character is a black circle.
To change the characters that is displayed, or set or clear this style, use the EM_SETPASSWORDCHAR message.
Note Comctl32.dll version 6 is not redistributable but it is included in Windows XP or later.
To use Comctl32.dll version 6, specify it in a manifest. For more information on manifests, see Enabling Visual Styles.
=== end ===
I am not personally particularly bothered whether the edit control shows asterisks rather than black circles.
However, the default behaviour indicates that SwiftForth is using the version 5 control.
Thus, it is necessary to have some way of selecting the alternative version 6.
It is also necessary to enable use v6 of Comctl32.dll rather than the v5 to take advantage of other controls that don't exist in v5 or have been significantly enhanced.
Furthermore, it is also necessary to have the alternative of selecting the v5 to develop code to support systems that do not have v6 of Comctl32.dll
The PC operating system itself seems to be using v6 since when I look at Control Panel ... User Accounts ... in setting a password, black circles rather than asterisks are seen.
I found InitCommonControlsEx function which appears to offer a possible solution
http://msdn.microsoft.com/en-us/library/bb775697(VS.85).aspx
Values in the INITCOMMONCONTROLSEX Structure
http://msdn.microsoft.com/en-us/library/bb775507(v=VS.85).aspx
are supported by SwiftForth (e.g., ICC_STANDARD_CLASSES, ICC_TREEVIEW_CLASSES, etc.) suggesting that it is relevant.
However, the InitCommonControlsEx function itself is not present in SwiftForth nor, apparently, the structure.
The documentation is unclear since it does not indicate what (if anything) needs to be done to select the v6 version of the edit control.
Actually, using ICC_STANDARD_CLASSES it seems that the InitCommonControlsEx function can be used to deselect v6 since the documentation states:
> ICC_STANDARD_CLASSES: Load one of the intrinsic User32 control classes.
> The user controls include button, edit, static, listbox, combobox, and scrollbar.
Thus the impression is that one may not need to do nothing to benefit from v6 (assuming that one has a system running Windows XP) and, in respect of the edit edit, use of InitCommonControlsEx function is only relevant if it is desired to deselect it.
In summary, the edit control in my Forth test programme has asterisks by default whether or not I use InitCommonControlsEx
(I believe I have successfully implemented a INITCOMMONCONTROLSEX structure and use of the function).
http://msdn.microsoft.com/en-us/library/bb773175(v=VS.85).aspx
This article discusses "Using Manifests or Directives to Ensure That Visual Styles Can Be Applied to Applications"
Do we need a file called sf.exe.manifest ?
It would be preferable if v5/ v6 selection could more simply be based on some sort of directives or commands within a particular programme.
In any event, it is unclear exactly what content would be used in the manifold file.
Another resource I found is
www.geoffchappell.com/viewer.htm?doc=studies/windows/shell/comctl32/controls/index.htm&tx=14
Chappel writes:
=== begin ===
Note that in version 6.00 and higher, COMCTL32 re-implements some of the built-in controls.
The implementations in USER32 remain.
Both implementations use the same class names.
Whether a given control is implemented through COMCTL32 or USER32 depends on the current activation context when the control is created.
The affected controls are:
Button, ComboBox, ComboLBox, Edit, ListBox, ScrollBar and Static
Redirection of window classes according to the current activation context is supported by USER32 in Windows XP and higher.
Part of the feature is that any module, such as COMCTL32.DLL, that implements window classes can declare its support through an assembly manifest.
If a window cannot be created because the requested class is not yet registered, but the class is supported by the module associated with the current activation context,
then USER32 can call that module to get the class registered, and then retry the window creation.
The module must export a function named RegisterClassNameW.
COMCTL32 does this in versions 5.82 and 6.0 from Windows XP SP2, but not Windows XP SP3, and higher,
with the effect that InitCommonControlsEx becomes unnecessary.
=== end ===
All ideas welcomed!
Best Regards,
Douglas
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and
bug reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Sun May 02 2010 - 10:44:45 PDT
Subscribe to our e-mail list service. It's free for all SwiftForth and SwiftX users!
This archive was generated 06-Feb-2012. Archive updated nightly.