Emulated Toolbars on XP

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

Emulated Toolbars on XP

Postby jtuchel » Tue Mar 15, 2011 11:24 pm

Hi,

I got the following info from a colleague who had problems with TobToolbars in their packaged Application. The effect was that their Toolbars behaved like in the IDE when running on Windows XP: old style buttons that only react on double clicks.

What he found out was that if you remove the manifest file of the exe on XP, the Toolbars work. Of course, you loose the support for theming on Win XP if you do so.
By experimenting a little, he found that the problem is the (hardcoded) dependence on the Win 32 Common controls DLL version 6.0.0

Code: Select all
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
    </dependentAssembly>


So another option is to find out which version of the DLL is installed on your machine and replace the version.

But this is of course not a good solution if you need to deliver to an unknown machine park.

So this brings up a few questions:

What if the version attribute is simply left out?
Is it possible to add multiple assemblyIdentity tags into the manifest that reference the resp. version of the DLL? What would the type attribute look like for a dsitinction between Win XP, Vista, Windows 7? What DLL versions are appropriate for each of the Windows versions? How could I find out myself on newer versions of Windows?

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: Emulated Toolbars on XP

Postby tc » Wed Mar 16, 2011 8:44 am

Hello,

The emulated tool bars are drawn, so, they would be unaffected by the manifest file. For example, this:

TobTBShortcutBarWidget>>#updateSelectedGroup

. . . calls createWidget:parent:argBlock: which creates an instance of 'CwDrawingAreaBasedExtendedWidget' for drawing the button. If one were using Windows/OS buttons (e.g. CwPushButton) then their appearance would be affected by the (or lack of a) manifest file.

For the most modern looking widgets, a manifest file needs to be used that specifies comctrl32, version 6. For other OS versions, MS says:

http://msdn.microsoft.com/en-us/library/bb773175%28v=VS.85%29.aspx
Much of the Windows XP visual style architecture is designed to make it simple to continue to ship your product on earlier versions of Windows that do not support changing the appearance of controls. When shipping an application for more than one operating system, be aware of the following:
* If you use the features in ComCtl32.dll version 6, such as the tile view or link control, you must handle the case where those controls are not available on your user's computer. ComCtl32.dll version 6 is not redistributable.
* Test your application to make sure you are not relying on features of ComCtl32.dll version 6 without first checking for the current version.
* Do not link to UxTheme.lib.
* Write error-handling code for instances when visual styles do not work as expected.
* Installing your application's manifest in earlier versions will not affect the rendering of controls.


--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Re: Emulated Toolbars on XP

Postby jtuchel » Thu Mar 17, 2011 1:14 am

Hi Taylor,

thanks for clarifying a bit on the manifest stuff.
So obviously, my post was not about emulated toolbars at all, because these would not be affected by changes to the manifest file, right?
So I guess I was just referring to the flat visual style and the fact that the tool buttons react to single clicks instead of double clicks, just as it happens with an emulated toolbar in XP.

Still, some of my questions remain unanswered:

* can I leave the version info for for comctrl32.dll out of the manifest and it will work magically?
* can I add multiple entries for comctrl32 into the manifest and how would I formulate info on how to determine which version applies to the existing platform.

And, what's more, this proves to be wrong:
* Installing your application's manifest in earlier versions will not affect the rendering of controls.


Because there is a difference in behavior between shipping a manifest and not shipping one. If you ship one on XP (referring to version 6 of the dll), the Toolbar's not flat and doesn't react to single clicks. If you ship none or change the version info, the Toolbars work as expected, without having to do anything like enabling emulated toolbars.

These are important questions if I need to ship my app to different machines (like a boxed product). If they'd like to not loose theming on Windows Vista or Win 7, but also need a usable Toolbar on XP, how would they progress? Ship different manifests and implement some determination logic into the install process of their app? Or can they ship one manifest that works on all platforms? As the msdn article says, shipping with version 6 of comctrl32 is not an option (and may not work on older Windows versions).

I know these are questions about the way Windows and Manifests work, but I hope you don't send me off to search on MSDN. These are also questions about how to build a useful package to deplay a VAST App on a range of Windows versions.

Joachim
jtuchel
[|]
 
Posts: 245
Joined: Fri Oct 05, 2007 1:05 am
Location: Ludwigsburg, Germany

Re: Emulated Toolbars on XP

Postby tc » Thu Mar 17, 2011 10:32 am

Hello,

I think I'm missing something but Win XP and above (Vista, Win 7) should always have the manifest file specifying version 6 for comctrl32. As a test, I removed the manifest file and the toolbar buttons were raised, as expected, because comctrl32, version 3 is used by default.

Also, if one is using XP, for example, and turns off theme support (Desktop -> Properties -> Appearance -> Windows and Buttons and select 'Windows Classic Style') then the buttons may be raised.

--tc
tc
Moderator
 
Posts: 304
Joined: Tue Oct 17, 2006 7:40 am
Location: Raleigh, NC

Re: Emulated Toolbars on XP

Postby wembley » Sun Mar 20, 2011 2:47 am

jtuchel wrote:Still, some of my questions remain unanswered:
* can I leave the version info for for comctrl32.dll out of the manifest and it will work magically?
* can I add multiple entries for comctrl32 into the manifest and how would I formulate info on how to determine which version applies to the existing platform.

The answer is No and No (see http://msdn.microsoft.com/en-us/library ... 91(v=vs.85).aspx).
jtuchel wrote:And, what's more, this proves to be wrong:
* Installing your application's manifest in earlier versions will not affect the rendering of controls.

Because there is a difference in behavior between shipping a manifest and not shipping one.

In this context, earlier versions means Windows 2000 or earlier.
John O'Keefe [|], Principal Smalltalk Architect, Instantiations Inc.
wembley
Moderator
 
Posts: 405
Joined: Mon Oct 16, 2006 3:01 am
Location: Durham, NC


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: No registered users and 1 guest

cron