-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Yep, from what I can gather, it may effect quite a bit...
Quote:
Originally Posted by msdn
The Compatibility section allows Windows to provide new behavior to new developer-created software while maintaining the compatibility for existing software. This section also helps Windows deliver greater compatibility in future versions of Windows as well. For example, an application declaring support only for Windows 7 in the Compatibility section will continue to receive Windows 7 behavior in future version of Windows.
Applications without a Compatibility section in their manifest will receive Windows Vista behavior by default on Windows 7 and future Windows versions. Note that Windows XP and Windows Vista ignore this manifest section and it has no impact on them.
There was more on this page and on this page too & probably more to come as Win10 comes on board.
I don't have anything higher than Win7 to play on, but maybe including/excluding this section may affect theme style?
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Thanks. Those items listed are a good start.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Updated to include 2 new items mentioned in post #59 above.
-
1 Attachment(s)
Re: [VB6] XP/Vista/Win7 Manifest Creator
Just a FYI item. Another benefit of adding manifests is the ability to add nice alpha-blended icons to your buttons. This method will NOT work if controls are not themed.
The button icon assignment in the screenshot below was accomplished with a couple lines of code
1) Load your alpha-blended icon via your favorite method. You will need to destroy the icon at some point
2) Here are the APIs
Code:
Private Const BM_SETIMAGE As Long = &HF7&
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Any) As Long
Private Declare Function DestroyIcon Lib "user32.dll" (ByVal hIcon As Long) As Long
3) Here's the simple assignment after you've loaded your icon
Code:
SendMessage Command1.hwnd, BM_SETIMAGE, 1&, ByVal hIcon
4) Finally, as needed, destroy your icon during form_unload
How did I use a 48x48 icon? Easy way: use your favorite icon editor/parser and single it out to its own file.
If you are asking how to load an icon, suggest starting with LoadImage API
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Hi LaVolpe, i know this is an old tool but good work by the way.
I came across this thread by accident really and i have a question for you?
I tried your Manifest creator on an old VB6 progam we have at my work which we don't really wont to upgrade just yet and while it updates the look and feel of buttons and text boxes it does nothing to the Listviews & Toolbars.
Is this expected? should they skin or not?
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
NeedSomeAnswers
Hi LaVolpe, i know this is an old tool but good work by the way.
I came across this thread by accident really and i have a question for you?
I tried your Manifest creator on an old VB6 progam we have at my work which we don't really wont to upgrade just yet and while it updates the look and feel of buttons and text boxes it does nothing to the Listviews & Toolbars.
Is this expected? should they skin or not?
Depends on which version of the common controls you are using. v5 is 'skinnable' v6 is not
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Depends on which version of the common controls you are using. v5 is 'skinnable' v6 is not
Ah that makes things clear and explains why those specific controls were not skinning, thanks !!!
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
I didn't see mentioned in this thread the alternative (UMMM) Unattended Make My Manifest, which can be used for strictly command line builds.
Although personally I usually hand edit UMMM output, and then add the file as a custom resource named 1, with resource type "#24"
Registration-Free COM is a godsend for distribution.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
DEXWERX
I didn't see mentioned in this thread the alternative (UMMM)....
Believe that was developed after this. Usually we here don't advertise our projects on other people's codebank submissions which is why you didn't see it mentioned
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
LaVolpe
Believe that was developed after this. Usually we here don't advertise our projects on other people's codebank submissions which is why you didn't see it mentioned
my bad! just to clarify - i definitely can't take credit for wqweto/Vlad's project since 2009.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
DEXWERX
my bad! just to clarify - i definitely can't take credit for wqweto/Vlad's project since 2009.
No, I know who developed UMMM. Just trying to make a point regarding codebank submissions. Now, in the general help portion of the forum, totally difference scenario. I may, for example, reference this project as an option to solve a particular problem. It is completely understandable and expected to see other posts that reference other projects/solutions
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
LaVolpe
No, I know who developed UMMM. Just trying to make a point regarding codebank submissions.
Understood, I can see my comment is completely rude on a codebank post.
This project does a great job of making Manifests simple. Thanks for a great app!
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Hello,
I've search and didn't find a sollution how to use manifest (theming) within an vb6 ActiveX ocx control. Can this be done?
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
I played with the idea and found a partial solution, but decided against it for one specific reason... If the OCX can render itself themed and the rest of the controls on the form are not themed, I'd think the user would not be happy. The OCX would not appear similar to other controls it is hosted with.
If interested, here is the thread I started on that same topic. You can take it from there if you want. I abandoned the idea.
http://www.vbforums.com/showthread.p...-is-manifested
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Please could you tell why we need to add all this (below) to the Project?
I tried without it and everything works fine, buttons and controls looks good.
Code:
Private Declare Function LoadLibraryA Lib "kernel32.dll" (ByVal lpLibFileName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32.dll" (ByVal hLibModule As Long) As Long
Private Declare Function InitCommonControlsEx Lib "comctl32.dll" (iccex As InitCommonControlsExStruct) As Boolean
Private Declare Sub InitCommonControls Lib "comctl32.dll"()
Private Type InitCommonControlsExStruct
lngSize As Long
lngICC As Long
End Type
Private Sub Main()
Dim iccex As InitCommonControlsExStruct, hMod As Long
' constant descriptions: http://msdn.microsoft.com/en-us/library/bb775507%28VS.85%29.aspx
Const ICC_ANIMATE_CLASS As Long = &H80&
Const ICC_BAR_CLASSES As Long = &H4&
Const ICC_COOL_CLASSES As Long = &H400&
Const ICC_DATE_CLASSES As Long = &H100&
Const ICC_HOTKEY_CLASS As Long = &H40&
Const ICC_INTERNET_CLASSES As Long = &H800&
Const ICC_LINK_CLASS As Long = &H8000&
Const ICC_LISTVIEW_CLASSES As Long = &H1&
Const ICC_NATIVEFNTCTL_CLASS As Long = &H2000&
Const ICC_PAGESCROLLER_CLASS As Long = &H1000&
Const ICC_PROGRESS_CLASS As Long = &H20&
Const ICC_TAB_CLASSES As Long = &H8&
Const ICC_TREEVIEW_CLASSES As Long = &H2&
Const ICC_UPDOWN_CLASS As Long = &H10&
Const ICC_USEREX_CLASSES As Long = &H200&
Const ICC_STANDARD_CLASSES As Long = &H4000&
Const ICC_WIN95_CLASSES As Long = &HFF&
Const ICC_ALL_CLASSES As Long = &HFDFF& ' combination of all values above
With iccex
.lngSize = LenB(iccex)
.lngICC = ICC_STANDARD_CLASSES ' vb intrinsic controls (buttons, textbox, etc)
' if using Common Controls; add appropriate ICC_ constants for type of control you are using
' example if using CommonControls v5.0 Progress bar:
' .lngICC = ICC_STANDARD_CLASSES Or ICC_PROGRESS_CLASS
End With
On Error Resume Next ' error? InitCommonControlsEx requires IEv3 or above
hMod = LoadLibraryA("shell32.dll") ' patch to prevent XP crashes when VB usercontrols present
InitCommonControlsEx iccex
If Err Then
InitCommonControls ' try Win9x version
Err.Clear
End If
On Error GoTo 0
'... show your main form next (i.e., Form1.Show)
Form1.Show
If hMod Then FreeLibrary hMod
'** Tip 1: Avoid using VB Frames when applying XP/Vista themes
' In place of VB Frames, use pictureboxes instead.
' 'bug' may no longer apply to Win7+
'** Tip 2: Avoid using Graphical Style property of buttons, checkboxes and option buttons
' Doing so will prevent them from being themed.
End Sub
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
pantalone
Please could you tell why we need to add all this (below) to the Project?
I tried without it and everything works fine, buttons and controls looks good.
You don't need to call InitCommonControlsEx at all, so almost all of that is pointless overhead. ActiveX containers and controls already take care of everything it might theoretically accomplish (i.e. they call it themselves).
What needs to happen for things to work and not crash is to first load shell32.dll and then load comctl32.dll (in that order) before the first VB Form or Control is loaded. While you can skip one or both steps and get away with it sometimes, in other situations your program will just fail. It seems to vary by program, controls used, Windows version, and some "secret sauce" we haven't uncovered yet.
The call to InitCommonControlsEx causes comctl32.dll to be loaded into your process' address space. Nothing else that it does matters. You can also just use the simpler InitCommonControls call and accomplish just as much. Or you could explicitly call LoadLibrary on comctl32.dll instead. Same result.
However if you didn't cause shell32.dll to load first you are still at risk of "mysterious aborts." These seem to occur less frequently than if you failed to load comctl32.dll at all before loading a Form or Control, but they still occur.
Once again, you could use LoadLibrary on it, or just call some innocuous entrypoint in the library. I like to use IsUserAnAdmin:
Code:
Private Declare Function IsUserAnAdmin Lib "shell32" () As Long
It's short and sweet, works every time. You can call it as a subroutine since you don't care about its return value. Just call it before calling InitCommonControls.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Thank you.
Do I need to use all this code when I use external manifest file next to exe file?
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
External manifests are deprecated and should not be used. But ignoring that, nothing changes.
As I already said in post #77, you don't need "all this code" anyway and just something like this is plenty:
Code:
Option Explicit
Private Declare Function InitCommonControls Lib "comctl32" () As Long
Private Declare Function IsUserAnAdmin Lib "shell32" () As Long
Private Sub InitCommonControlsVB()
'Reliably cause these libraries to be loaded in the correct order
'so that a Common Controls 6.0 manifest doesn't cause a crash.
On Error Resume Next
IsUserAnAdmin
InitCommonControls
End Sub
Private Sub Main()
InitCommonControlsVB
Form1.Show
End Sub
-
1 Attachment(s)
Re: [VB6] XP/Vista/Win7 Manifest Creator
Hello, It seem not working good in windows XP 32bit. The original text turn black see the picture below
Attachment 142105
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
If I remember correctly you have to put the Option controls in a PictureBox control, otherwise you get those black backgrounds.
It's not a bug in the manifest or the manifest creator.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
Arnoutdv
If I remember correctly you have to put the Option controls in a PictureBox control, otherwise you get those black backgrounds.
It's not a bug in the manifest or the manifest creator.
Hi, i have explore this furthermore today that my option control button turn black if it put above frame control. besides that all is normal. in form, sstab,ect normal option button appear but when it put with frame control it's turn black. Any idea how to solved?
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Yes, in the frame put a borderless picturebox control which is sized to inner width of the frame.
Then place the option control(s) in the picturebox.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
You may also find that Command buttons are shown with black rectangular borders in similar circumstances; treat them in the same manner as advised by Arno for the Option buttons.
Neither problem happens under Windows Vista and later.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
Magic Ink
You may also find that Command buttons are shown with black rectangular borders in similar circumstances; treat them in the same manner as advised by Arno for the Option buttons.
Neither problem happens under Windows Vista and later.
For Frame controls, which cause this, is a "fix" possible w/o the PictureBox workaround.
http://www.vbforums.com/showthread.p...es)&highlight=
Though this is actually a XP only bug, as you mentioned.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Much appreciated! Worked perfectly in XP 32bit Sp2.
Actually got the same manifest from other sources, but modifying it with PFE and XP notepad barfed the UTF8, or inserted wrong characters in somewhere.
Thank you for this fine project!
-
2 Attachment(s)
Re: [VB6] XP/Vista/Win7 Manifest Creator
Hi,
(1) Created a manifest to my application making a textfile with .manifest extension and Res file as mentioned at #3. And got a shield at the App right bottom corner.
Attachment 152971
Which helped to pass UAC.
When i created a Res file using MC2
The Manifest > Export Manifest (After Selecting the Required Check Boxes)
and created .res file
Then attached the .res to the App (Saved a copy of App before linking the Res file as in (1))
but after building the compilation file no shield this time to the bottom right corner of .exe file.
and upon run giving the following error message.
Attachment 152973
May be i have created the .res file wrongly.
Please suggest how to build .res file that will pas UAC and also support 32 bit .ico files.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
When that error occurs, the manifest is not technically correct. You'll need to look at your window events to see what portion of the file is triggering the error.
On Win10:
Open "Event Viewer" from your taskbar Windows button (RUN > eventvwr.msc /s)
Open the Windows Log section to view the Application events
Find the entry for your app.
Here's an example of one I found that applies to a Microsoft assembly
Quote:
Activation context generation failed for "C:\Program Files\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\CopyDatabaseWizard.exe".Error in manifest or policy file "C:\Program Files\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\CopyDatabaseWizard.exe" on line 8. The value "1.0" of attribute "version" in element "assemblyIdentity" is invalid.
The last sentence should help narrow it down. In that case, the version format is a 4 part value: #.#.#.# (i.e., 1.0.0.0) not the two part one used: 1.0
Edited and a follow up. The above was resolved in another part of the forum. It appeared that the manifest was not dword-aligned when placed in the resource file. This is typically not an issue unless SP6 was not applied to VB. Prior to SP6, VB padded resources with null char bytes to ensure dword-aligned. Char 0 is an invalid character in XML/HTML and likely the reason for the error.
-
1 Attachment(s)
Re: [VB6] XP/Vista/Win7 Manifest Creator
I know I'm late to the party but I only recently stumbled across this wonderful thread.
I'm running into a few issues with using Creator II. Well...the issues are probably due to my misunderstandings as I've never dealt with manifests before this.
1) The theme changes don't seem to work if running within the IDE but do work if I compile and then run the executable (maybe this is normal, I don't know)
2) I only selected to use the Win 10 theme and I notice if I have a frame within another frame, the one inside, its title is bolded and a much larger font size than the 'container' frame. Is there a way around this?
3) My progress bars still look like VB6 ones not Win 10 ones
Screenshot attached
"Start" and "End" should be same font size (and non-bolded) as the "Daylight Savings" title of the parent frame. Notice the 'Start' and 'End' are also truncated.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Lots of things to address:
1. Don't use this version, I am no longer supporting it. If you look at the 1st sentence in post #1, you'll see the link to the current version. Once there, I gave a bit of a summary why the new version was done.
2. Manifesting for common controls. You can get your IDE to work manifested with very little effort. I won't be addressing many questions on this thread as I am not supporting it any longer. In that other thread, there is a technique described for manifesting the IDE. If it doesn't seem to work, post a question there, I've since discovered a potentially easier method.
3. Fonts. Always use True-Type fonts, not the default font VB gives you. Simplest habit for new projects: before you add a single control to a new form, change the form's font immediately. Most controls later added to the form, inherit that font's properties.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
I am using the new version (as my OP stated, I'm using Creator II).
I will move to the new thread, thanks.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
FYI for others. The problem is a bug that still isn't fixed when controls are added to frames and project is manifested. This frame in a frame solution is the same as how we got past it in the XP days --- add inner frame to picturebox, add picturebox to outer frame, change picturebox size/position/backcolor to taste, make it borderless
Edited: But don't use this version of the project anyway. Use the newer version linked to in the 1st posting. I've added comments to that thread regarding this problem.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
not sure if PMs work (tried sending one, and nothing happened), so posting here...
Hi! Came across your post here:
http://www.vbforums.com/showthread.p...57#post4810657
But I don't "get" how to use the loadimage function to get an icon applied to xp themed controls (I've searched but can't figure it out)...
if you have a moment, could you please just .zip up a project containing sample code with the icon in order to do that?
thanks very much!
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
mememe2
But I don't "get" how to use the loadimage function to get an icon applied to xp themed controls (I've searched but can't figure it out)...
if you have a moment, could you please just .zip up a project containing sample code with the icon in order to do that?
Recommend posting the question in the general VB forums section. Your question is not difficult to answer, but can result in multiple posts. I don't want this thread being used for other topics other than manifesting & I don't want this thread being resurrected with updated information.
This thread is no longer being supported as noted at top of the 1st post.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Is this thread still relevant, or should we consider it replaced by the thread on Manifest Creator v2.0.5? It's old.
And is there anywhere that sort of steps through the process in beginner-speak? I was immediately stumped when I reached...
Quote:
4. Click on the button "Sub Main To Clipboard"
What button? Where is this button?
If I've hit a wall this quick in the list of ToDo's, I'm going to end up shanking my system!
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
The first post in this thread links to the newest version of this manifest creator. For your purposes just use an existing manifest file like I've already told you. You are complicating things for yourself unnecessarily.
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Compatibility: Change High DPI Settings Select the application.
How to write this in XML code Manifest?
-
Re: [VB6] XP/Vista/Win7 Manifest Creator
Quote:
Originally Posted by
xiaoyao
Compatibility: Change High DPI Settings Select the application.
How to write this in XML code Manifest?
Like this: Simple way to make your VB6 application "Per-Monitor DPI Aware", take a look at the manifest included in the ZIP archive.