[RESOLVED] ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Current Version v1.7 - Released May 02, 2020
Changelog
- Included detailed instructions on the root of the release explaining all the procedures necessary to correctly setup ModernVB
- Menu icons have been updated with a few new icons and tweaks
- Project Explorer icons are now replaced by modern icons automatically (thanks to Olaf Schmidt for the concept)
- Initial support for international languages on the add-in side (requires using the optimal settings registry file)
- Patches now include English, French, Spanish and Chinese language support as well as unlimited undo/redo functionality
- Minor tweaks and fixes (Gauge bar docking to Menu should work correctly now)
I'd like to announce that I've released a public version of my ModernVB add-in and the modification pack that should allow you to completely transform your Visual Basic 6 IDE and bring it into the 21st century with many new features to enhance its usefulness and appearance.
I decided to make a separate thread here in the CodeBank since that seemed to be to the correct place to share code. I'd be okay with taking feedback in either thread though, it's up to you all. I've attached a copy of the source code of the addin for the initial release. For future updates, please refer to the Github project page. To actually install and run the modifications for your IDE, please download the zip file in the Releases tab and follow the instructions in the page and the included text files.
I hope this release is useful to all of you, and if you have any questions or issues please don't hesitate to contact me. I've done my best to ensure everything works correctly, but this has seen very limited public testing so far, so bugs are to be expected.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
FWIW (regarding your "last open problem" with the Icons in the Project-ToolWindow)...
I've made a self-contained drop-in Class, which handles the suggested "overlay-solution" already
(it's robust and relatively small - requiring no SubClassing)...
cProjToolbar
Code:
Option Explicit
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindowW Lib "user32" (ByVal lpClassName As Long, Optional ByVal lpWindowName As Long) As Long
Private Declare Function FindWindowExW Lib "user32" (ByVal hWndParent As Long, ByVal hWndChildAfter As Long, ByVal lpClassName As Long, Optional ByVal lpWindowName As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As Any) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As Any) As Long
Private Declare Function ExtractIconExW Lib "shell32" (ByVal lpszFile As Long, ByVal nIconIndex As Long, ByVal phiconLarge As Long, ByVal phiconSmall As Long, Optional ByVal nIcons As Long = 1) As Long
Private Declare Function DrawIconEx Lib "user32.dll" (ByVal hDC As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private hWndCmdBar As Long, picOvl As VB.PictureBox, WithEvents tmrCheck As VB.Timer
Private Const x1& = 2, x2& = 25, x3& = 54, y0& = 2, sz& = 22
Friend Sub InitFrom(F As Form)
Dim hProjTool As Long
hProjTool = FindWindowExW(FindWindowW(StrPtr("wndclass_desked_gsk")), 0, StrPtr("PROJECT"))
hWndCmdBar = FindWindowExW(FindWindowExW(hProjTool, 0, 0, StrPtr("MsoDockTop")), 0, StrPtr("MsoCommandBar"))
If hWndCmdBar = 0 Then Err.Raise vbObjectError, , "unable to find CommandBar of Project-ToolWindow"
Set picOvl = F.Controls.Add("VB.PictureBox", "picOvl")
picOvl.Visible = True: picOvl.Enabled = False
picOvl.BorderStyle = 0: picOvl.AutoRedraw = True: picOvl.ScaleMode = vbPixels
picOvl.Move 0, 0, F.ScaleX(500, vbPixels, F.ScaleMode), F.ScaleY(32, vbPixels, F.ScaleMode)
SetParent picOvl.hWnd, hWndCmdBar
Set tmrCheck = F.Controls.Add("VB.Timer", "tmrCheck")
tmrCheck.Interval = 100
Dim i As Long, hIco As Long
For i = 1 To 3
If ExtractIconExW(StrPtr("shell32.dll"), -Choose(i, 155, 167, 20), 0, VarPtr(hIco), 1) Then
DrawIconEx picOvl.hDC, Choose(i, x1, x2, x3) + 3, y0 + 3, hIco, 16, 16, 0, 0, 3
DestroyIcon hIco
End If
Next
Set picOvl.Picture = picOvl.Image
End Sub
Private Sub tmrCheck_Timer()
Dim Pnt&(0 To 1): GetCursorPos Pnt(0)
If WindowFromPoint(Pnt(0), Pnt(1)) <> hWndCmdBar Then RenderButton 0: Exit Sub
Dim Rct&(0 To 3): GetWindowRect hWndCmdBar, Rct(0)
Dim x&, y&: x = Pnt(0) - Rct(0): y = Pnt(1) - Rct(1)
If x >= x1 And x <= x1 + sz Then RenderButton 1, x1, y0, sz
If x >= x2 And x <= x2 + sz Then RenderButton 2, x2, y0, sz
If x >= x3 And x <= x3 + sz Then RenderButton 3, x3, y0, sz
End Sub
Private Sub RenderButton(ByVal Idx&, Optional ByVal x&, Optional ByVal y&, Optional ByVal sz&)
Static LastIdx As Long
If LastIdx = Idx Then Exit Sub Else LastIdx = Idx
picOvl.Cls
If Idx Then picOvl.Line (x, y)-(x + sz, y + sz), &H888888, B
picOvl.Refresh
End Sub
Usage then (either for Testing in a virginal, normal VB6-Form-Project, or from within your Addin-Project):
Code:
Option Explicit
Private PrjToolbar As New cProjToolbar
Private Sub Form_Load()
PrjToolbar.InitFrom Me
End Sub
So the only requirements are, that you pass a normal VB-Form-instance into the Class' InitFrom-method...
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Check the Releases tab in GitHub my friend. I haven't actually included your excellent Addin per se in the pack (It does come highly recommended though!) but I've added support for ModernVB to detect it and display it whenever you switch to the code layout!
Last edited by LinkFX; Apr 27th, 2020 at 04:44 PM.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by Schmidt
FWIW (regarding your "last open problem" with the Icons in the Project-ToolWindow)...
I've made a self-contained drop-in Class, which handles the suggested "overlay-solution" already
(it's robust and relatively small - requiring no SubClassing)...
cProjToolbar
Code:
Option Explicit
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindowW Lib "user32" (ByVal lpClassName As Long, Optional ByVal lpWindowName As Long) As Long
Private Declare Function FindWindowExW Lib "user32" (ByVal hWndParent As Long, ByVal hWndChildAfter As Long, ByVal lpClassName As Long, Optional ByVal lpWindowName As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As Any) As Long
Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As Any) As Long
Private Declare Function ExtractIconExW Lib "shell32" (ByVal lpszFile As Long, ByVal nIconIndex As Long, ByVal phiconLarge As Long, ByVal phiconSmall As Long, Optional ByVal nIcons As Long = 1) As Long
Private Declare Function DrawIconEx Lib "user32.dll" (ByVal hDC As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
Private hWndCmdBar As Long, picOvl As VB.PictureBox, WithEvents tmrCheck As VB.Timer
Private Const x1& = 2, x2& = 25, x3& = 54, y0& = 2, sz& = 22
Friend Sub InitFrom(F As Form)
Dim hProjTool As Long
hProjTool = FindWindowExW(FindWindowW(StrPtr("wndclass_desked_gsk")), 0, StrPtr("PROJECT"))
hWndCmdBar = FindWindowExW(FindWindowExW(hProjTool, 0, 0, StrPtr("MsoDockTop")), 0, StrPtr("MsoCommandBar"))
If hWndCmdBar = 0 Then Err.Raise vbObjectError, , "unable to find CommandBar of Project-ToolWindow"
Set picOvl = F.Controls.Add("VB.PictureBox", "picOvl")
picOvl.Visible = True: picOvl.Enabled = False
picOvl.BorderStyle = 0: picOvl.AutoRedraw = True: picOvl.ScaleMode = vbPixels
picOvl.Move 0, 0, F.ScaleX(500, vbPixels, F.ScaleMode), F.ScaleY(32, vbPixels, F.ScaleMode)
SetParent picOvl.hWnd, hWndCmdBar
Set tmrCheck = F.Controls.Add("VB.Timer", "tmrCheck")
tmrCheck.Interval = 100
Dim i As Long, hIco As Long
For i = 1 To 3
If ExtractIconExW(StrPtr("shell32.dll"), -Choose(i, 155, 167, 20), 0, VarPtr(hIco), 1) Then
DrawIconEx picOvl.hDC, Choose(i, x1, x2, x3) + 3, y0 + 3, hIco, 16, 16, 0, 0, 3
DestroyIcon hIco
End If
Next
Set picOvl.Picture = picOvl.Image
End Sub
Private Sub tmrCheck_Timer()
Dim Pnt&(0 To 1): GetCursorPos Pnt(0)
If WindowFromPoint(Pnt(0), Pnt(1)) <> hWndCmdBar Then RenderButton 0: Exit Sub
Dim Rct&(0 To 3): GetWindowRect hWndCmdBar, Rct(0)
Dim x&, y&: x = Pnt(0) - Rct(0): y = Pnt(1) - Rct(1)
If x >= x1 And x <= x1 + sz Then RenderButton 1, x1, y0, sz
If x >= x2 And x <= x2 + sz Then RenderButton 2, x2, y0, sz
If x >= x3 And x <= x3 + sz Then RenderButton 3, x3, y0, sz
End Sub
Private Sub RenderButton(ByVal Idx&, Optional ByVal x&, Optional ByVal y&, Optional ByVal sz&)
Static LastIdx As Long
If LastIdx = Idx Then Exit Sub Else LastIdx = Idx
picOvl.Cls
If Idx Then picOvl.Line (x, y)-(x + sz, y + sz), &H888888, B
picOvl.Refresh
End Sub
Usage then (either for Testing in a virginal, normal VB6-Form-Project, or from within your Addin-Project):
Code:
Option Explicit
Private PrjToolbar As New cProjToolbar
Private Sub Form_Load()
PrjToolbar.InitFrom Me
End Sub
So the only requirements are, that you pass a normal VB-Form-instance into the Class' InitFrom-method...
HTH
Olaf
You're the best Olaf. I'll give this a shot later today. Thanks a ton!
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by LinkFX
Check the Releases tab in GitHub my friend. I haven't actually included your excellent Addin per se in the pack (It does come highly recommended though!) but I've added support for ModernVB to detect it and display it whenever you switch to the code layout!
OhH! totally missed that! Thanks... testing it now...
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by Schmidt
FWIW (regarding your "last open problem" with the Icons in the Project-ToolWindow)...
I've made a self-contained drop-in Class, which handles the suggested "overlay-solution" already
(it's robust and relatively small - requiring no SubClassing)...
So the only requirements are, that you pass a normal VB-Form-instance into the Class' InitFrom-method...
HTH
Olaf
I've tested your code and it works exceptionally well! I specially like what you're doing to extract icons for the toolbar, very creative. I'm going to make the necessary changes and include it in the add-in and credit you for the module. Thank you very much for your fantastic work!
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
You can use the method of streamlining the installation package to leave the necessary files and remove other files. The installation package of VB6 will become only 6M, and the decompression installation is only about 30M. The biggest difficulty for VB6 is that there is no newcomer to learn this language, and it is difficult to install successfully on WIN8 and WIN10 systems. If you use the install.bat method or VBS method to install, the main thing is to register some COM DLL and OCX, add some registry, each computer can be 100% successfully installed, it takes 5-20 seconds to complete.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Modern VB v1.7 has been released!
Here's a brief changelog:
- Included detailed instructions on the root of the release explaining all the procedures necessary to correctly setup ModernVB
- Menu icons have been updated with a few new icons and tweaks
- Project Explorer icons are now replaced by modern icons automatically (thanks to Olaf Schmidt for the concept)
- Initial support for international languages on the add-in side (requires using the optimal settings registry file)
- Patches now include English, French, Spanish and Chinese language support as well as unlimited undo/redo functionality
- Minor tweaks and fixes (Gauge bar docking to Menu should work correctly now)
If you're one of the people who haven't been able to use ModernVB because your Visual Basic is not in English, give this release a shot!
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
It would be useful to include uninstall instructions along with the installation instructions in the event something goes wrong or the user wishes to undo the changes.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
In fact, I did encounter an error when trying to patch VB6.exe (yes, I'm running VB6SP2):
Extract from the file 'VS6sp6B2.cab' in this setup: https://www.microsoft.com/en-us/down...s.aspx?id=5721
Applying patch, please wait... (don't panic!)
An error has occurred: xdelta3: target window checksum mismatch: XD3_INVALID_INPUT
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
1. Run the included registry file and accept the prompt to merge values into the registry.
2. Copy the included DLL file to your Visual Basic program files folder.
3. Right click the DLL file you just copied and choose 'Register' from the context menu
#3 - I don't have a Register in the right click drop down so I opened a command window, cd'd to the proper directory and entered
regsvr32 ModernVBv 1.7.dll and (of course), regsvr32 didn't like the space in the filename. I assume I can't change it so now I'm stuck
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
In fact, I did encounter an error when trying to patch VB6.exe (yes, I'm running VB6SP2):
Extract from the file 'VS6sp6B2.cab' in this setup: https://www.microsoft.com/en-us/down...s.aspx?id=5721
Applying patch, please wait... (don't panic!)
An error has occurred: xdelta3: target window checksum mismatch: XD3_INVALID_INPUT
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
OK, turned off Checksum validation in the patch program and patched both VB6.exe and VB6IDE.dll but I don't get how to patch the color theme as it's an .xml and the patch program doesn't allow me to add it to patch VBA6.dll
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by KenHorse
OK, turned off Checksum validation in the patch program and patched both VB6.exe and VB6IDE.dll but I don't get how to patch the color theme as it's an .xml and the patch program doesn't allow me to add it to patch VBA6.dll
I did, too, and got it to work. So far so good.
I started with the original theme and all was fine.
I then tried the dark theme, but that caused VB6 to blow up when I ran it so I had to revert back to the original theme.
Also, successfully installed MZTools and the Bookmark add-in.
How do you get the lines connecting If, Then, Elses?
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
I can't get either the dark nor the navy color scheme to work, only the original. Also, when I first launch, it throws a popup - something to the effect of encountering a stop but then the IDE opens
Edit: The error popup says "Stop Statement Encountered"
Last edited by KenHorse; May 2nd, 2020 at 02:19 PM.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by schnel
How do you get the lines connecting If, Then, Elses?
That's a feature added by the CodeSmart 2013 Addin.
Originally Posted by KenHorse
OK, turned off Checksum validation in the patch program and patched both VB6.exe and VB6IDE.dll but I don't get how to patch the color theme as it's an .xml and the patch program doesn't allow me to add it to patch VBA6.dll
The patches for VBA6.dll are in the (International) folder since they apply to all languages.
I can't get either the dark nor the navy color scheme to work, only the original.
For the color scheme, patch the extracted VBA6.dll with either the navy or dark patch then apply the "Enable Custom Themes" registry file and relaunch VB. Don't try to patch a file that was previously patched. Always patch the native binaries extracted from the cab files, and only once.
Also, when I first launch, it throws a popup - something to the effect of encountering a stop but then the IDE opens
As for the stop statement, it seems you're failing an assert that I never got myself and thus forgot to take off the statement. Download the source code, search for this line
Code:
AddButton_Err:
#If DEBUG_MODE = 1 Then
Echo "Error '" & Err.Number & "' while copying button " & Button.Index & " [" & Button.Caption & "]: " & Err.Description, vbLogEventTypeError
#End If
Stop
Resume Next
It seems like you people are patching your local VB6 binaries. Do not do that. Patch only the VB binaries extracted from the cab file inside the SP6 download and then put those in your VB98 folder replacing the originals (make backups!). The SP6 binaries are the versions that match MD5 with the patches. It's possible that you can get the patches to work by ignoring checksums, but there's no reason not to use the SP6 binaries which are guaranteed to work.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Hi LinkFX! you should check FixPalette2020 by Leandro Ascierto. It replace the standard properties color palette with multiple palettes and a eyedropper with zoom that can pick colors from all the screen. I have the oportunity to test it and its a new must!
Consider adding it to the recomended list
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Some people develop a new programming language instead of VB6, in fact, relatively directly write a new interface, using the same compiler, this is also very good.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by LinkFX
Modern VB v1.7 has been released!
Here's a brief changelog:
- Included detailed instructions on the root of the release explaining all the procedures necessary to correctly setup ModernVB
- Menu icons have been updated with a few new icons and tweaks
- Project Explorer icons are now replaced by modern icons automatically (thanks to Olaf Schmidt for the concept)
- Initial support for international languages on the add-in side (requires using the optimal settings registry file)
- Patches now include English, French, Spanish and Chinese language support as well as unlimited undo/redo functionality
- Minor tweaks and fixes (Gauge bar docking to Menu should work correctly now)
If you're one of the people who haven't been able to use ModernVB because your Visual Basic is not in English, give this release a shot!
I use the Chinese version of the programming language. Before I tested, you this plug-in can not use a lot of errors. Now I'll try the new version and see if it works.
In the case of the Chinese version of VB6, many icons cannot be displayed, and it prompts STOP when it is opened for the first time, and it often crashes unexpectedly.
Last edited by xiaoyao; Apr 26th, 2021 at 08:58 PM.
Edit: Nevermind. There's an 'Apply patch' button that's hidden until you resize the window on the patcher.
But now... a message box saying 'encountered stop statement' comes up every time VB is opened.
also, can't find that neat looking 'document map' . is that a separate addin?
Any way to make things not fantastically tiny? Somehow impossible to turn off the high DPI mode even by taking it out of the manifest.
Last edited by fafalone; Apr 27th, 2021 at 12:50 AM.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
I tested it and it was almost useless, a bunch of errors. The best way is to redesign a VB6 IDE. Use the ADD-IN plug-in method to design a brand new interface. Or some functions are gradually enhanced.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by LinkFX
Good evening everyone
I'd like to announce that I've released a public version of my ModernVB add-in and the modification pack that should allow you to completely transform your Visual Basic 6 IDE and bring it into the 21st century with many new features to enhance its usefulness and appearance.
Hi ! I wanted to congratulate you for such a great job. However, one thing I would like to point out for improvement is the toolbar icons, they just disappear when not in use, or without loading a project.
:
I would like it to have a "off" appearance in shades of grey. Is this possible? Otherwise, I think it's the best IDE mod ever for VB6, congratulations! All working for me, win10x64 vb6 in english, so, xiaoyao, I disagree with you. Maybe the Chinese version has problems, just use the English version, you should be able to understand. Greetings!
Last edited by FrannDzs; May 27th, 2022 at 01:29 PM.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by gaouser
better idea: switch to vs2010
Why how does that help someone trying to use VB6? That's what this tool/thread is about ... a new IDE for VB6 ... not .NET but VB6.
Not everyone wants or can use .NET. Some people still want (or have) to use VB6 for a variety of reasons. Suggesting they move to a completely different language/tool is a non-started.
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by techgnome
Why how does that help someone trying to use VB6? That's what this tool/thread is about ... a new IDE for VB6 ... not .NET but VB6.
Not everyone wants or can use .NET. Some people still want (or have) to use VB6 for a variety of reasons. Suggesting they move to a completely different language/tool is a non-started.
-tg
And if they were to move why suggest moving to a 12 year old version?
Re: ModernVB - Modernize your VB6 IDE - Now released publicly for testing!
Originally Posted by gaouser
better idea: switch to vs2010
Why is it a better idea to switch to an inferior product that's 12 years outdated itself unless you need one of the narrow things it can do that just aren't possible in VB6?
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.