[VB6/VBA] "modern" Version of IsLeapYear and LastDayOfMonth-Functions
Hi Folks, was watching this fascinating video this weekend: "Implementing Fast Calendar Algorithms" https://www.youtube.com/watch?v=J9KijLyP-yg And i caught myself thinking: Huh? I've been doing the...
View ArticleUsing a Collection for Sorting
I've discussed all this before, but it came up again in a recent post I made (although I don't think it was considered). Here's some code that allows using a Collection for sorting purposes (designed...
View ArticleSubclassing At Its Simplest
There are several examples of how to subclass in this CodeBank. However, most go into complexities of how to "protect the IDE". I'm posting this to provide an example of VB6 subclassing at its...
View ArticleINameSpaceTreeControl Sample
Here is a sample how to implement, take advantage of and exploit the "explorer.exe" built in TreeView Control. Basic Set Up for the INameSpaceTreeControl2: Code: Private Sub Command8_Click() Dim pidl...
View ArticleSimpliest way to get a pointer to IShellItemImageFactory
Here is the most simpliest way to get access to the images/icons/thumbnails!! All you need is a typelib that supports IShellItem and IShellItemImageFactory. Here we go!! Code: Public Function...
View ArticleDo you wanna handle the Taskbar? Here is the most easy way!
All you need is a Typelib with access to ITaskbar and 2 and 3. Code: Public Function ShGetTaskBar(pITB As ITaskbarList) As Long Dim hr As Long Static CLSID_TaskbarList As GUID CLSIDFromString2...
View ArticleSubclassing made easy
This is an easy *and* somewhat useful subclassing which calls back into the form or user-control or whichever object instance the subclassing originates from. One could half-heartedly claim it is...
View ArticleTake advantage of IThumbNailProvider
Here is a simple example how to to "skin" your form with a thumbnail. Since with this thumbnailhandler you can use up to max 2048 pixels depending on what source you use! I just choosed to make a...
View ArticleTake advanatage of IThumbNailProvider
Here is a simple example how to to "skin" your form with a thumbnail. Since with this thumbnailhandler you can use up to max 2048 pixels depending on what source you use! I just choosed to make a...
View ArticleReason why you not shall use CreateSymbolicLinkW....
In this example I have used both the ole32 CreateSymbolicLinkW API which creates a copy of it self as a 0-bytes link. Code: Private Sub Command10_Click() Dim pISLW As IShellLinkW Dim pIPF As...
View ArticleMy first ever example ported from C++ to VB6 as I interperated it with a...
I felt for doing my very first interperation of a sample from the Win7 SDK "strait out from the comfort." I did NOT peep at any other VB6 code while I did this. Just soly relied on the C++ source and...
View ArticleGet Real PIDL From NET in the MOST simple way
Have you ever wondered over how to get a PIDL from a NET object (WWW or FTP or //Netpath)? Here it comes as the most simple way. First you create a IShellItem from the URL path since the IShellItem in...
View Article[VB6/VBA] Wheeler & Needham’s Tiny Encryption Algorithm
This mdTea.bas is implementation of latest XXTEA variant of the Wheeler & Needham’s Tiny Encryption Algorithm. While the C code in the linked Wikipedia article is short and elegant the VBx variant...
View ArticleUsed Printwindow to capture Window and cropping
Code: Option Explicit Public Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type Public Type POINTAPI x As Long y As Long End Type Public Enum...
View ArticleImage Processing: Image similarity algorithms aHash, dHash, pHash
There are about 4 types of hashing algorithms: Difference Hash: DHash(Difference Hash) Average Hash: AHash(Average Hash) Perceptual Hash: PHash (Perceptual Hash) Wavelet Hash: WHash (Wavelet Hash) I...
View ArticleControl the Chrome browser with Chromdirver for web page automation
Control the Chrome browser with Chromdirver for web page automation There are a lot of similar codes, but very few pure VB ones. This is the code I used to write by referring to other people's code and...
View ArticleAutomatic mouse click operation
Automatic mouse click operation Code: Option Explicit Private Declare Function SystemParametersInfo _ Lib "user32" _ Alias "SystemParametersInfoA" (ByVal uAction As...
View Articleused HttpSendRequestEx Upload data to the web page in sections
// InternetOpen ---:InternetConnect----HttpOpenRequest----InternetSetOption -HttpAddRequestHeaders---HttpSendRequestEx Code: Option Explicit Event HttpError(Status As String) Event HttpOpen(Status As...
View Article[VB6/VBA/twinBASIC] The quickest way to the real Windows version:...
The simplest version APIs all lie unless you have a manifest. If you want to be sure you get the real version no matter what, there's various more complicated techniques. The one I had been using...
View ArticleForm & Controls Resizer (including Font.Size)
Ok, yeah, this has been done a couple of times before. But I've never been happy with what's out there. So here's my version. There's a sample project with everything in it. But I'm going through it...
View Article