
Learning JavaScript? Here’s My JavaScript and Related Resources
JavaScript is by far the web's most popular programming language. Being able to operate within nearly every web browser and on every operating system, JavaScript can be found in every nook and cranny throughout the Internet and our systems which we use to communicate through it. With that being said, it's quite unfortunate that it is also considered by many as the web's most misunderstood programming language. With so many resources available (for free even) on the Internet, it's hard to believe that it's widely misunderstood. This is my attempt to rectify this problem...or to at least help educate those who don't understand or those who don't know where to begin.
Where to Begin:
I have to admit that I learned the bulk of my understandings of JavaScript from teaching myself by researching online articles, video lectures, and resources...not from formal education. I'm not saying that you can't successfully learn JavaScript from formal education; I've learned quite a bit from formal education...just not much about programming in general. My advice for newbies to programming in general is to learn how to program before you dive into learning a programming language.
Learning programming is as easy (or hard, depending on how you look at it) as learning calculus. Do realize that when programming you are technically using calculus. Programming = Calculus. You don't necessarily need to know calculus before you learn how to program. (You will slowly realize that as you learn how to program you are literally learning calculus at the same time.) Although, I definitely recommend that you have a good grasp of mathematics and algebra before you begin learning how to program. But, I must point-out, if you already know calculus...you already know how to program!
Where to Begin, with JavaScript:
A great place to begin is by learning about its history. Douglas Crockford, a Yahoo! engineer, is, in my opinion, the definitive "go-to" individual for everything JavaScript. He's graciously spent many years developing an extremely deep understanding of the language, and has posted many online lectures and resources pertaining to it. (Please see the video lectures and resources listed below, specifically the video lecture "Douglas Crockford: The JavaScript Programming Language" and "Crockford on JavaScript - Volume 1: The Early Years".)
As I find more related, quality information I'll update this post, so please bookmark!
Video Lectures:
Douglas Crockford: The JavaScript Programming Language (1hr 50min)
JavaScript: The Good Parts, by Douglas Crockford (1hr 3min)
JavaScript Programming Style and Your Brain (36mins)
Douglas Crockford: An Inconvenient API - The Theory of the DOM (1hr 18mins)
Douglas Crockford: Advanced JavaScript (1hr 7mins)
Crockford on JavaScript - Volume 1: The Early Years (1hr 42mins)
Douglas Crockford: Quality (48mins)
Secrets of JavaScript Closures (5mins)
Web Sites & Resources
ECMAScript.org
ECMAScript Language Specification
JavaScript at Wikipedia
Crockford.com
JS at W3Schools.com
JavaScriptSource.com
JS at Quirksmode.org
Online Tools & Help:
JSLint
JavaScript Cheat Sheets
FireBug
Venkman
Drosera
Dragonfly
JSUnit
JSLitmus
JSMin
BOOKS:
JavaScript: The Good Parts, by Douglas Crockford (Purchase at Amazon)
JavaScript: The Definitive Guide, by David Flanagan (Purchase at Amazon)
Libraries:
Ext JS
jQuery
jQuery UI
Yahoo! User Interface
Dojo Toolkit
Have A Copy of New User Welcome Message Sent to You (ASPDotNetStoreFront)
ASPDNSF Version: 9 (C# + MS SQL)
If you would like to have a copy of the new user welcome email message sent to you whenever a new user signsup to your shop, well you'd assume they would have this feature in the system already...but that's not the case. This feature is currently lacking in AspDotNetStorefront as of version 9 (ML).
No fear, Ben is here!
To enable this feature it will take a bit of C# work and some tinkering.
First, open up createaccount.aspx.cs using your favorite text editor. Then find the lines of code where the welcome message is sent to the new user...
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(...
Now, add the following code after the try and catch...
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"youremail@yourdomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
...being sure to change "youremail@yourdomain.com" to the email address where you want to receive the notifications.
Example:
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
EMailField,
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}
catch { }
// below added by Benjamin Eskew (Aug 25, 2010)
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"myemail@mydomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
// the above added by Benjamin Eskew (Aug 25, 2010)
}
Now save the file and upload it to your server and that's that! Do realize that this is just a simple copy of the message, not a custom message sent to the administrator. In order to make something like that you'll have to create a custom XmlPackage to handle it and use that one in place of the current one in use (XmlPackage.WelcomeEmail).
As you can see from my current and previous posts, I've been working a lot with AspDotNetStorefront lately and have plans to continue posting information articles like this one here, so stay tuned!
To Be Releasing All My Old VB Projects Soon
I've recently decided to let the world gasp in horror and amazement at all of my old source projects which I made using Visual Basic way back in the day when I was learning how to program on PC's.
This all includes my old AOL & AIM related projects (yep, including a famous "cracker" which I made for fun back then) because I believe they all hold educational value even today. I'm currently preparing a lot of the projects for you to easily download and whatnot so give me a bit of time. I will be releasing the main source code for hitMan later on today/tonight though. Stay tuned!
Visual Basic Code Snippets #11
In this next update I'll re-post my Visual Basic code snippets (which are older than five years by the way) that pertain to Window Actions and File Functions.
Completely Destroy File and Its Information
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Sub DestroyFile(sFileName As String)
Dim Block1 As String, Block2 As String, Blocks As Long
Dim hFileHandle As Integer, iLoop As Long, offset As Long
'Create two buffers with a specified 'wipe-out' characters
Const BLOCKSIZE = 4096
Block1 = String(BLOCKSIZE, "X")
Block2 = String(BLOCKSIZE, " ")
'Overwrite the file contents with the wipe-out characters
hFileHandle = FreeFile
Open sFileName For Binary As hFileHandle
Blocks = (LOF(hFileHandle) \ BLOCKSIZE) + 1
For iLoop = 1 To Blocks
offset = Seek(hFileHandle)
Put hFileHandle, , Block1
Put hFileHandle, offset, Block2
Next iLoop
Close hFileHandle
'Now you can delete the file, which contains no sensitive data
Kill sFileName
End Sub
Add the following code to wherever you want the code to execute...
Call DestroyFile("C:\filetodestroy.jpg") 'modify file path of course
Cut, Copy, Paste and Undo
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_UNDO = &H304
Cut:
Add the following code where you want the code to execute...
Clipboard.SetText Text1.SelText
Text1.SelText = ""
Copy:
Add the following code where you want the code to execute...
Clipboard.SetText Text1.SelText
Paste:
Add the following code where you want the code to execute...
Text1.SelText = Clipboard.GetText(1)
Undo:
Add the following code where you want the code to execute...
Call SendMessage(Text1.hwnd, WM_UNDO, 0&, 0&)
Visual Basic Code Snippets #10
In this next update I'll re-post my Visual Basic code snippets (which are older than five years by the way) that pertain to Window Actions and File Functions.
Minimize All Active Windows
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Const VK_LWIN = &H5B
Public Const KEYEVENTF_KEYUP = &H2
Add the following code into a command button or wherever you want the code to execute...
Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(&H4D, 0, 0, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
Load a Text Box with Items from a Text File
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Sub LoadText(Lst As TextBox, file As String)
'Call LoadText (Text1,"C:\Windows\System\Saved.txt")
On Error GoTo error
Dim mystr As String
Open file For Input As #1
Do While Not EOF(1)
Line Input #1, a$
texto$ = texto$ + a$ + Chr$(13) + Chr$(10)
Loop
Lst = texto$
Close #1
Exit Sub
error:
X = MsgBox("File Not Found", vbOKOnly, "Error")
End Sub
Add a TextBox named Text1 and make sure there is a text file named test.txt with "test" inside it inside the directory where you are working on your project and add the following code wherever you want the code to execute...
Call LoadText(Text1, "test.txt")
Save Data to a Text File
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Sub SaveText(Lst As TextBox, file As String)
'Call SaveText (Text1,"C:\Windows\System\Saved.txt")
On Error GoTo error
Dim mystr As String
Open file For Output As #1
Print #1, Lst
Close 1
Exit Sub
error:
X = MsgBox("There has been an error!", vbOKOnly, "Error")
End Sub
Add a TextBox named Text1 and add the following code wherever you want the code to execute...
Call SaveText(Text1, "C:\Program Files\Program Name\test.txt")
Visual Basic Code Snippets #9
In this next update I'll continue to re-post my Visual Basic code snippets (which are older than five years by the way) that pertain to System Functions.
Toggle NumLock Key On/Off
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Option Explicit
Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Public Declare Function SetKeyboardState Lib "user32" (lppbKeyState As Byte) As Long
Public Const VER_PLATFORM_WIN32_NT = 2
Public Const VER_PLATFORM_WIN32_WINDOWS = 1
Public Const VK_NUMLOCK = &H90
Public Const KEYEVENTF_EXTENDEDKEY = &H1
Public Const KEYEVENTF_KEYUP = &H2
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Public Sub ToggleNumLock(TurnOn As Boolean)
'To turn numlock on, set turnon to true
'To turn numlock off, set turnon to false
Dim bytKeys(255) As Byte
Dim bnumLockOn As Boolean
'Get status of the 256 virtual keys
GetKeyboardState bytKeys(0)
bnumLockOn = bytKeys(VK_NUMLOCK)
Dim typOS As OSVERSIONINFO
If bnumLockOn <> TurnOn Then
If typOS.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then
bytKeys(VK_NUMLOCK) = 1
SetKeyboardState bytKeys(0)
Else
'Simulate Key Press
keybd_event VK_NUMLOCK, &H45, KEYEVENTF_EXTENDEDKEY Or 0, 0
'Simulate Key Release
keybd_event VK_NUMLOCK, &H45, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
End If
End If
End Sub
Add the following code where you want the code to execute...
'To turn numlock on...
Call ToggleNumLock(True)
'To turn numlock off...
Call ToggleNumLock(False)
BEEP!
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Add the following code where you want the code to execute...
Dim X%
X% = Beep(1500, 300)
Disable/Enable Task Manager
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function SystemParametersInfo Lib "User32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long
Add the following code where you want the code to execute...
'this will disable ctrl+alt+del
Call SystemParametersInfo(97, True, 0&, 0)
'this will enable ctrl+alt+del
Call SystemParametersInfo(97, False, 0&, 0)
Get the Windows User Name
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Add the following code where you want the code to execute...
Dim X As String
X = String(50, Chr(0))
Call GetComputerName(X$, 50)
MsgBox "Your computer is named: " & X, 32, "Name"
Visual Basic Code Snippets #8
In this next update I'll continue to re-post my Visual Basic code snippets (which are older than five years by the way) that pertain to System Functions.
Ensure Application Can't Load Multiple Times
Compatibility: Win. 98-XP
This isn't a system function but is definitely essential to any application.
Add the following code to the Form_Load() event...
If App.PrevInstance Then
MsgBox ("The application is already open."), vbExclamation, "The requested " & "application is already open"
Unload Me
End If
Display Internet Properties Dialog
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Function ShowInetProperties() As Boolean
Dim lRet As Long
lRet = Shell("rundll32.exe shell32.dll,Control_RunDLL inetcpl.cpl,,0", vbNormalFocus)
ShowInetProperties = lRet > 0
End Function
Add the following code where you want the code to execute...
Call ShowInetProperties()
Toggle CapsLock Key On/Off
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
Public Declare Function SetKeyboardState Lib "user32" (lppbKeyState As Byte) As Long
Public Const VER_PLATFORM_WIN32_NT = 2
Public Const VER_PLATFORM_WIN32_WINDOWS = 1
Public Const VK_CAPITAL = &H14
Public Const KEYEVENTF_EXTENDEDKEY = &H1
Public Const KEYEVENTF_KEYUP = &H2
Public Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128
End Type
Public Sub ToggleCapsLock(TurnOn As Boolean)
'To turn capslock on, set turnon to true
'To turn capslock off, set turnon to false
Dim bytKeys(255) As Byte
Dim bCapsLockOn As Boolean
'Get status of the 256 virtual keys
GetKeyboardState bytKeys(0)
bCapsLockOn = bytKeys(VK_CAPITAL)
Dim typOS As OSVERSIONINFO
If bCapsLockOn <> TurnOn Then
If typOS.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS Then
bytKeys(VK_CAPITAL) = 1
SetKeyboardState bytKeys(0)
Else
'Simulate Key Press
keybd_event VK_CAPITAL, &H45, KEYEVENTF_EXTENDEDKEY Or 0, 0
'Simulate Key Release
keybd_event VK_CAPITAL, &H45, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0
End If
End If
End Sub
Add the following code where you want the code to execute...
'To turn capslock on...
Call ToggleCapsLock(True)
'To turn capslock off...
Call ToggleCapsLock(False)
Visual Basic Code Snippets #7
In this next update I'll continue to re-post my Visual Basic code snippets (which are older than five years by the way) that pertain to System Functions.
Get Free Disk Space on Hard Drives
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Public Type DiskInformation
lpSectorsPerCluster As Long lpBytesPerSector As Long
lpNumberOfFreeClusters As Long
lpTotalNumberOfClusters As Long
End Type
Add the following code wherever you want the code to execute...
Dim info As DiskInformation
Dim lAnswer As Long
Dim lpRootPathName As String
Dim lpSectorsPerCluster As Long
Dim lpBytesPerSector As Long
Dim lpNumberOfFreeClusters As Long
Dim lpTotalNumberOfClusters As Long
Dim lBytesPerCluster As Long
Dim lNumFreeBytes As Double
Dim sString As String
lpRootPathName = "c:\" 'simply replace this with your hard drive path
lAnswer = GetDiskFreeSpace(lpRootPathName, lpSectorsPerCluster, lpBytesPerSector, lpNumberOfFreeClusters, lpTotalNumberOfClusters)
lBytesPerCluster = lpSectorsPerCluster * lpBytesPerSector
lNumFreeBytes = lBytesPerCluster * lpNumberOfFreeClusters
sString = "Number of Free Bytes : " & lNumFreeBytes & vbCr & vbLf
sString = sString & "Number of Free Kilobytes: " & (lNumFreeBytes / 1024) & "K" & vbCr & vbLf
sString = sString & "Number of Free Megabytes: " & Format(((lNumFreeBytes / 1024) / 1024), "0.00") & "MB"
MsgBox sString
Get Windows Directory using API Call
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Public Const MAX_PATH = 260
Add the following code wherever you want the code to execute...
Dim strBuffer As String
Dim lngReturn As Long
Dim strWindowsDirectory As String
strBuffer = Space$(MAX_PATH)
lngReturn = GetWindowsDirectory(strBuffer, MAX_PATH)
strWindowsDirectory = Left$(strBuffer, Len(strBuffer) - 1)
Clear/Add-to Windows Recent Document List
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Sub SHAddToRecentDocs Lib "shell32.dll" (ByVal uFlags As Long, ByVal pv As String)
Add the following code wherever you want the Clear Recent Document List code to execute...
'clear the entire list
Call SHAddToRecentDocs(2,vbNullString)
Add the following code wherever you want to add the file to the list code to execute...
'add a new file to list
Dim strNewFile as String
strNewFile="c:\myfile.ext"
Call SHAddToRecentDocs(2,strNewFile)
Visual Basic Code Snippets #6
In this next update I'll continue to re-post my Visual Basic code snippets (which are older than five years by the way) that pertain to System Functions.
Hide/Show Your Application from Task Manager
Compatibility: Win. 98-ME
Add the following code into a module within your project...
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Declare Function GetCurrentProcess Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0
Public Sub removeCtrlAltDel()
'only works on win98/ME
Dim pid As Long
Dim lngRet As Long
pid = GetCurrentProcessId()
lngRet = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
Public Sub showCtrlAltDel()
'only works on win98/ME
Dim pid As Long
Dim lngRet As Long
pid = GetCurrentProcessId()
lngRet = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
Add the following code wherever you want the Hide code to execute...
Call removeCtrlAltDel()
Add the following code wherever you want the Show code to execute...
Call showCtrlAltDel()
Get and Show Windows Runtime
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function GetTickCount& Lib "kernel32" ()
Public Function windowsRuntime(lbl As Label)
Dim lngReturn As Long
lngReturn = GetTickCount()
lbl.Caption = "Windows has been running for " & (lngReturn / 1000) & " seconds."
End Function
Add a label named Label1 to a form and add the following code...
Call windowsRuntime(Label1) 'Label1 being the display label.
Add All Available System Fonts to List
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Function AddFontsList(Lis As ListBox)
For X = 0 To Screen.FontCount - 1
Lis.AddItem Screen.Fonts(X)
Next X
End Function
Add a ListBox named List1 and add the following code wherever you want the code to execute...
Call AddFontsList(List1)
Visual Basic Code Snippets #5
In this next update I'll re-post my Visual Basic code snippets (which are older than five years by the way) that pertain to System Functions.
Shutdown/Poweroff Windows
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function ExitWindowsEx Lib "User32" Alias "ExitWindowsEx"(ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Add the following code into a command button or wherever you want the code to execute...
Call ExitWindowsEx(EWX_POWEROFF,0)
Restart Windows
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function ExitWindowsEx Lib "User32" Alias "ExitWindowsEx"(ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Add the following code into a command button or wherever you want the code to execute...
Call ExitWindowsEx(EWX_REBOOT,0)
Shell Out to Default Web Browser
Compatibility: Win. 98-XP
Add the following code into a module within your project...
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Public Const conSwNormal = 1
Public Function shellSite(site As String)
ShellExecute hwnd, "open", site, vbNullString, vbNullString, conSwNormal
End Function
Add the following code wherever you want the code to execute...
Call shellSite("http://www.beneskew.com")
