<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>VBForums - Visual Basic 6 and Earlier</title>
		<link>https://www.vbforums.com/</link>
		<description><![CDATA[This forum is for all your Visual Basic (versions 3, 4, 5, & 6) coding questions that do not fit into one of the more specific forums below.]]></description>
		<language>en</language>
		<lastBuildDate>Thu, 04 Jun 2026 02:27:24 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>https://www.vbforums.com/images/misc/rss.png</url>
			<title>VBForums - Visual Basic 6 and Earlier</title>
			<link>https://www.vbforums.com/</link>
		</image>
		<item>
			<title>FolderExists Issue</title>
			<link>https://www.vbforums.com/showthread.php?912062-FolderExists-Issue&amp;goto=newpost</link>
			<pubDate>Wed, 03 Jun 2026 16:40:33 GMT</pubDate>
			<description><![CDATA[Hi All

I recently started to get some errors in my Folderexists function. If the Folder name was not the same case it would cause it to return False.


Code:
---------
Private Const MAX_PATH As Long = 260
Private Const INVALID_HANDLE_VALUE As Long = -1
Private Const FILE_ATTRIBUTE_DIRECTORY As Long = &H10

Private Type FILETIME
    dwLowDateTime As Long
    dwHighDateTime As Long
End Type


Private Type WIN32_FIND_DATA
    dwFileAttributes As Long
    ftCreationTime As FILETIME
    ftLastAccessTime As FILETIME
    ftLastWriteTime As FILETIME
    nFileSizeHigh As Long
    nFileSizeLow As Long
    dwReserved0 As Long
    dwReserved1 As Long
    cFileName As String * MAX_PATH
    cAlternate As String * 14
End Type



Private Declare Function FindFirstFile Lib "kernel32" _
() '                                       Alias "FindFirstFileA" _
                                       (ByVal lpFileName As String, _
                                        lpFindFileData As WIN32_FIND_DATA) As Long

Private Declare Function FindClose Lib "kernel32" _
() '                                   (ByVal hFindFile As Long) As Long



Public Function FolderExists(sFolder As String) As Boolean

    Dim hFile As Long
    Dim WFD As WIN32_FIND_DATA

    'remove training slash before verifying
    sFolder = UnQualifyPath(sFolder)

    'call the API pasing the folder
    hFile = FindFirstFile(sFolder, WFD)

    'if a valid file handle was returned,
    'and the directory attribute is set
    'the folder exists
    FolderExists = (hFile <> INVALID_HANDLE_VALUE) And _
                   (WFD.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY)

    'clean up
    Call FindClose(hFile)

End Function

Private Function UnQualifyPath(ByVal sFolder As String) As String

'trim and remove any trailing slash
    sFolder = Trim$(sFolder)

    If Right$(sFolder, 1) = "\" Then
        UnQualifyPath = Left$(sFolder, Len(sFolder) - 1)
    Else
        UnQualifyPath = sFolder
    End If

End Function
---------
i then swapped to


Code:
---------
Private Declare Function PathIsDirectory Lib "shlwapi.dll" Alias "PathIsDirectoryA" _
(ByVal pszPath As String) As Long


Public Function FolderExists(ByVal sFolder As String) As Boolean
    FolderExists = PathIsDirectory(sFolder)
End Function
---------
and it works fine.

Why would the first example now say False if case is incorrect but the folder path is correct.

tks]]></description>
			<content:encoded><![CDATA[<div>Hi All<br />
<br />
I recently started to get some errors in my Folderexists function. If the Folder name was not the same case it would cause it to return False.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Private Const MAX_PATH As Long = 260<br />
Private Const INVALID_HANDLE_VALUE As Long = -1<br />
Private Const FILE_ATTRIBUTE_DIRECTORY As Long = &amp;H10<br />
<br />
Private Type FILETIME<br />
&nbsp; &nbsp; dwLowDateTime As Long<br />
&nbsp; &nbsp; dwHighDateTime As Long<br />
End Type<br />
<br />
<br />
Private Type WIN32_FIND_DATA<br />
&nbsp; &nbsp; dwFileAttributes As Long<br />
&nbsp; &nbsp; ftCreationTime As FILETIME<br />
&nbsp; &nbsp; ftLastAccessTime As FILETIME<br />
&nbsp; &nbsp; ftLastWriteTime As FILETIME<br />
&nbsp; &nbsp; nFileSizeHigh As Long<br />
&nbsp; &nbsp; nFileSizeLow As Long<br />
&nbsp; &nbsp; dwReserved0 As Long<br />
&nbsp; &nbsp; dwReserved1 As Long<br />
&nbsp; &nbsp; cFileName As String * MAX_PATH<br />
&nbsp; &nbsp; cAlternate As String * 14<br />
End Type<br />
<br />
<br />
<br />
Private Declare Function FindFirstFile Lib &quot;kernel32&quot; _<br />
() '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Alias &quot;FindFirstFileA&quot; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (ByVal lpFileName As String, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lpFindFileData As WIN32_FIND_DATA) As Long<br />
<br />
Private Declare Function FindClose Lib &quot;kernel32&quot; _<br />
() '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (ByVal hFindFile As Long) As Long<br />
<br />
<br />
<br />
Public Function FolderExists(sFolder As String) As Boolean<br />
<br />
&nbsp; &nbsp; Dim hFile As Long<br />
&nbsp; &nbsp; Dim WFD As WIN32_FIND_DATA<br />
<br />
&nbsp; &nbsp; 'remove training slash before verifying<br />
&nbsp; &nbsp; sFolder = UnQualifyPath(sFolder)<br />
<br />
&nbsp; &nbsp; 'call the API pasing the folder<br />
&nbsp; &nbsp; hFile = FindFirstFile(sFolder, WFD)<br />
<br />
&nbsp; &nbsp; 'if a valid file handle was returned,<br />
&nbsp; &nbsp; 'and the directory attribute is set<br />
&nbsp; &nbsp; 'the folder exists<br />
&nbsp; &nbsp; FolderExists = (hFile &lt;&gt; INVALID_HANDLE_VALUE) And _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  (WFD.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY)<br />
<br />
&nbsp; &nbsp; 'clean up<br />
&nbsp; &nbsp; Call FindClose(hFile)<br />
<br />
End Function<br />
<br />
Private Function UnQualifyPath(ByVal sFolder As String) As String<br />
<br />
'trim and remove any trailing slash<br />
&nbsp; &nbsp; sFolder = Trim$(sFolder)<br />
<br />
&nbsp; &nbsp; If Right$(sFolder, 1) = &quot;\&quot; Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; UnQualifyPath = Left$(sFolder, Len(sFolder) - 1)<br />
&nbsp; &nbsp; Else<br />
&nbsp; &nbsp; &nbsp; &nbsp; UnQualifyPath = sFolder<br />
&nbsp; &nbsp; End If<br />
<br />
End Function</code><hr />
</div>i then swapped to<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Private Declare Function PathIsDirectory Lib &quot;shlwapi.dll&quot; Alias &quot;PathIsDirectoryA&quot; _<br />
(ByVal pszPath As String) As Long<br />
<br />
<br />
Public Function FolderExists(ByVal sFolder As String) As Boolean<br />
&nbsp; &nbsp; FolderExists = PathIsDirectory(sFolder)<br />
End Function</code><hr />
</div>and it works fine.<br />
<br />
Why would the first example now say False if case is incorrect but the folder path is correct.<br />
<br />
tks</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>k_zeon</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912062-FolderExists-Issue</guid>
		</item>
		<item>
			<title>mousemove and treeview</title>
			<link>https://www.vbforums.com/showthread.php?912061-mousemove-and-treeview&amp;goto=newpost</link>
			<pubDate>Wed, 03 Jun 2026 14:15:25 GMT</pubDate>
			<description><![CDATA[how to, intercept when mousemove cursor go to node key to another node key:

nodekey =1
next move
nodekey =1
no effect

node key=1
next move
node key=a1
then msgbox ="different node!"]]></description>
			<content:encoded><![CDATA[<div>how to, intercept when mousemove cursor go to node key to another node key:<br />
<br />
nodekey =1<br />
next move<br />
nodekey =1<br />
no effect<br />
<br />
node key=1<br />
next move<br />
node key=a1<br />
then msgbox =&quot;different node!&quot;</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>luca90</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912061-mousemove-and-treeview</guid>
		</item>
		<item>
			<title>VB6 2-nd pass compiler error on BAS module</title>
			<link>https://www.vbforums.com/showthread.php?912060-VB6-2-nd-pass-compiler-error-on-BAS-module&amp;goto=newpost</link>
			<pubDate>Tue, 02 Jun 2026 19:59:05 GMT</pubDate>
			<description><![CDATA[Sharing this (https://gist.github.com/wqweto/4532ab026aeecd9c43fc487d2daa3fa5) Claude generated tool here (to not get it lost) which finds procedures with useless *On Error GoTo 0* which trip up VB6 compiler's codegen and result in linker error i.e. the binary produced is non-functional because of 2-nd pass codegen the compiler bombs out. The problem is exacerbated when line numbers are used with such extraneous *On Error GoTo 0* i.e. compiling production code with *Erl* support for error handling might bomb on build server.

Here is the powershell script that you might want to check you projects for potential problems:


Code:
---------
# Find-DanglingOnErrorGoto0.ps1

param(
    [string]$Path
)

# Finds VB6 procedures that have `On Error GoTo 0` but do NOT have a real
# error handler (neither `On Error GoTo <label>` nor `On Error Resume Next`).

if (-not $Path) {
    @"
Find-DanglingOnErrorGoto0.ps1 - Find VB6 procedures with a dangling 'On Error GoTo 0'.

Reports procedures that contain 'On Error GoTo 0' but never install a real error
handler ('On Error GoTo <label>' or 'On Error Resume Next') before it.

Usage:
    .\Find-DanglingOnErrorGoto0.ps1 -Path <folder-or-file>

Parameters:
    -Path   Folder (searched recursively) or file to scan. Scans *.bas, *.cls,
            *.frm and *.ctl files.

Example:
    .\Find-DanglingOnErrorGoto0.ps1 -Path C:\Projects\MyVB6App
"@ | Write-Output
    return
}

$reProcStart = '^\s*(?:(?:Public|Private|Friend|Static)\s+)*(?:Sub|Function|Property\s+(?:Get|Let|Set))\s+(\w+)'
$reProcEnd   = '^\s*End\s+(?:Sub|Function|Property)\b'
$reGoto0     = '^\s*On\s+Error\s+GoTo\s+0\s*$'
$reResume    = '^\s*On\s+Error\s+Resume\s+Next\b'
$reGotoLabel = '^\s*On\s+Error\s+GoTo\s+(?!0\s*$)\S+'

$files = Get-ChildItem -Path $Path -Recurse -Include *.bas, *.cls, *.frm, *.ctl -File
$results = foreach ($f in $files) {
    $lines = Get-Content -LiteralPath $f.FullName
    $inProc = $false
    $procName = ''
    $procStartLine = 0
    $handlerInstalled = $false   # is a handler active AT THIS POINT
    $danglingLines = @()         # On Error GoTo 0 with no active handler before it

    for ($i = 0; $i -lt $lines.Count; $i++) {
        $line = $lines[$i]
        $lineNo = $i + 1

        if (-not $inProc) {
            $m = [regex]::Match($line, $reProcStart, 'IgnoreCase')
            if ($m.Success) {
                $inProc = $true
                $procName = $m.Groups[1].Value
                $procStartLine = $lineNo
                $handlerInstalled = $false
                $danglingLines = @()
            }
            continue
        }

        if ($line -imatch $reProcEnd) {
            if ($danglingLines.Count -gt 0) {
                [pscustomobject]@{
                    File      = $f.FullName
                    Procedure = $procName
                    ProcLine  = $procStartLine
                    Goto0At   = ($danglingLines -join ',')
                }
            }
            $inProc = $false
            continue
        }

        if ($line -imatch $reResume -or $line -imatch $reGotoLabel) {
            $handlerInstalled = $true       # installs a handler for the rest of the procedure
        } elseif ($line -imatch $reGoto0) {
            # flag only if NO handler was installed anywhere earlier in the procedure;
            # sticky flag, because due to branching (each GoTo 0 sits in a separate branch,
            # followed by Err.Raise/Exit) the top-level handler is actually active on the path
            if (-not $handlerInstalled) { $danglingLines += $lineNo }
        }
    }
}

$results = @($results)
if ($results.Count -gt 0) {
    $results | Sort-Object File, ProcLine | Format-Table -AutoSize
    "Total: $($results.Count) procedure(s) with dangling 'On Error GoTo 0'." | Write-Output
} else {
    "None found." | Write-Output
}
---------
cheers,
</wqw>]]></description>
			<content:encoded><![CDATA[<div>Sharing <a rel="nofollow" href="https://gist.github.com/wqweto/4532ab026aeecd9c43fc487d2daa3fa5" target="_blank" rel="nofollow">this</a> Claude generated tool here (to not get it lost) which finds procedures with useless <b>On Error GoTo 0</b> which trip up VB6 compiler's codegen and result in linker error i.e. the binary produced is non-functional because of 2-nd pass codegen the compiler bombs out. The problem is exacerbated when line numbers are used with such extraneous <b>On Error GoTo 0</b> i.e. compiling production code with <b>Erl</b> support for error handling might bomb on build server.<br />
<br />
Here is the powershell script that you might want to check you projects for potential problems:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code"># Find-DanglingOnErrorGoto0.ps1<br />
<br />
param(<br />
&nbsp; &nbsp; [string]$Path<br />
)<br />
<br />
# Finds VB6 procedures that have `On Error GoTo 0` but do NOT have a real<br />
# error handler (neither `On Error GoTo &lt;label&gt;` nor `On Error Resume Next`).<br />
<br />
if (-not $Path) {<br />
&nbsp; &nbsp; @&quot;<br />
Find-DanglingOnErrorGoto0.ps1 - Find VB6 procedures with a dangling 'On Error GoTo 0'.<br />
<br />
Reports procedures that contain 'On Error GoTo 0' but never install a real error<br />
handler ('On Error GoTo &lt;label&gt;' or 'On Error Resume Next') before it.<br />
<br />
Usage:<br />
&nbsp; &nbsp; .\Find-DanglingOnErrorGoto0.ps1 -Path &lt;folder-or-file&gt;<br />
<br />
Parameters:<br />
&nbsp; &nbsp; -Path&nbsp;  Folder (searched recursively) or file to scan. Scans *.bas, *.cls,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; *.frm and *.ctl files.<br />
<br />
Example:<br />
&nbsp; &nbsp; .\Find-DanglingOnErrorGoto0.ps1 -Path C:\Projects\MyVB6App<br />
&quot;@ | Write-Output<br />
&nbsp; &nbsp; return<br />
}<br />
<br />
$reProcStart = '^\s*(?:(?:Public|Private|Friend|Static)\s+)*(?:Sub|Function|Property\s+(?:Get|Let|Set))\s+(\w+)'<br />
$reProcEnd&nbsp;  = '^\s*End\s+(?:Sub|Function|Property)\b'<br />
$reGoto0&nbsp; &nbsp;  = '^\s*On\s+Error\s+GoTo\s+0\s*$'<br />
$reResume&nbsp; &nbsp; = '^\s*On\s+Error\s+Resume\s+Next\b'<br />
$reGotoLabel = '^\s*On\s+Error\s+GoTo\s+(?!0\s*$)\S+'<br />
<br />
$files = Get-ChildItem -Path $Path -Recurse -Include *.bas, *.cls, *.frm, *.ctl -File<br />
$results = foreach ($f in $files) {<br />
&nbsp; &nbsp; $lines = Get-Content -LiteralPath $f.FullName<br />
&nbsp; &nbsp; $inProc = $false<br />
&nbsp; &nbsp; $procName = ''<br />
&nbsp; &nbsp; $procStartLine = 0<br />
&nbsp; &nbsp; $handlerInstalled = $false&nbsp;  # is a handler active AT THIS POINT<br />
&nbsp; &nbsp; $danglingLines = @()&nbsp; &nbsp; &nbsp; &nbsp;  # On Error GoTo 0 with no active handler before it<br />
<br />
&nbsp; &nbsp; for ($i = 0; $i -lt $lines.Count; $i++) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $line = $lines[$i]<br />
&nbsp; &nbsp; &nbsp; &nbsp; $lineNo = $i + 1<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (-not $inProc) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $m = [regex]::Match($line, $reProcStart, 'IgnoreCase')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($m.Success) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $inProc = $true<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $procName = $m.Groups[1].Value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $procStartLine = $lineNo<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $handlerInstalled = $false<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $danglingLines = @()<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($line -imatch $reProcEnd) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($danglingLines.Count -gt 0) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [pscustomobject]@{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; File&nbsp; &nbsp; &nbsp; = $f.FullName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Procedure = $procName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ProcLine&nbsp; = $procStartLine<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Goto0At&nbsp;  = ($danglingLines -join ',')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $inProc = $false<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; continue<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($line -imatch $reResume -or $line -imatch $reGotoLabel) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $handlerInstalled = $true&nbsp; &nbsp; &nbsp;  # installs a handler for the rest of the procedure<br />
&nbsp; &nbsp; &nbsp; &nbsp; } elseif ($line -imatch $reGoto0) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # flag only if NO handler was installed anywhere earlier in the procedure;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # sticky flag, because due to branching (each GoTo 0 sits in a separate branch,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # followed by Err.Raise/Exit) the top-level handler is actually active on the path<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (-not $handlerInstalled) { $danglingLines += $lineNo }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
}<br />
<br />
$results = @($results)<br />
if ($results.Count -gt 0) {<br />
&nbsp; &nbsp; $results | Sort-Object File, ProcLine | Format-Table -AutoSize<br />
&nbsp; &nbsp; &quot;Total: $($results.Count) procedure(s) with dangling 'On Error GoTo 0'.&quot; | Write-Output<br />
} else {<br />
&nbsp; &nbsp; &quot;None found.&quot; | Write-Output<br />
}</code><hr />
</div>cheers,<br />
&lt;/wqw&gt;</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>wqweto</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912060-VB6-2-nd-pass-compiler-error-on-BAS-module</guid>
		</item>
		<item>
			<title>Show tool tip ballon on each node of  a treeview</title>
			<link>https://www.vbforums.com/showthread.php?912058-Show-tool-tip-ballon-on-each-node-of-a-treeview&amp;goto=newpost</link>
			<pubDate>Tue, 02 Jun 2026 17:26:01 GMT</pubDate>
			<description>Possibile? 
Tks</description>
			<content:encoded><![CDATA[<div>Possibile? <br />
Tks</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>luca90</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912058-Show-tool-tip-ballon-on-each-node-of-a-treeview</guid>
		</item>
		<item>
			<title>ADD also a baloon tooltip on treeview</title>
			<link>https://www.vbforums.com/showthread.php?912057-ADD-also-a-baloon-tooltip-on-treeview&amp;goto=newpost</link>
			<pubDate>Tue, 02 Jun 2026 09:18:31 GMT</pubDate>
			<description>i use this code on mosenove treewviev:

Code:
---------
Private Sub TreeView1_MouseMove(Button As Integer, Shift As _
                                Integer, x As Single, y As _
                                Single)
  Dim N As ComctlLib.Node
  
    Set N = TreeView1.HitTest(x, y)
    If Not (N Is Nothing) Then
      
        Set TreeView1.DropHighlight = N
      
      Set N = Nothing
    End If
    
End Sub
---------
 
possible to add also a tooltip ballon during the mouse move event?</description>
			<content:encoded><![CDATA[<div>i use this code on mosenove treewviev:<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Private Sub TreeView1_MouseMove(Button As Integer, Shift As _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Integer, x As Single, y As _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Single)<br />
&nbsp; Dim N As ComctlLib.Node<br />
&nbsp; <br />
&nbsp; &nbsp; Set N = TreeView1.HitTest(x, y)<br />
&nbsp; &nbsp; If Not (N Is Nothing) Then<br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Set TreeView1.DropHighlight = N<br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; Set N = Nothing<br />
&nbsp; &nbsp; End If<br />
&nbsp; &nbsp; <br />
End Sub</code><hr />
</div>possible to add also a tooltip ballon during the mouse move event?</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>luca90</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912057-ADD-also-a-baloon-tooltip-on-treeview</guid>
		</item>
		<item>
			<title>VBMAN - A Modern Network Development Framework for VB6/VBA (Open Source)</title>
			<link>https://www.vbforums.com/showthread.php?912054-VBMAN-A-Modern-Network-Development-Framework-for-VB6-VBA-(Open-Source)&amp;goto=newpost</link>
			<pubDate>Mon, 01 Jun 2026 13:53:35 GMT</pubDate>
			<description><![CDATA[Hey, ervrybudy, visualbasic!

I'm excited to share that I've just open-sourced **VBMAN**, a network application development framework I've been working on since 2017. It's designed specifically for VB6 and VBA developers who need modern networking capabilities.

## What is VBMAN?

VBMAN is a comprehensive network development framework that brings modern web technologies to the BASIC ecosystem. If you've ever struggled with making HTTP requests, hosting a web server, or handling WebSockets in VB6/VBA, this might save you some headaches.

## Key Features

### Web Development
- **HTTP Server** - Build lightweight web services directly in VB6/VBA
- **HTTP Client** - Modern HTTP/HTTPS requests with JSON support
- **WebSocket** - Real-time bidirectional communication
- **Server-Sent Events (SSE)** - Server-to-client streaming
- **JSON Processing** - Native JSON serialization/deserialization

### Database & Storage
- **Database Access** - Simplified SQL operations
- **Redis Client** - Cache and message broker support
- **INI File Handler** - Structured configuration management

### Industrial IoT Protocols
- **Modbus TCP/RTU** - Master and Slave implementations
- **MQTT Client/Server** - Lightweight messaging for IoT
- **Serial Port** - Direct hardware communication

### Utilities
- **Shadow Window** - Modern UI effects for VB6 forms
- **Collection Tools** - Enhanced data structures
- **Cryptography** - AES, Hash, HMAC support
- **Logging System** - Structured application logging

## Why VBMAN?

I started this project in 2017 because I needed to build network applications for industrial automation, but VB6's built-in networking capabilities were... limited. Rather than migrate everything to .NET, I decided to extend VB6's capabilities.

The framework is designed to feel native to VB6 developers - the API style follows familiar patterns, so you don't need to learn a completely new way of thinking.

## VBMAN2 - The Next Generation

I'm also working on **VBMAN2**, which **includes all VBMAN capabilities** and adds WebView2 support with two-way data binding. This means you can build modern web-based UIs that communicate seamlessly with your VB6/VBA code:

> **Note**: VBMAN2 is a superset of VBMAN - everything in VBMAN works in VBMAN2, plus more. You can seamlessly upgrade when you're ready.

```vb
' Bind UI elements to VB6 code
wv.BindData "username", "#user-name", "textContent"
wv.SetData "username", "John"  ' UI updates automatically

' Two-way binding
wv.BindUI Me, "OnSearch", "#search-input", EventName:="input"
```

## Project Info

- **License**: GPL-3.0 (Binary files are free forever, source available for personal use)
- **Documentation**: see gihub
- **Repository**: https://github.com/woeoio/vbman

## Who is this for?

- Maintaining legacy VB6/VBA applications
- Industrial automation systems
- Quick prototyping for internal tools
- Anyone who still enjoys BASIC syntax (no judgment here!)

## Questions?

Happy to answer any questions! The documentation site has detailed API references and examples. I've been using this in production environments for years, so it's battle-tested for industrial scenarios.

---

**Fun fact**: This project started as "BSMAN" (Basic Server Man) back in 2017, with grand plans for ASPMAN, VBSMAN, and VBAMAN sub-projects. Only VBMAN survived... and thrived!]]></description>
			<content:encoded><![CDATA[<div>Hey, ervrybudy, visualbasic!<br />
<br />
I'm excited to share that I've just open-sourced **VBMAN**, a network application development framework I've been working on since 2017. It's designed specifically for VB6 and VBA developers who need modern networking capabilities.<br />
<br />
## What is VBMAN?<br />
<br />
VBMAN is a comprehensive network development framework that brings modern web technologies to the BASIC ecosystem. If you've ever struggled with making HTTP requests, hosting a web server, or handling WebSockets in VB6/VBA, this might save you some headaches.<br />
<br />
## Key Features<br />
<br />
### Web Development<br />
- **HTTP Server** - Build lightweight web services directly in VB6/VBA<br />
- **HTTP Client** - Modern HTTP/HTTPS requests with JSON support<br />
- **WebSocket** - Real-time bidirectional communication<br />
- **Server-Sent Events (SSE)** - Server-to-client streaming<br />
- **JSON Processing** - Native JSON serialization/deserialization<br />
<br />
### Database &amp; Storage<br />
- **Database Access** - Simplified SQL operations<br />
- **Redis Client** - Cache and message broker support<br />
- **INI File Handler** - Structured configuration management<br />
<br />
### Industrial IoT Protocols<br />
- **Modbus TCP/RTU** - Master and Slave implementations<br />
- **MQTT Client/Server** - Lightweight messaging for IoT<br />
- **Serial Port** - Direct hardware communication<br />
<br />
### Utilities<br />
- **Shadow Window** - Modern UI effects for VB6 forms<br />
- **Collection Tools** - Enhanced data structures<br />
- **Cryptography** - AES, Hash, HMAC support<br />
- **Logging System** - Structured application logging<br />
<br />
## Why VBMAN?<br />
<br />
I started this project in 2017 because I needed to build network applications for industrial automation, but VB6's built-in networking capabilities were... limited. Rather than migrate everything to .NET, I decided to extend VB6's capabilities.<br />
<br />
The framework is designed to feel native to VB6 developers - the API style follows familiar patterns, so you don't need to learn a completely new way of thinking.<br />
<br />
## VBMAN2 - The Next Generation<br />
<br />
I'm also working on **VBMAN2**, which **includes all VBMAN capabilities** and adds WebView2 support with two-way data binding. This means you can build modern web-based UIs that communicate seamlessly with your VB6/VBA code:<br />
<br />
&gt; **Note**: VBMAN2 is a superset of VBMAN - everything in VBMAN works in VBMAN2, plus more. You can seamlessly upgrade when you're ready.<br />
<br />
```vb<br />
' Bind UI elements to VB6 code<br />
wv.BindData &quot;username&quot;, &quot;#user-name&quot;, &quot;textContent&quot;<br />
wv.SetData &quot;username&quot;, &quot;John&quot;  ' UI updates automatically<br />
<br />
' Two-way binding<br />
wv.BindUI Me, &quot;OnSearch&quot;, &quot;#search-input&quot;, EventName:=&quot;input&quot;<br />
```<br />
<br />
## Project Info<br />
<br />
- **License**: GPL-3.0 (Binary files are free forever, source available for personal use)<br />
- **Documentation**: see gihub<br />
- **Repository**: <a rel="nofollow" href="https://github.com/woeoio/vbman" target="_blank" rel="nofollow">https://github.com/woeoio/vbman</a><br />
<br />
## Who is this for?<br />
<br />
- Maintaining legacy VB6/VBA applications<br />
- Industrial automation systems<br />
- Quick prototyping for internal tools<br />
- Anyone who still enjoys BASIC syntax (no judgment here!)<br />
<br />
## Questions?<br />
<br />
Happy to answer any questions! The documentation site has detailed API references and examples. I've been using this in production environments for years, so it's battle-tested for industrial scenarios.<br />
<br />
---<br />
<br />
**Fun fact**: This project started as &quot;BSMAN&quot; (Basic Server Man) back in 2017, with grand plans for ASPMAN, VBSMAN, and VBAMAN sub-projects. Only VBMAN survived... and thrived!</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>woeoio</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912054-VBMAN-A-Modern-Network-Development-Framework-for-VB6-VBA-(Open-Source)</guid>
		</item>
		<item>
			<title>Line Numbering withiin a subroutine</title>
			<link>https://www.vbforums.com/showthread.php?912049-Line-Numbering-withiin-a-subroutine&amp;goto=newpost</link>
			<pubDate>Fri, 29 May 2026 18:16:18 GMT</pubDate>
			<description>Trying to load an app into the IDE on Win 10.  This works on win XP no problem.

I get at Ctrl-F5 an error messages saying a problem on line 700 about licensing in Sub Main.
There seems to be no indicator in the IDE to determine line I am at the subroutine so finding that particular line number in the subroutine becomes tedious.

How can I  find it easily?</description>
			<content:encoded><![CDATA[<div>Trying to load an app into the IDE on Win 10.  This works on win XP no problem.<br />
<br />
I get at Ctrl-F5 an error messages saying a problem on line 700 about licensing in Sub Main.<br />
There seems to be no indicator in the IDE to determine line I am at the subroutine so finding that particular line number in the subroutine becomes tedious.<br />
<br />
How can I  find it easily?</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>SteveM22</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912049-Line-Numbering-withiin-a-subroutine</guid>
		</item>
		<item>
			<title>screen crack animation joke ideas</title>
			<link>https://www.vbforums.com/showthread.php?912048-screen-crack-animation-joke-ideas&amp;goto=newpost</link>
			<pubDate>Fri, 29 May 2026 16:42:10 GMT</pubDate>
			<description>so this is a joke app I have wanted forever maybe some of the game guys will have some ideas here

- copy the desktop into your own image and take over screen to play with
- play cracking glass sound and draw cracks on the desktop image
- shards of the desktop start dropping away and some demon image from behind starts advancing
- second stage of shards/glass cracking sound
- demon emerges with a sound track
- disappears leaving people blinking at their screens

AI was able to do a pretty good job but it just feels likes it missing something / not everything it could be

ideas?

maybe an demon animation sequence like a video game as it runs and crawls through teh shards or
busts out the rest of the shards with a fist

there are 9 variants, you can choose on the command line by entering 1-9, 5 is the default</description>
			<content:encoded><![CDATA[<div>so this is a joke app I have wanted forever maybe some of the game guys will have some ideas here<br />
<br />
- copy the desktop into your own image and take over screen to play with<br />
- play cracking glass sound and draw cracks on the desktop image<br />
- shards of the desktop start dropping away and some demon image from behind starts advancing<br />
- second stage of shards/glass cracking sound<br />
- demon emerges with a sound track<br />
- disappears leaving people blinking at their screens<br />
<br />
AI was able to do a pretty good job but it just feels likes it missing something / not everything it could be<br />
<br />
ideas?<br />
<br />
maybe an demon animation sequence like a video game as it runs and crawls through teh shards or<br />
busts out the rest of the shards with a fist<br />
<br />
there are 9 variants, you can choose on the command line by entering 1-9, 5 is the default</div>


	<div style="padding:10px">

	

	

	

	
		<fieldset class="fieldset">
			<legend>Attached Files</legend>
			<ul>
			<li>
	<img class="inlineimg" src="http://www.vbforums.com/images/attach/zip.gif" alt="File Type: zip" />
	<a href="https://www.vbforums.com/attachment.php?attachmentid=196162&amp;d=1780084593">screen_crack.zip</a> 
(1.27 MB)
</li>
			</ul>
		</fieldset>
	

	</div>
]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>dz32</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912048-screen-crack-animation-joke-ideas</guid>
		</item>
		<item>
			<title>FLASHING image</title>
			<link>https://www.vbforums.com/showthread.php?912045-FLASHING-image&amp;goto=newpost</link>
			<pubDate>Wed, 27 May 2026 07:01:10 GMT</pubDate>
			<description>how to flashing two image ?
attached the image

alternate the two color image:

yellow
red
yellow
red
ecc...</description>
			<content:encoded><![CDATA[<div>how to flashing two image ?<br />
attached the image<br />
<br />
alternate the two color image:<br />
<br />
yellow<br />
red<br />
yellow<br />
red<br />
ecc...</div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
				<div style="padding:10px">
				<img class="attach" src="https://www.vbforums.com/attachment.php?attachmentid=196149&amp;stc=1&amp;d=1779865247" alt="" />&nbsp;<img class="attach" src="https://www.vbforums.com/attachment.php?attachmentid=196150&amp;stc=1&amp;d=1779865264" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>luca90</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912045-FLASHING-image</guid>
		</item>
		<item>
			<title>Windows Fails to Execute VB Program in IDE (How to Troubleshoot)</title>
			<link>https://www.vbforums.com/showthread.php?912042-Windows-Fails-to-Execute-VB-Program-in-IDE-(How-to-Troubleshoot)&amp;goto=newpost</link>
			<pubDate>Tue, 26 May 2026 04:37:58 GMT</pubDate>
			<description><![CDATA[1.   I just created a simple VB Program and it worked fine. 

2.   My main program  executed fine in the IDE at around noon today.  After shutting off computer and restarting, it will not execute in the IDE  (No Changes we're made in the Program).
My Error Log shows nothing.
The Error is occuring just after StartUp 
(A breakpoint (F9) was placed on Form_Load and the Error Message occurred a second or two after it encountered the breakpoint.) 

The IDE appears to load all Forms and Modules, it is just the execution.

 FWIW still using Windows-10 offline.

3.  This link offers some insight BUT has Not solved it.
https://stackoverflow.com/questions/36260508/vb6-visual-basic-has-stopped-working


This is the Error I am Getting :]]></description>
			<content:encoded><![CDATA[<div>1.   I just created a simple VB Program and it worked fine. <br />
<br />
2.   My main program  executed fine in the IDE at around noon today.  After shutting off computer and restarting, it will not execute in the IDE  (No Changes we're made in the Program).<br />
My Error Log shows nothing.<br />
The Error is occuring just after StartUp <br />
(A breakpoint (F9) was placed on Form_Load and the Error Message occurred a second or two after it encountered the breakpoint.) <br />
<br />
The IDE appears to load all Forms and Modules, it is just the execution.<br />
<br />
 FWIW still using Windows-10 offline.<br />
<br />
3.  This link offers some insight BUT has Not solved it.<br />
<a rel="nofollow" href="https://stackoverflow.com/questions/36260508/vb6-visual-basic-has-stopped-working" target="_blank" rel="nofollow">https://stackoverflow.com/questions/...topped-working</a><br />
<br />
<br />
This is the Error I am Getting :</div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
				<div style="padding:10px">
				<img class="attach" src="https://www.vbforums.com/attachment.php?attachmentid=196143&amp;stc=1&amp;d=1779770199" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>vb6forever</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912042-Windows-Fails-to-Execute-VB-Program-in-IDE-(How-to-Troubleshoot)</guid>
		</item>
		<item>
			<title>Windows 11 effects applied on borderless form</title>
			<link>https://www.vbforums.com/showthread.php?912041-Windows-11-effects-applied-on-borderless-form&amp;goto=newpost</link>
			<pubDate>Mon, 25 May 2026 10:18:01 GMT</pubDate>
			<description><![CDATA[I have build my own system of menus based on a VBCCR toolbar. I use forms with BorderStyle=0 to popup my menus.

Attachment 196128 (https://www.vbforums.com/attachment.php?attachmentid=196128)

Now I have tested my program on a more recent version of Windows 11 and I lose the rounded corners and the blur shadow.

I have adapted my code for the rounded corners, but I can’t reproduce the Windows 11 shadow.

Attachment 196129 (https://www.vbforums.com/attachment.php?attachmentid=196129)

Has someone encountered the same problem ?

Here is the code I use :


Code:
---------
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type
Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function DwmSetWindowAttribute Lib "dwmapi" (ByVal hWnd As Long, ByVal dwAttribute As Long, ByRef pvAttribute As Any, ByVal cbAttribute As Long) As Long
Private Declare Function DwmExtendFrameIntoClientArea Lib "dwmapi" (ByVal hWnd As Long, pMarInset As RECT) As Long
Private Const DWMWA_WINDOW_CORNER_PREFERENCE = 33
Private Const DWMWCP_ROUND = 2

Public Sub ApplyRoundedCorners(frm As Object)
' If we are on Windows 11 and the build is < 26200, we don't need to apply this sub
' as ApplyWin11Effects() does the work.
    If IsWindows11 Then
        If WinVerBuild < 26200 Then Exit Sub
    End If

Dim hRgn As Long
    ' Cut form
    hRgn = CreateRoundRectRgn(0, 0, frm.ScaleWidth + 1, frm.ScaleHeight + 1, 14, 14)
    SetWindowRgn frm.hWnd, hRgn, True
    
    DrawFormRect frm, 14
    
End Sub

Public Sub ApplyWin11Effects(frm As Form)
'This only works on Windows 11 Build < 26200.
'For the other vesions, we use ApplyRoundedCorners() for rounded corners.
    If IsWindows11 = False Then Exit Sub
    If WinVerBuild >= 26200 Then Exit Sub
    
    On Error Resume Next
    Dim Pref As Long
    Dim rc As RECT

    Pref = DWMWCP_ROUND

    '--------------------------------------
    ' Rounded corners Win11
    '--------------------------------------
    DwmSetWindowAttribute frm.hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, Pref, 4
    
    '--------------------------------------
    ' DWM Shadow
    '--------------------------------------
    rc.Left = 1
    rc.Top = 1
    rc.Right = 1
    rc.Bottom = 1

    DwmExtendFrameIntoClientArea frm.hWnd, rc

End Sub
---------
]]></description>
			<content:encoded><![CDATA[<div>I have build my own system of menus based on a VBCCR toolbar. I use forms with BorderStyle=0 to popup my menus.<br />
<br />
<img src="https://www.vbforums.com/attachment.php?attachmentid=196128&amp;d=1779704025" border="0" alt="Name:  test_w22631.jpg
Views: 191
Size:  38.3 KB"  /><br />
<br />
Now I have tested my program on a more recent version of Windows 11 and I lose the rounded corners and the blur shadow.<br />
<br />
I have adapted my code for the rounded corners, but I can’t reproduce the Windows 11 shadow.<br />
<br />
<img src="https://www.vbforums.com/attachment.php?attachmentid=196129&amp;d=1779704076" border="0" alt="Name:  test-w26200.jpg
Views: 189
Size:  39.2 KB"  /><br />
<br />
Has someone encountered the same problem ?<br />
<br />
Here is the code I use :<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Private Type RECT<br />
&nbsp; &nbsp; Left As Long<br />
&nbsp; &nbsp; Top As Long<br />
&nbsp; &nbsp; Right As Long<br />
&nbsp; &nbsp; Bottom As Long<br />
End Type<br />
Private Declare Function CreateRoundRectRgn Lib &quot;gdi32&quot; (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long<br />
Private Declare Function SetWindowRgn Lib &quot;user32&quot; (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long<br />
Private Declare Function DwmSetWindowAttribute Lib &quot;dwmapi&quot; (ByVal hWnd As Long, ByVal dwAttribute As Long, ByRef pvAttribute As Any, ByVal cbAttribute As Long) As Long<br />
Private Declare Function DwmExtendFrameIntoClientArea Lib &quot;dwmapi&quot; (ByVal hWnd As Long, pMarInset As RECT) As Long<br />
Private Const DWMWA_WINDOW_CORNER_PREFERENCE = 33<br />
Private Const DWMWCP_ROUND = 2<br />
<br />
Public Sub ApplyRoundedCorners(frm As Object)<br />
' If we are on Windows 11 and the build is &lt; 26200, we don't need to apply this sub<br />
' as ApplyWin11Effects() does the work.<br />
&nbsp; &nbsp; If IsWindows11 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; If WinVerBuild &lt; 26200 Then Exit Sub<br />
&nbsp; &nbsp; End If<br />
<br />
Dim hRgn As Long<br />
&nbsp; &nbsp; ' Cut form<br />
&nbsp; &nbsp; hRgn = CreateRoundRectRgn(0, 0, frm.ScaleWidth + 1, frm.ScaleHeight + 1, 14, 14)<br />
&nbsp; &nbsp; SetWindowRgn frm.hWnd, hRgn, True<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; DrawFormRect frm, 14<br />
&nbsp; &nbsp; <br />
End Sub<br />
<br />
Public Sub ApplyWin11Effects(frm As Form)<br />
'This only works on Windows 11 Build &lt; 26200.<br />
'For the other vesions, we use ApplyRoundedCorners() for rounded corners.<br />
&nbsp; &nbsp; If IsWindows11 = False Then Exit Sub<br />
&nbsp; &nbsp; If WinVerBuild &gt;= 26200 Then Exit Sub<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; On Error Resume Next<br />
&nbsp; &nbsp; Dim Pref As Long<br />
&nbsp; &nbsp; Dim rc As RECT<br />
<br />
&nbsp; &nbsp; Pref = DWMWCP_ROUND<br />
<br />
&nbsp; &nbsp; '--------------------------------------<br />
&nbsp; &nbsp; ' Rounded corners Win11<br />
&nbsp; &nbsp; '--------------------------------------<br />
&nbsp; &nbsp; DwmSetWindowAttribute frm.hWnd, DWMWA_WINDOW_CORNER_PREFERENCE, Pref, 4<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; '--------------------------------------<br />
&nbsp; &nbsp; ' DWM Shadow<br />
&nbsp; &nbsp; '--------------------------------------<br />
&nbsp; &nbsp; rc.Left = 1<br />
&nbsp; &nbsp; rc.Top = 1<br />
&nbsp; &nbsp; rc.Right = 1<br />
&nbsp; &nbsp; rc.Bottom = 1<br />
<br />
&nbsp; &nbsp; DwmExtendFrameIntoClientArea frm.hWnd, rc<br />
<br />
End Sub</code><hr />
</div></div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
				<div style="padding:10px">
				<img class="attach" src="https://www.vbforums.com/attachment.php?attachmentid=196128&amp;stc=1&amp;d=1779704025" alt="" />&nbsp;<img class="attach" src="https://www.vbforums.com/attachment.php?attachmentid=196129&amp;stc=1&amp;d=1779704076" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>Crapahute</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912041-Windows-11-effects-applied-on-borderless-form</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] VB6 - can i  use SetMenuItemInfo for transparent bitmap?]]></title>
			<link>https://www.vbforums.com/showthread.php?912038-RESOLVED-VB6-can-i-use-SetMenuItemInfo-for-transparent-bitmap&amp;goto=newpost</link>
			<pubDate>Fri, 22 May 2026 22:42:00 GMT</pubDate>
			<description><![CDATA[
Code:
---------
Option Explicit

' ==================================================
' API DECLARATIONS
' ==================================================
Private Type RECT
    Left As Long: Top As Long: Right As Long: Bottom As Long
End Type

Private Type MENUITEMINFO
    cbSize As Long
    fMask As Long
    fType As Long
    fState As Long
    wID As Long
    hSubMenu As Long
    hbmpChecked As Long
    hbmpUnchecked As Long
    dwItemData As Long
    dwTypeData As Long
    cch As Long
    hbmpItem As Long
End Type

' User32
Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenuItemInfo Lib "user32" Alias "SetMenuItemInfoA" (ByVal hMenu As Long, ByVal uItem As Long, ByVal fByPosition As Long, lpmii As MENUITEMINFO) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Private Declare Function FillRect Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function GetSysColorBrush Lib "user32" (ByVal nIndex As Long) As Long
Private Declare Function DrawIconEx Lib "user32" (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 istepIfAni As Long, ByVal hbrFlickerFree As Long, ByVal diFlags As Long) As Long

' Gdi32
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Private Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
' API para extrair o ícone da ImageList
Private Declare Function ImageList_GetIcon Lib "comctl32.dll" ( _
    ByVal himl As Long, _
    ByVal i As Long, _
    ByVal flags As Long) As Long
' Adiciona esta declaração importante
Private Declare Function CopyImage Lib "user32" (ByVal handle As Long, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Const IMAGE_BITMAP As Long = 0
Private Const LR_COPYRETURNORG As Long = &H4

' Constants
Private Const MIIM_BITMAP As Long = &H80
Private Const COLOR_MENU As Long = 4
Private Const DI_NORMAL As Long = &H3
Private Const ILD_TRANSPARENT As Long = &H1

' ==================================================
' MAIN FUNCTION
' ==================================================
Public Sub DrawMenuImage(ByVal hwndWindow As Long, ByVal MenuHeaderPos As Long, ByVal SubMenuPos As Long, ByVal pic As StdPicture)
    Dim hMenu As Long, hSubMenu As Long, hBmp As Long
    Dim mii As MENUITEMINFO

    hMenu = GetMenu(hwndWindow)
    If hMenu = 0 Then Exit Sub

    hSubMenu = GetSubMenu(hMenu, MenuHeaderPos)
    If hSubMenu = 0 Then Exit Sub

    If pic Is Nothing Then Exit Sub

    hBmp = PictureToBitmap32(pic)
    If hBmp = 0 Then Exit Sub

    ' Configurar a estrutura para o SetMenuItemInfo
    mii.cbSize = Len(mii)
    mii.fMask = MIIM_BITMAP
    mii.hbmpItem = hBmp

    ' Aplicar ao item do menu usando o novo método
    If SetMenuItemInfo(hSubMenu, SubMenuPos, True, mii) = 0 Then
        MsgBox "SetMenuItemInfo falhou", vbExclamation
    End If
End Sub

' ==================================================
' CONVERT StdPicture -> 32x32 HBITMAP
' ==================================================
' Altera apenas a função PictureToBitmap32 para incluir a máscara
Private Function PictureToBitmap32(ByVal pic As StdPicture, _
    Optional imgWidth As Long = 16, _
    Optional imgHeight As Long = 16) As Long
    
    Dim hdcScreen As Long, hdcMem As Long
    Dim hOld As Long, hBmp As Long
    Dim r As RECT

    hdcScreen = GetDC(0)
    hdcMem = CreateCompatibleDC(hdcScreen)
    hBmp = CreateCompatibleBitmap(hdcScreen, imgWidth, imgHeight)
    hOld = SelectObject(hdcMem, hBmp)

    ' Fundo COLOR_MENU — única "transparência" possível sem owner draw
    r.Right = imgWidth: r.Bottom = imgHeight
    FillRect hdcMem, r, GetSysColorBrush(COLOR_MENU)

    If pic.Type = vbPicTypeIcon Then
        ' DI_NORMAL sobre COLOR_MENU compõe o alpha do ícone 32bpp
        ' É o máximo possível sem owner draw
        DrawIconEx hdcMem, 0, 0, pic.handle, _
                   imgWidth, imgHeight, 0, 0, DI_NORMAL
    End If

    SelectObject hdcMem, hOld
    DeleteDC hdcMem
    ReleaseDC 0, hdcScreen

    PictureToBitmap32 = hBmp
End Function

Private Function CreateCompatibleBitmapForMenu(ByVal hIcon As Long) As Long
    Dim hdcScreen As Long, hdcMem As Long, hBmp As Long, hOld As Long
    
    hdcScreen = GetDC(0)
    hdcMem = CreateCompatibleDC(hdcScreen)
    
    hBmp = CreateCompatibleBitmap(hdcScreen, 16, 16)
    hOld = SelectObject(hdcMem, hBmp)
    
    ' ALTERAÇÃO: Pintar com MAGENTA (A cor mágica da transparência clássica)
    ' Muitos componentes de menu interpretam o Magenta como "transparente"
    Dim hBrush As Long
    hBrush = CreateSolidBrush(&HFF00FF)
    Dim r As RECT
    r.Right = 16: r.Bottom = 16
    FillRect hdcMem, r, hBrush
    DeleteObject hBrush
    
    ' Desenha o ícone
    DrawIconEx hdcMem, 0, 0, hIcon, 16, 16, 0, 0, DI_NORMAL
    
    SelectObject hdcMem, hOld
    DeleteDC hdcMem
    ReleaseDC 0, hdcScreen
    
    CreateCompatibleBitmapForMenu = hBmp
End Function

' Adiciona esta API para libertar o ícone da memória depois de usado
Public Sub DrawMenuImageFromList(ByVal hwndWindow As Long, ByVal MenuHeaderPos As Long, ByVal SubMenuPos As Long, ByVal imgList As Object, ByVal imgIndex As Long)
    Dim hMenu As Long, hSubMenu As Long, hIcon As Long, hBmp As Long
    Dim mii As MENUITEMINFO

    hMenu = GetMenu(hwndWindow)
    hSubMenu = GetSubMenu(hMenu, MenuHeaderPos)
    
    ' 1. Extrair o ícone
    hIcon = ImageList_GetIcon(imgList.hImageList, imgIndex, ILD_TRANSPARENT)
    
    If hIcon <> 0 Then
        ' 2. Criar o bitmap compatível (DIB)
        hBmp = CreateCompatibleBitmapForMenu(hIcon)
        
        ' 3. Configurar o Menu
        mii.cbSize = Len(mii)
        mii.fMask = MIIM_BITMAP
        mii.hbmpItem = hBmp
        
        SetMenuItemInfo hSubMenu, SubMenuPos, True, mii
        
        ' 4. Limpeza
        DestroyIcon hIcon
    End If
End Sub
---------
can i show the bitmap menu transparent?]]></description>
			<content:encoded><![CDATA[<div><div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Option Explicit<br />
<br />
' ==================================================<br />
' API DECLARATIONS<br />
' ==================================================<br />
Private Type RECT<br />
&nbsp; &nbsp; Left As Long: Top As Long: Right As Long: Bottom As Long<br />
End Type<br />
<br />
Private Type MENUITEMINFO<br />
&nbsp; &nbsp; cbSize As Long<br />
&nbsp; &nbsp; fMask As Long<br />
&nbsp; &nbsp; fType As Long<br />
&nbsp; &nbsp; fState As Long<br />
&nbsp; &nbsp; wID As Long<br />
&nbsp; &nbsp; hSubMenu As Long<br />
&nbsp; &nbsp; hbmpChecked As Long<br />
&nbsp; &nbsp; hbmpUnchecked As Long<br />
&nbsp; &nbsp; dwItemData As Long<br />
&nbsp; &nbsp; dwTypeData As Long<br />
&nbsp; &nbsp; cch As Long<br />
&nbsp; &nbsp; hbmpItem As Long<br />
End Type<br />
<br />
' User32<br />
Private Declare Function GetMenu Lib &quot;user32&quot; (ByVal hwnd As Long) As Long<br />
Private Declare Function GetSubMenu Lib &quot;user32&quot; (ByVal hMenu As Long, ByVal nPos As Long) As Long<br />
Private Declare Function SetMenuItemInfo Lib &quot;user32&quot; Alias &quot;SetMenuItemInfoA&quot; (ByVal hMenu As Long, ByVal uItem As Long, ByVal fByPosition As Long, lpmii As MENUITEMINFO) As Long<br />
Private Declare Function GetDC Lib &quot;user32&quot; (ByVal hwnd As Long) As Long<br />
Private Declare Function ReleaseDC Lib &quot;user32&quot; (ByVal hwnd As Long, ByVal hdc As Long) As Long<br />
Private Declare Function FillRect Lib &quot;user32&quot; (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long<br />
Private Declare Function GetSysColorBrush Lib &quot;user32&quot; (ByVal nIndex As Long) As Long<br />
Private Declare Function DrawIconEx Lib &quot;user32&quot; (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 istepIfAni As Long, ByVal hbrFlickerFree As Long, ByVal diFlags As Long) As Long<br />
<br />
' Gdi32<br />
Private Declare Function DeleteObject Lib &quot;gdi32&quot; (ByVal hObject As Long) As Long<br />
Private Declare Function CreateCompatibleDC Lib &quot;gdi32&quot; (ByVal hdc As Long) As Long<br />
Private Declare Function CreateCompatibleBitmap Lib &quot;gdi32&quot; (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long<br />
Private Declare Function SelectObject Lib &quot;gdi32&quot; (ByVal hdc As Long, ByVal hObject As Long) As Long<br />
Private Declare Function DeleteDC Lib &quot;gdi32&quot; (ByVal hdc As Long) As Long<br />
Private Declare Function StretchBlt Lib &quot;gdi32&quot; (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long<br />
Private Declare Function CreateSolidBrush Lib &quot;gdi32&quot; (ByVal crColor As Long) As Long<br />
Private Declare Function DestroyIcon Lib &quot;user32&quot; (ByVal hIcon As Long) As Long<br />
' API para extrair o ícone da ImageList<br />
Private Declare Function ImageList_GetIcon Lib &quot;comctl32.dll&quot; ( _<br />
&nbsp; &nbsp; ByVal himl As Long, _<br />
&nbsp; &nbsp; ByVal i As Long, _<br />
&nbsp; &nbsp; ByVal flags As Long) As Long<br />
' Adiciona esta declaração importante<br />
Private Declare Function CopyImage Lib &quot;user32&quot; (ByVal handle As Long, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long<br />
Private Const IMAGE_BITMAP As Long = 0<br />
Private Const LR_COPYRETURNORG As Long = &amp;H4<br />
<br />
' Constants<br />
Private Const MIIM_BITMAP As Long = &amp;H80<br />
Private Const COLOR_MENU As Long = 4<br />
Private Const DI_NORMAL As Long = &amp;H3<br />
Private Const ILD_TRANSPARENT As Long = &amp;H1<br />
<br />
' ==================================================<br />
' MAIN FUNCTION<br />
' ==================================================<br />
Public Sub DrawMenuImage(ByVal hwndWindow As Long, ByVal MenuHeaderPos As Long, ByVal SubMenuPos As Long, ByVal pic As StdPicture)<br />
&nbsp; &nbsp; Dim hMenu As Long, hSubMenu As Long, hBmp As Long<br />
&nbsp; &nbsp; Dim mii As MENUITEMINFO<br />
<br />
&nbsp; &nbsp; hMenu = GetMenu(hwndWindow)<br />
&nbsp; &nbsp; If hMenu = 0 Then Exit Sub<br />
<br />
&nbsp; &nbsp; hSubMenu = GetSubMenu(hMenu, MenuHeaderPos)<br />
&nbsp; &nbsp; If hSubMenu = 0 Then Exit Sub<br />
<br />
&nbsp; &nbsp; If pic Is Nothing Then Exit Sub<br />
<br />
&nbsp; &nbsp; hBmp = PictureToBitmap32(pic)<br />
&nbsp; &nbsp; If hBmp = 0 Then Exit Sub<br />
<br />
&nbsp; &nbsp; ' Configurar a estrutura para o SetMenuItemInfo<br />
&nbsp; &nbsp; mii.cbSize = Len(mii)<br />
&nbsp; &nbsp; mii.fMask = MIIM_BITMAP<br />
&nbsp; &nbsp; mii.hbmpItem = hBmp<br />
<br />
&nbsp; &nbsp; ' Aplicar ao item do menu usando o novo método<br />
&nbsp; &nbsp; If SetMenuItemInfo(hSubMenu, SubMenuPos, True, mii) = 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; MsgBox &quot;SetMenuItemInfo falhou&quot;, vbExclamation<br />
&nbsp; &nbsp; End If<br />
End Sub<br />
<br />
' ==================================================<br />
' CONVERT StdPicture -&gt; 32x32 HBITMAP<br />
' ==================================================<br />
' Altera apenas a função PictureToBitmap32 para incluir a máscara<br />
Private Function PictureToBitmap32(ByVal pic As StdPicture, _<br />
&nbsp; &nbsp; Optional imgWidth As Long = 16, _<br />
&nbsp; &nbsp; Optional imgHeight As Long = 16) As Long<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Dim hdcScreen As Long, hdcMem As Long<br />
&nbsp; &nbsp; Dim hOld As Long, hBmp As Long<br />
&nbsp; &nbsp; Dim r As RECT<br />
<br />
&nbsp; &nbsp; hdcScreen = GetDC(0)<br />
&nbsp; &nbsp; hdcMem = CreateCompatibleDC(hdcScreen)<br />
&nbsp; &nbsp; hBmp = CreateCompatibleBitmap(hdcScreen, imgWidth, imgHeight)<br />
&nbsp; &nbsp; hOld = SelectObject(hdcMem, hBmp)<br />
<br />
&nbsp; &nbsp; ' Fundo COLOR_MENU — única &quot;transparência&quot; possível sem owner draw<br />
&nbsp; &nbsp; r.Right = imgWidth: r.Bottom = imgHeight<br />
&nbsp; &nbsp; FillRect hdcMem, r, GetSysColorBrush(COLOR_MENU)<br />
<br />
&nbsp; &nbsp; If pic.Type = vbPicTypeIcon Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; ' DI_NORMAL sobre COLOR_MENU compõe o alpha do ícone 32bpp<br />
&nbsp; &nbsp; &nbsp; &nbsp; ' É o máximo possível sem owner draw<br />
&nbsp; &nbsp; &nbsp; &nbsp; DrawIconEx hdcMem, 0, 0, pic.handle, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  imgWidth, imgHeight, 0, 0, DI_NORMAL<br />
&nbsp; &nbsp; End If<br />
<br />
&nbsp; &nbsp; SelectObject hdcMem, hOld<br />
&nbsp; &nbsp; DeleteDC hdcMem<br />
&nbsp; &nbsp; ReleaseDC 0, hdcScreen<br />
<br />
&nbsp; &nbsp; PictureToBitmap32 = hBmp<br />
End Function<br />
<br />
Private Function CreateCompatibleBitmapForMenu(ByVal hIcon As Long) As Long<br />
&nbsp; &nbsp; Dim hdcScreen As Long, hdcMem As Long, hBmp As Long, hOld As Long<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; hdcScreen = GetDC(0)<br />
&nbsp; &nbsp; hdcMem = CreateCompatibleDC(hdcScreen)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; hBmp = CreateCompatibleBitmap(hdcScreen, 16, 16)<br />
&nbsp; &nbsp; hOld = SelectObject(hdcMem, hBmp)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; ' ALTERAÇÃO: Pintar com MAGENTA (A cor mágica da transparência clássica)<br />
&nbsp; &nbsp; ' Muitos componentes de menu interpretam o Magenta como &quot;transparente&quot;<br />
&nbsp; &nbsp; Dim hBrush As Long<br />
&nbsp; &nbsp; hBrush = CreateSolidBrush(&amp;HFF00FF)<br />
&nbsp; &nbsp; Dim r As RECT<br />
&nbsp; &nbsp; r.Right = 16: r.Bottom = 16<br />
&nbsp; &nbsp; FillRect hdcMem, r, hBrush<br />
&nbsp; &nbsp; DeleteObject hBrush<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; ' Desenha o ícone<br />
&nbsp; &nbsp; DrawIconEx hdcMem, 0, 0, hIcon, 16, 16, 0, 0, DI_NORMAL<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; SelectObject hdcMem, hOld<br />
&nbsp; &nbsp; DeleteDC hdcMem<br />
&nbsp; &nbsp; ReleaseDC 0, hdcScreen<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; CreateCompatibleBitmapForMenu = hBmp<br />
End Function<br />
<br />
' Adiciona esta API para libertar o ícone da memória depois de usado<br />
Public Sub DrawMenuImageFromList(ByVal hwndWindow As Long, ByVal MenuHeaderPos As Long, ByVal SubMenuPos As Long, ByVal imgList As Object, ByVal imgIndex As Long)<br />
&nbsp; &nbsp; Dim hMenu As Long, hSubMenu As Long, hIcon As Long, hBmp As Long<br />
&nbsp; &nbsp; Dim mii As MENUITEMINFO<br />
<br />
&nbsp; &nbsp; hMenu = GetMenu(hwndWindow)<br />
&nbsp; &nbsp; hSubMenu = GetSubMenu(hMenu, MenuHeaderPos)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; ' 1. Extrair o ícone<br />
&nbsp; &nbsp; hIcon = ImageList_GetIcon(imgList.hImageList, imgIndex, ILD_TRANSPARENT)<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; If hIcon &lt;&gt; 0 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; ' 2. Criar o bitmap compatível (DIB)<br />
&nbsp; &nbsp; &nbsp; &nbsp; hBmp = CreateCompatibleBitmapForMenu(hIcon)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; ' 3. Configurar o Menu<br />
&nbsp; &nbsp; &nbsp; &nbsp; mii.cbSize = Len(mii)<br />
&nbsp; &nbsp; &nbsp; &nbsp; mii.fMask = MIIM_BITMAP<br />
&nbsp; &nbsp; &nbsp; &nbsp; mii.hbmpItem = hBmp<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; SetMenuItemInfo hSubMenu, SubMenuPos, True, mii<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; ' 4. Limpeza<br />
&nbsp; &nbsp; &nbsp; &nbsp; DestroyIcon hIcon<br />
&nbsp; &nbsp; End If<br />
End Sub</code><hr />
</div>can i show the bitmap menu transparent?</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>joaquim</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912038-RESOLVED-VB6-can-i-use-SetMenuItemInfo-for-transparent-bitmap</guid>
		</item>
		<item>
			<title>how to put value in a TEXTBOX web page</title>
			<link>https://www.vbforums.com/showthread.php?912036-how-to-put-value-in-a-TEXTBOX-web-page&amp;goto=newpost</link>
			<pubDate>Fri, 22 May 2026 00:20:17 GMT</pubDate>
			<description><![CDATA[https://www.gratis.it/utility/abicab/#gsc.tab=0


<input name="CodAbi" type="text" size="5" maxlength="5" value="08441">

my test code:


Code:
---------
Sub Test()
    
    Dim IE As Object
    Set IE = CreateObject("InternetExplorer.application")
    IE.Visible = True
    IE.navigate ("https://www.gratis.it/utility/abicab/#gsc.tab=0")
    Do
        If IE.readyState = 4 Then
            IE.Visible = False
            Exit Do
        Else
            DoEvents
        End If
    Loop
    IE.document.forms(0).all("codabi").Value = "08441"    
    
End Sub
---------
]]></description>
			<content:encoded><![CDATA[<div><a rel="nofollow" href="https://www.gratis.it/utility/abicab/#gsc.tab=0" target="_blank" rel="nofollow">https://www.gratis.it/utility/abicab/#gsc.tab=0</a><br />
<br />
<br />
&lt;input name=&quot;CodAbi&quot; type=&quot;text&quot; size=&quot;5&quot; maxlength=&quot;5&quot; value=&quot;08441&quot;&gt;<br />
<br />
my test code:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<hr /><code class="bbcode_code">Sub Test()<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; Dim IE As Object<br />
&nbsp; &nbsp; Set IE = CreateObject(&quot;InternetExplorer.application&quot;)<br />
&nbsp; &nbsp; IE.Visible = True<br />
&nbsp; &nbsp; IE.navigate (&quot;https://www.gratis.it/utility/abicab/#gsc.tab=0&quot;)<br />
&nbsp; &nbsp; Do<br />
&nbsp; &nbsp; &nbsp; &nbsp; If IE.readyState = 4 Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IE.Visible = False<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Exit Do<br />
&nbsp; &nbsp; &nbsp; &nbsp; Else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DoEvents<br />
&nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; Loop<br />
&nbsp; &nbsp; IE.document.forms(0).all(&quot;codabi&quot;).Value = &quot;08441&quot;&nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
End Sub</code><hr />
</div></div>


	<div style="padding:10px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
				<div style="padding:10px">
				<img class="attach" src="https://www.vbforums.com/attachment.php?attachmentid=196115&amp;stc=1&amp;d=1779409202" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>luca90</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912036-how-to-put-value-in-a-TEXTBOX-web-page</guid>
		</item>
		<item>
			<title><![CDATA[VS 98 - is there a add-in for 'save as...'?]]></title>
			<link>https://www.vbforums.com/showthread.php?912035-VS-98-is-there-a-add-in-for-save-as&amp;goto=newpost</link>
			<pubDate>Thu, 21 May 2026 17:58:36 GMT</pubDate>
			<description><![CDATA[is there any 'save as...' dialog for Visual Studio 98?
objective:
1 - avoid the problems on VC++ 6 with 'save as....'(for avoid problems on Windows 7 or above);
2 - using UNICODE!!!]]></description>
			<content:encoded><![CDATA[<div>is there any 'save as...' dialog for Visual Studio 98?<br />
objective:<br />
1 - avoid the problems on VC++ 6 with 'save as....'(for avoid problems on Windows 7 or above);<br />
2 - using UNICODE!!!</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>joaquim</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912035-VS-98-is-there-a-add-in-for-save-as</guid>
		</item>
		<item>
			<title><![CDATA[[RESOLVED] Taking screenshots of forms]]></title>
			<link>https://www.vbforums.com/showthread.php?912030-RESOLVED-Taking-screenshots-of-forms&amp;goto=newpost</link>
			<pubDate>Wed, 20 May 2026 10:21:18 GMT</pubDate>
			<description><![CDATA[I need an app to be able to take a screenshot of itself and save that out to a file to use for a journalling features which will track what was on the screen at the time a given control was clicked on. Ideally I just wanted to implement this as a function which can be called with a one liner whenever this is used.

The journalling feature is all done, and for screenshots I tried using this technique I found in an old post:

https://www.developerfusion.com/thread/26911/how-can-i-save-a-vb-form-as-image/

The example captures to the clipboard when fired but uses a button as a separate event to save the file. I just added the code for the button onto the end to make it capture and save in one step.

The problem I'm having is that there seems to need to be a separate process to execute with user intervention for capturing to the clipboard to complete. As it stands, if I run it the first time it gives a runtime error as the clipboard data is invalid. Then on rerunning it will save the screenshot from the first run. Then on a third rerun the screenshot from the second etc etc.

No way of doing this (including having the capture/save as separate functions) seems to work unless the execution stops. Eg trying

CALL Capture_Screenshot
CALL Save_Screenshot 

won't work, but if I plonk a messagebox in between the two calls to break the execution it then will. I've even tried insanely messy attempts to workaround like pasting the screenshot into an imagebox on a hidden form and save the contents of the imagebox or using a timer to call the save, still doesn't work. There needs to be a total break in execution somewhere for the clipboard to update and I can't have this as it needs to happen silently.

Any ideas? Or an alternative approach to doing the capture?]]></description>
			<content:encoded><![CDATA[<div>I need an app to be able to take a screenshot of itself and save that out to a file to use for a journalling features which will track what was on the screen at the time a given control was clicked on. Ideally I just wanted to implement this as a function which can be called with a one liner whenever this is used.<br />
<br />
The journalling feature is all done, and for screenshots I tried using this technique I found in an old post:<br />
<br />
<a rel="nofollow" href="https://www.developerfusion.com/thread/26911/how-can-i-save-a-vb-form-as-image/" target="_blank" rel="nofollow">https://www.developerfusion.com/thre...form-as-image/</a><br />
<br />
The example captures to the clipboard when fired but uses a button as a separate event to save the file. I just added the code for the button onto the end to make it capture and save in one step.<br />
<br />
The problem I'm having is that there seems to need to be a separate process to execute with user intervention for capturing to the clipboard to complete. As it stands, if I run it the first time it gives a runtime error as the clipboard data is invalid. Then on rerunning it will save the screenshot from the first run. Then on a third rerun the screenshot from the second etc etc.<br />
<br />
No way of doing this (including having the capture/save as separate functions) seems to work unless the execution stops. Eg trying<br />
<br />
CALL Capture_Screenshot<br />
CALL Save_Screenshot <br />
<br />
won't work, but if I plonk a messagebox in between the two calls to break the execution it then will. I've even tried insanely messy attempts to workaround like pasting the screenshot into an imagebox on a hidden form and save the contents of the imagebox or using a timer to call the save, still doesn't work. There needs to be a total break in execution somewhere for the clipboard to update and I can't have this as it needs to happen silently.<br />
<br />
Any ideas? Or an alternative approach to doing the capture?</div>

]]></content:encoded>
			<category domain="https://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier">Visual Basic 6 and Earlier</category>
			<dc:creator>chris223b</dc:creator>
			<guid isPermaLink="true">https://www.vbforums.com/showthread.php?912030-RESOLVED-Taking-screenshots-of-forms</guid>
		</item>
	</channel>
</rss>
