Friday, October 23, 2009

VBS (Visual Basic Scripting)

Visual basic 2008

VBS stands for Visual Basic Scripting is developed by Microsoft in 1996, VBS is derived from Visual Basic, VBS can not be used for stand-alone programs, but combined with other programs such as HTML. VBS same Javascript function passing through HTML, VBS walking with a kind of website programming or with others, such as PWS in IIS on Win9x and Win2x or above.

Microsoft Visual Basic. Net is a programming used to develop and build-based applications. Net using the BASIC language. with this program you can create ASP.NET-based web application, this program is obtained apart from a few products that have been issued the previous Microsoft, Visual Basic.Net language identical to Microsoft Visual Basic before that first circulated.

 Visual Basic
'Create a Hover Button pd Applications

Public Sub sysControlHighLight (CTL as Control, X As Single, Y As
single, OriginalBackColor As Long, NewBackColor As Long)
As Long Dim Hittest
On Error resume Next
nHitTest = ctl.hwnd if Err.Number <> 0 Then
exit sub
with ctlIf (X <0) or
(y <0) or (x>. widht) or (Y>. height) thenReleasecapture
  . Backcolor = OriginalBackcolor
  Else SetCapture.hwnd
  . BackColor = NewBackColor
  end if On Error Goto 0
End Sub

Private Sub Command1_MouseMove _
(button As Integer, Shift As Integer, X As Single, Y As Single)
SysControlHighLight Command1, X, Y, vbBlue, vbRed
end Sub

Create a form be ahead

Declare Function SetWindowPos & Lib "USER32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)

Private Sub Form_Load ()
  this code makes the window stay on top
  Rtn = SetWindowPos (OnTop.hwnd, -2, 0, 0, 0, 0, 3)
End Sub

Changing the display size of the form
'Paste this code in the module

Declare Function GetWindowLong Lib "USER32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "USER32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public Const WS_EX_TOOLWINDOW = & H80 &
Public Const GWL_EXSTYLE = (-20)

Declare Function SetWindowPos Lib "USER32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const SWP_FRAMECHANGED = & H20
Public Const SWP_NOMOVE = & H2
Public Const SWP_NOZORDER = & H4
Public Const SWP_NOSIZE = & H1

'Paste this code in the form code

Private Sub Form_Load ()
Dim xx As Long

xx = GetWindowLong (hwnd, GWL_EXSTYLE)
xx = SetWindowLong (hwnd, GWL_EXSTYLE, _

SetWindowPos hwnd, 0, 0, 0, 0, 0, _
End Sub

Calling your favorite links
'Paste this code in the Module
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

'Paste this code on CommanButton
ShellExecute hwnd, "open", "", vbNullString, vbNullString, conSwNormal

'Oom - How to know speed access form (VB6)
'You can look your speed access form With simulation. This is very useful If 'you want to know access "speed" you form. Very Simple and easy.

'Name: How to access the form knowspeed
'Description: This code just to know "speed" access form.
'By: oom
'Paste This code in the module do in Form_Load
'Change the Start object as a sub main
'For speed check form:
'Run the form for the first time and look how many
'You get access on speed form.
'Step two loads or large picture in picture form and
'Then check again how many forms speed is u get.

Private Declare Function GetTickCount Lib "kernel32" () As Long

Sub main ()
As Long Dim lSpeedTime
SInfoSpeed As String Dim
lSpeedTime = GetTickCount
Load Form1
lSpeedTime = GetTickCount - lSpeedTime
'This is only simulation
     If lSpeedTime <= 50 Then
         SInfoSpeed = "[Very Fast]"
     ElseIf lSpeedTime> = 50 And lSpeedTime <= 100 Then
         SInfoSpeed = "[Normal]"
     ElseIf lSpeedTime> = 100 And lSpeedTime <= 200 Then
         SInfoSpeed = "[Slow]"
     ElseIf lSpeedTime> = 200 Then
         SInfoSpeed = "[Very Slow]"
End If
Form1.Caption = "Time Speed Form:" & lSpeedTime & "milliseconds -" & SInfoSpeed
End Sub

Creating scrolling like credit title
  Create a new project in Visual Basic. Form1 is created by default.
  Add the following code to the General Declarations section of
  Form1 (note that the Declare statement must be typed as a single
  line of code):

3D Const SRCCOPY = & HCC0020
Const ShowText $ = 3D "This line of text vertically Scrolls."

Private Declare Function BitBlt Lib "GDI" (ByVal hDestDC As Integer,
    ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer,
    ByVal nHeight As Integer, ByVal hSrcDC As Integer,
    XSrc ByVal As Integer, ByVal YSrc As Integer,
    DwRop ByVal As Long) As Integer

Dim ShowIt%

Private Sub Timer1_Timer ()
     Dim Ret As Integer
     If (ShowIt% = 3D 30) Then
         Picture1.CurrentX = 3D 0
         Picture1.CurrentY = 3D Picture1.ScaleHeight - 30
         Picture1.Print ShowText $
         ShowIt% = 3D 0
         3D ret = BitBlt (Picture1.hDC, 0, 0, Picture1.ScaleWidth,
             Picture1.ScaleHeight - 1, Picture1.hDC, 0, 1, SRCCOPY)
         ShowIt% = 3D ShowIt% + 1
     End If
End Sub

 Microsoft Visual Basic abbreviated as VB, is a programming language that offers Integrated Development Environment (IDE) to create visual-based application program Microsoft Windows operating systems using programming models Common Object Model (COM). Visual Basic is a BASIC derivative language, access to the database using Data Access Objects (DAO), Remote Data Objects (RDO), or ActiveX Data Objects (ADO). Some scripting languages such as Visual Basic for Applications (VBA) and Visual Basic Scripting Edition (VBScript), VB.Net, much like Visual Basic, but the way it works differently.

"Vbs code starting from

No comments:

Post a Comment