<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2415284678713358197</id><updated>2024-09-24T11:34:27.770-07:00</updated><category term="VB6"/><category term="Brower path"/><category term="Form GFX"/><category term="VB Transperent"/><category term="VB6 Effects"/><category term="VB6 Graphics"/><category term="VB6 Listview"/><title type='text'>VB Leets - The VB Programming Snippets</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://vbleets.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://vbleets.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Vbleet</name><uri>http://www.blogger.com/profile/17054474927078123616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2415284678713358197.post-6630386694572510384</id><published>2010-08-08T11:04:00.000-07:00</published><updated>2010-08-08T11:04:17.193-07:00</updated><title type='text'>PHP Scripts, CGI Scripts, ASP Scripts Web Scripts Online</title><content type='html'>&lt;a href=&quot;http://webscriptsonline.com/index.php&quot;&gt;PHP Scripts, CGI Scripts, ASP Scripts Web Scripts Online&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbleets.blogspot.com/feeds/6630386694572510384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbleets.blogspot.com/2010/08/php-scripts-cgi-scripts-asp-scripts-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/6630386694572510384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/6630386694572510384'/><link rel='alternate' type='text/html' href='http://vbleets.blogspot.com/2010/08/php-scripts-cgi-scripts-asp-scripts-web.html' title='PHP Scripts, CGI Scripts, ASP Scripts Web Scripts Online'/><author><name>Vbleet</name><uri>http://www.blogger.com/profile/17054474927078123616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2415284678713358197.post-5892858361819844820</id><published>2010-04-01T01:38:00.000-07:00</published><updated>2010-04-01T01:40:40.650-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Brower path"/><category scheme="http://www.blogger.com/atom/ns#" term="VB6"/><title type='text'>Get default browser path</title><content type='html'>&lt;blockquote&gt;Dim regshell As Object, DefaultBrowser As String&lt;br /&gt;
Set regshell = CreateObject(&quot;Wscript.Shell&quot;)&lt;br /&gt;
&lt;br /&gt;
DefaultBrowser = regshell.regread(&quot;HKEY_CLASSES_ROOT\HTTP\shell\open\command\&quot;)&lt;br /&gt;
&#39; Reads the registry value where is stored the default application to use with HTTP&lt;br /&gt;
&lt;br /&gt;
DefaultBrowser = Left(DefaultBrowser, InStr(1, DefaultBrowser, &quot;.exe&quot;, vbTextCompare) + 4)&lt;br /&gt;
&#39; Removes shell parameters after the actual path, preserving only path included in double quotes&lt;br /&gt;
&lt;br /&gt;
DefaultBrowser = Replace(DefaultBrowser, Chr(34), vbNullString)&lt;br /&gt;
&#39; Removes double quotes (&quot;)&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;iframe src=&quot;http://rcm.amazon.com/e/cm?t=vblethev-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=B002RL8J12&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr&quot; style=&quot;align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;&quot;align=&quot;left&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;iframe src=&quot;http://rcm.amazon.com/e/cm?t=vblethev-20&amp;o=1&amp;p=8&amp;l=bpl&amp;asins=B000HCZ8EO&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;m=amazon&amp;lc1=0000FF&amp;bc1=000000&amp;bg1=FFFFFF&amp;f=ifr&quot; style=&quot;align:left;padding-top:5px;width:131px;height:245px;padding-right:10px;&quot;align=&quot;left&quot; scrolling=&quot;no&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbleets.blogspot.com/feeds/5892858361819844820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbleets.blogspot.com/2010/04/get-default-browser-path.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/5892858361819844820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/5892858361819844820'/><link rel='alternate' type='text/html' href='http://vbleets.blogspot.com/2010/04/get-default-browser-path.html' title='Get default browser path'/><author><name>Vbleet</name><uri>http://www.blogger.com/profile/17054474927078123616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2415284678713358197.post-1132929114275229045</id><published>2010-03-24T13:21:00.000-07:00</published><updated>2010-03-24T13:21:12.258-07:00</updated><title type='text'>VB6 WinInet FTP API</title><content type='html'>i didnt make this i found it on google and its been in my hard drive for  a long time i think it came from some binary website but its very small  contains 1 module that has all the API calls and the form has all of  the ftp functions (connect, disconnect, upload, download etc)&lt;br /&gt;
&lt;br /&gt;
anyways have fun im sure some of you will find it usefull.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;Option Explicit&lt;/blockquote&gt;&lt;blockquote&gt;Public Const MAX_PATH = 260&lt;/blockquote&gt;&lt;blockquote&gt;Public Const INTERNET_FLAG_RELOAD = &amp;amp;H80000000&lt;/blockquote&gt;&lt;blockquote&gt;Public Const NO_ERROR = 0&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_READONLY = &amp;amp;H1&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_HIDDEN = &amp;amp;H2&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_SYSTEM = &amp;amp;H4&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_DIRECTORY = &amp;amp;H10&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_ARCHIVE = &amp;amp;H20&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_NORMAL = &amp;amp;H80&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_TEMPORARY = &amp;amp;H100&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_COMPRESSED = &amp;amp;H800&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FILE_ATTRIBUTE_OFFLINE = &amp;amp;H1000&lt;/blockquote&gt;&lt;blockquote&gt;Public Const INTERNET_FLAG_PASSIVE = &amp;amp;H8000000&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FORMAT_MESSAGE_FROM_HMODULE = &amp;amp;H800&lt;/blockquote&gt;&lt;blockquote&gt;Type WIN32_FIND_DATA&lt;/blockquote&gt;&lt;blockquote&gt;dwFileAttributes As Long&lt;/blockquote&gt;&lt;blockquote&gt;ftCreationTime As Currency&lt;/blockquote&gt;&lt;blockquote&gt;ftLastAccessTime As Currency&lt;/blockquote&gt;&lt;blockquote&gt;ftLastWriteTime As Currency&lt;/blockquote&gt;&lt;blockquote&gt;nFileSizeHigh As Long&lt;/blockquote&gt;&lt;blockquote&gt;nFileSizeLow As Long&lt;/blockquote&gt;&lt;blockquote&gt;dwReserved0 As Long&lt;/blockquote&gt;&lt;blockquote&gt;dwReserved1 As Long&lt;/blockquote&gt;&lt;blockquote&gt;cFileName As String * MAX_PATH&lt;/blockquote&gt;&lt;blockquote&gt;cAlternate As String * 14&lt;/blockquote&gt;&lt;blockquote&gt;End Type&lt;/blockquote&gt;&lt;blockquote&gt;Public Const ERROR_NO_MORE_FILES = 18&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function InternetFindNextFile Lib &quot;wininet.dll&quot; Alias &quot;InternetFindNextFileA&quot; (ByVal hFind As Long, lpvFindData As WIN32_FIND_DATA) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function FtpFindFirstFile Lib &quot;wininet.dll&quot; Alias &quot;FtpFindFirstFileA&quot; (ByVal hFtpSession As Long, ByVal lpszSearchFile As String, lpFindFileData As WIN32_FIND_DATA, ByVal dwFlags As Long, ByVal dwContent As Long) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Declare Function FileTimeToLocalFileTime Lib &quot;kernel32&quot; (lpFileTime As Any, lpLocalFileTime As Any) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Public Const INTERNET_OPEN_TYPE_PRECONFIG = 0&lt;/blockquote&gt;&lt;blockquote&gt;Public Const INTERNET_INVALID_PORT_NUMBER = 0&lt;/blockquote&gt;&lt;blockquote&gt;Public Const INTERNET_SERVICE_FTP = 1&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FTP_TRANSFER_TYPE_BINARY = &amp;amp;H2&lt;/blockquote&gt;&lt;blockquote&gt;Public Const FTP_TRANSFER_TYPE_ASCII = &amp;amp;H1&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function FtpSetCurrentDirectory Lib &quot;wininet.dll&quot; Alias &quot;FtpSetCurrentDirectoryA&quot; (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function FtpGetCurrentDirectory Lib &quot;wininet.dll&quot; Alias &quot;FtpGetCurrentDirectoryA&quot; (ByVal hFtpSession As Long, ByVal lpszCurrentDirectory As String, lpdwCurrentDirectory As Long) As Boolean&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function InternetWriteFile Lib &quot;wininet.dll&quot; (ByVal hFile As Long, ByRef sBuffer As Byte, ByVal lNumBytesToWite As Long, dwNumberOfBytesWritten As Long) As Integer&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function FtpOpenFile Lib &quot;wininet.dll&quot; Alias &quot;FtpOpenFileA&quot; (ByVal hFtpSession As Long, ByVal sBuff As String, ByVal Access As Long, ByVal Flags As Long, ByVal Context As Long) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function FtpPutFile Lib &quot;wininet.dll&quot; Alias &quot;FtpPutFileA&quot; (ByVal hFtpSession As Long, ByVal lpszLocalFile As String, ByVal lpszRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Sub FtpCreateDirectory Lib &quot;wininet.dll&quot; Alias &quot;FtpCreateDirectoryA&quot; (ByRef hConnect As Long, ByVal lpszDirectory As String)&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Sub FtpRemoveDirectory Lib &quot;wininet.dll&quot; Alias &quot;FtpRemoveDirectoryA&quot; (ByRef hConnect As Long, ByVal lpszDirectory As String)&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function FtpDeleteFile Lib &quot;wininet.dll&quot; Alias &quot;FtpDeleteFileA&quot; (ByVal hFtpSession As Long, ByVal lpszFileName As String) As Boolean&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function InternetCloseHandle Lib &quot;wininet.dll&quot; (ByVal hInet As Long) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function InternetOpen Lib &quot;wininet.dll&quot; Alias &quot;InternetOpenA&quot; (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function InternetConnect Lib &quot;wininet.dll&quot; Alias &quot;InternetConnectA&quot; (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Public Declare Function FtpGetFile Lib &quot;wininet.dll&quot; Alias &quot;FtpGetFileA&quot; (ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean&lt;/blockquote&gt;&lt;blockquote&gt;Const rDayZeroBias As Double = 109205#&lt;/blockquote&gt;&lt;blockquote&gt;Const rMillisecondPerDay As Double = 10000000# * 60# * 60# * 24# / 10000#&lt;/blockquote&gt;&lt;blockquote&gt;Declare Function InternetGetLastResponseInfo Lib &quot;wininet.dll&quot; Alias &quot;InternetGetLastResponseInfoA&quot; (ByRef lpdwError As Long, ByVal lpszErrorBuffer As String, ByRef lpdwErrorBufferLength As Long) As Boolean&lt;/blockquote&gt;&lt;blockquote&gt;Declare Function FormatMessage Lib &quot;kernel32&quot; Alias &quot;FormatMessageA&quot; (ByVal dwFlags As Long, ByVal lpSource As Long, ByVal dwMessageId As Long, ByVal dwLanguageId As Long, ByVal lpBuffer As String, ByVal nSize As Long, Arguments As Long) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Declare Function GetModuleHandle Lib &quot;kernel32&quot; Alias &quot;GetModuleHandleA&quot; (ByVal lpLibFileName As String) As Long&lt;/blockquote&gt;&lt;blockquote&gt;Function Win32ToVbTime(ft As Currency) As Date&lt;/blockquote&gt;&lt;blockquote&gt;Dim ftl As Currency&lt;/blockquote&gt;&lt;blockquote&gt;If FileTimeToLocalFileTime(ft, ftl) Then&lt;/blockquote&gt;&lt;blockquote&gt;Win32ToVbTime = CDate((ftl / rMillisecondPerDay) - rDayZeroBias)&lt;/blockquote&gt;&lt;blockquote&gt;Else&lt;/blockquote&gt;&lt;blockquote&gt;MsgBox Err.LastDllError&lt;/blockquote&gt;&lt;blockquote&gt;End If&lt;/blockquote&gt;&lt;blockquote&gt;End Function&lt;/blockquote&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbleets.blogspot.com/feeds/1132929114275229045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbleets.blogspot.com/2010/03/vb6-wininet-ftp-api.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/1132929114275229045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/1132929114275229045'/><link rel='alternate' type='text/html' href='http://vbleets.blogspot.com/2010/03/vb6-wininet-ftp-api.html' title='VB6 WinInet FTP API'/><author><name>Vbleet</name><uri>http://www.blogger.com/profile/17054474927078123616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2415284678713358197.post-5521320547242827422</id><published>2010-03-24T00:25:00.000-07:00</published><updated>2010-03-24T00:38:23.469-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VB6"/><category scheme="http://www.blogger.com/atom/ns#" term="VB6 Graphics"/><category scheme="http://www.blogger.com/atom/ns#" term="VB6 Listview"/><title type='text'>VB - Color a row in a ListView</title><content type='html'>This Sub is Created to Color the Listview Row&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;Public Sub ColorListviewRow(lv As ListView, RowNbr As Long, RowColor As OLE_COLOR)&lt;/div&gt;&lt;div&gt;&#39;***************************************************************************&lt;/div&gt;&lt;div&gt;&#39;Purpose: Color a ListView Row&lt;/div&gt;&lt;div&gt;&#39;Inputs : lv - The ListView&lt;/div&gt;&lt;div&gt;&#39;         RowNbr - The index of the row to be colored&lt;/div&gt;&lt;div&gt;&#39;         RowColor - The color to color it&lt;/div&gt;&lt;div&gt;&#39;Outputs: None&lt;/div&gt;&lt;div&gt;&#39;***************************************************************************&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    Dim itmX As ListItem&lt;/div&gt;&lt;div&gt;    Dim lvSI As ListSubItem&lt;/div&gt;&lt;div&gt;    Dim intIndex As Integer&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    On Error GoTo ErrorRoutine&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    Set itmX = lv.ListItems(RowNbr)&lt;/div&gt;&lt;div&gt;    itmX.ForeColor = RowColor&lt;/div&gt;&lt;div&gt;    For intIndex = 1 To lv.ColumnHeaders.Count - 1&lt;/div&gt;&lt;div&gt;        Set lvSI = itmX.ListSubItems(intIndex)&lt;/div&gt;&lt;div&gt;        lvSI.ForeColor = RowColor&lt;/div&gt;&lt;div&gt;    Next&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    Set itmX = Nothing&lt;/div&gt;&lt;div&gt;    Set lvSI = Nothing&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    Exit Sub&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;ErrorRoutine:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    MsgBox Err.Description&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;End Sub&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;Calling this Sub as Follows&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;ColorListviewRow Listview,RowNum, Color&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbleets.blogspot.com/feeds/5521320547242827422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbleets.blogspot.com/2010/03/this-sub-is-created-to-color-listview.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/5521320547242827422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/5521320547242827422'/><link rel='alternate' type='text/html' href='http://vbleets.blogspot.com/2010/03/this-sub-is-created-to-color-listview.html' title='VB - Color a row in a ListView'/><author><name>Vbleet</name><uri>http://www.blogger.com/profile/17054474927078123616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2415284678713358197.post-2286895456613805922</id><published>2010-03-23T13:01:00.000-07:00</published><updated>2010-03-23T13:04:38.297-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Form GFX"/><category scheme="http://www.blogger.com/atom/ns#" term="VB Transperent"/><category scheme="http://www.blogger.com/atom/ns#" term="VB6 Effects"/><title type='text'>Transparent Effect for VB Forms</title><content type='html'>Add this following code in to your project module.&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;pre class=&quot;alt2&quot; dir=&quot;ltr&quot; style=&quot;margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 498px; text-align: left; overflow: auto;&quot;&gt;Option Explicit&lt;br /&gt;&lt;br /&gt;Private Declare Function SetLayeredWindowAttributes Lib &quot;user32&quot; (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long&lt;br /&gt;Private Declare Function UpdateLayeredWindow Lib &quot;user32&quot; (ByVal hWnd As Long, ByVal hdcDst As Long, pptDst As Any, psize As Any, ByVal hdcSrc As Long, pptSrc As Any, crKey As Long, ByVal pblend As Long, ByVal dwFlags As Long) As Long&lt;br /&gt;Private Declare Function GetWindowLong Lib &quot;user32&quot; Alias &quot;GetWindowLongA&quot; (ByVal hWnd As Long, ByVal nIndex As Long) As Long&lt;br /&gt;Private Declare Function SetWindowLong Lib &quot;user32&quot; Alias &quot;SetWindowLongA&quot; (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long&lt;br /&gt;&lt;br /&gt;Private Const GWL_EXSTYLE = (-20)&lt;br /&gt;Private Const LWA_COLORKEY = &amp;amp;H1&lt;br /&gt;Private Const LWA_ALPHA = &amp;amp;H2&lt;br /&gt;Private Const ULW_COLORKEY = &amp;amp;H1&lt;br /&gt;Private Const ULW_ALPHA = &amp;amp;H2&lt;br /&gt;Private Const ULW_OPAQUE = &amp;amp;H4&lt;br /&gt;Private Const WS_EX_LAYERED = &amp;amp;H80000&lt;br /&gt;&lt;br /&gt;Public Function isTransparent(ByVal hWnd As Long) As Boolean&lt;br /&gt;On Error Resume Next&lt;br /&gt;Dim Msg As Long&lt;br /&gt;Msg = GetWindowLong(hWnd, GWL_EXSTYLE)&lt;br /&gt;If (Msg And WS_EX_LAYERED) = WS_EX_LAYERED Then&lt;br /&gt; isTransparent = True&lt;br /&gt;Else&lt;br /&gt; isTransparent = False&lt;br /&gt;End If&lt;br /&gt;If Err Then&lt;br /&gt; isTransparent = False&lt;br /&gt;End If&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Public Function MakeTransparent(ByVal hWnd As Long, Perc As Integer) As Long&lt;br /&gt;Dim Msg As Long&lt;br /&gt;On Error Resume Next&lt;br /&gt;If Perc &lt;&gt; 255 Then&lt;br /&gt; MakeTransparent = 1&lt;br /&gt;Else&lt;br /&gt; Msg = GetWindowLong(hWnd, GWL_EXSTYLE)&lt;br /&gt; Msg = Msg Or WS_EX_LAYERED&lt;br /&gt; SetWindowLong hWnd, GWL_EXSTYLE, Msg&lt;br /&gt; SetLayeredWindowAttributes hWnd, 0, Perc, LWA_ALPHA&lt;br /&gt; MakeTransparent = 0&lt;br /&gt;End If&lt;br /&gt;If Err Then&lt;br /&gt; MakeTransparent = 2&lt;br /&gt;End If&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Public Function MakeOpaque(ByVal hWnd As Long) As Long&lt;br /&gt;Dim Msg As Long&lt;br /&gt;On Error Resume Next&lt;br /&gt;Msg = GetWindowLong(hWnd, GWL_EXSTYLE)&lt;br /&gt;Msg = Msg And Not WS_EX_LAYERED&lt;br /&gt;SetWindowLong hWnd, GWL_EXSTYLE, Msg&lt;br /&gt;SetLayeredWindowAttributes hWnd, 0, 0, LWA_ALPHA&lt;br /&gt;MakeOpaque = 0&lt;br /&gt;If Err Then&lt;br /&gt; MakeOpaque = 2&lt;br /&gt;End If&lt;br /&gt;End Function&lt;/pre&gt;&lt;/blockquote&gt;Save file as .bas&lt;br /&gt;&lt;br /&gt;Then call funtion like following&lt;br /&gt;&lt;br /&gt;&lt;pre class=&quot;alt2&quot; dir=&quot;ltr&quot; style=&quot;margin: 0px; padding: 6px; border: 1px inset; width: 640px; height: 66px; text-align: left; overflow: auto;&quot;&gt;Private Sub Form_Load()&lt;br /&gt;  MakeTransparent Me.hWnd, 100&lt;br /&gt;End Sub&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://vbleets.blogspot.com/feeds/2286895456613805922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://vbleets.blogspot.com/2010/03/transparent-effect-for-vb-forms.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/2286895456613805922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2415284678713358197/posts/default/2286895456613805922'/><link rel='alternate' type='text/html' href='http://vbleets.blogspot.com/2010/03/transparent-effect-for-vb-forms.html' title='Transparent Effect for VB Forms'/><author><name>Vbleet</name><uri>http://www.blogger.com/profile/17054474927078123616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>