->>>>>BASE APPLY IS VISUAL BASIC 6.0<<<<<-


The is Visual Basic? Said“ Visual” make the
point which applied for making Graphical User
Interface ( GUI). In This Way You [shall] no longer
write down instruction pemrograman in lines codes,
but easyly You can do drag and drop objects which You
to apply.
Said“ Basic” is language part BASIC(Beginners
All Purpose Symbolic Instruction Code), that is a
programming language which in the history have many
applied by of programmers for compiling application.
Visual Basic is developed from BASIC programming
language.


1.1 Start Visual Basic 6.0
After You instal program Visual Basic 6.0,
You can start with button Start on the taskbar at
Windows. Following the stages;steps completely.
1. Depress button Start from Taskbar at Windows.
2. Choose All, Programs, and point at choice of
Microsoft Visual Studio 6.0 and click at choice
of Microsoft Visual Basic 6.0.

Gambar 1.1 Membuka Program Visual Basic 6.0
3. After You successfully implement Visual Basic for
the things first time his(its, You will see logo
display Visual Basic 6.0 and a few moment later
will emerge dialogue box following.

Gambar 1.2 Kotak Dialog New Project
4. The dialogue box ask confirmation to You is for
choosing project type wishing You making. In this case,
select;choose project type VB Enterprise Edition Constrols.
Depress button Open for continuing.

Gambar 1.3 Kotak Dialog Pemilihan Tipe Proyek
5. With election of type VB Enterprise Edition Controls above,
a user not necessarily again weary added the required
components. That thing is because at the project type
have provided components completely. Depress button Open
for continuing.
6. After buttoning Open, will emerge a program [screen/sail]
Visual Basic by accompanied by is complete components on
the part of General or Toolbox.

Gambar 1.4 Tampilan Interface Visual Basic
7. Display above can called as area of Integrated Development
Environment ( IDEA). At area of the, You can do various
activities like processes editing, compiling, and debugging.


1.2 Mengenal Elemen Visual Basic 6.0
After You successfully open Visual Basic at [screen/sail],
You will find interface program Visual Basic like Picture of 1.4.
Seen that interface consisting of some element.

1.2.1 Menu Bar
Menu Bar will present comands available for You apply
Your moment working for Visual Basic. In default, this bar menu
have choice of File, Edit, View, Window, Query, Diagram, Tools,
Add-Ins, and Help. The side, referring to pemrograman, there
are menu which can be accessed, for example Project, Format,
Debug, or Run.

Gambar 1.5 Tampilan Menu Bar
If each the bar menu clicked, Visual Basic will present
preference table from bar menu which You is click is the.

1.2.2 Context Menu
Context Menu contain shortcut which in a moment You
can apply for opening a context menu an object. For opening
this Context Menu, You can click right of object which You to
open the Context Menu. Following the picture display.


Gambar 1.6 Tampilan Context Menu
Context Menu above, we take away from Designer, Form, that
is by the way of clicking right of Form Designer.

1.2.3 Toolbar
This facility can quicken the comands access in
pemrograman. You can click buttons in this toolbar to do
certain action. standardly, toolbar type Standard which
will be presented by Your moment start Visual Basic.
If You wished to arrange display toolbar was other,
You can apply choice of Toolbar at bar menu View.

Gambar 1.7 Tampilan Toolbar

1.2.4 Toolbox
a window is containing of buttons control which
You would apply for designs or“ Membangun” a form or report.
Besides button control under, You also can define or
add x'self button control is other.

Gambar 1.8 Tampilan Toolbox Tipe Standard

Gambar 1.9 Tampilan Toolbox Tipe VB Enterprise Edition Controls
Come up not his(its of this window earn You arrange from
choice of Toolbox on the bar menu View - Toolbox.

1.2.5 Window Project Explorer
this Window Project Explorer present list form,
module, and also the other object in project active.
A Project is a group of file which You apply to develop
(build a application. Following the picture display.

Gambar 1.10 Tampilan Window Project Explorer

1.2.6 Window Properties
this Window Properties earn You apply to arrange
properties a or object control which You selecting.
a property is object characteristic, like size, caption,
text, or color.

Gambar 1.11 Tampilan Window Properties

1.2.7 Objek Browser
This browser object is enlisting the object in
project active. You can apply Object Browser for presenting
the object in Visual Basic and the application of other.
To present this object You can apply way of View-Object
Browser. Following the picture display.

Gambar 1.12 Tampilan Object Browser

1.2.8 Form Designer
Form Designer is a window available for You apply
to arrange display the application of which You compiling,
or equally as place of design a form. In this form You can
add control, graphic, and draw into form on course which
You wish. Every form have window designer form x'self.
Following the pictures displays

Gambar 1.13 Tampilan Form Designer

1.2.9 Window Code Editor
Window Code Editor is a display window which applied
to enter application code. this Window Code Editor applied
to define codes form or modules codes in a applications.
Following the picture display.

Gambar 1.14 Tampilan Window Code Editor

1.2.10 Window Form Layout
Window Form Layout applicable to control position of
form at the application of You apply graphic system in a
[screen/sail]. With this facility, You can see and know
position of form new You is design. Following the picture display.

Gambar 1.15 Tampilan Window Form Layout

1.2.11 Window Immmediate, Local, dan Watch
this Window-window is window addition which applied
for debug process the application of you. this Window-window
You can only applied if You implement application with
interface Visual Basic. To present this window-window,
You can do him(it by the way of View - Name Window.

Gambar 1.16 Tampilan Window Immediate

Gambar 1.17 Tampilan Window Locals

Gambar 1.18 Tampilan Window Watches

Sabtu, 03 Mei 2008

DESKTOP PROTECTOR


Example of source code under this function
to protect your computer from user-user not you wish
to apply your computer.
1. Prepare 1 Project Save by the name of Exlock.vbp
2. Make 1 Project by properties Name:FrmPassLock,
BackColor:&H00C00000&, Borderstyle:0-None
3. Make 1 Frame by properties Backcolor:&H00FF0000&
4. Make 1 Label by properties Name:lblStatus,
BackStyle:0-Transparent, Borderstyle:0-None
5. Make 2 TextBox, yaitu
TextBox1 by properties Name:txtUser,
BackColor:&H00FF8080&, Text:UserName.
TextBox2 by properties Name:txtPassword,
BackColor:&H00FF8080&, PasswordChar:*
6. Add 1 Timer dengan properties Name:timPause,
Enable:False, Interval:2000
7. Add Module save by the name of deskt.bas


Copy coding under this and paste in Editor Form:

'coding Editor Form::
'note For specification of password new,
'Vanish beforehand file profil_user.z33 hereinafter implement Exlock.vbp
'Adaptation from http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=48339&lngWId=1

Private Sub TampilkanPesan(ByVal Msg As String)
lblStatus.Caption = Msg
lblStatus.Left = Frame1.Width / 2 - lblStatus.Width / 20
timPause.Enabled = True
End Sub

Private Sub Redraw_Form()
Me.Height = Screen.Height
Me.Width = Screen.Width
Me.Top = 0
Me.Left = 0
Frame1.Caption = App.Title
Frame1.Top = Me.ScaleHeight / 2 - Frame1.Height / 2
Frame1.Left = Me.ScaleWidth / 2 - Frame1.Width / 2
AktifkanForm
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 95 Then KeyCode = 0
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
txtPassword.SetFocus
End Sub

Private Sub Form_Load()
App.TaskVisible = False
If txtUser.Text = "" Then txtUser.Locked = False
lngI = SetFocuses(Me.hWnd)
End Sub

Private Sub Form_Resize()
Redraw_Form
End Sub

Private Function Petunjuk()
Dim HurufPertamaPass
HurufPertamaPass = Left$(PassPadaMemory.strPassword, 1)
For i = 2 To Len(PassPadaMemory.strPassword)
HurufPertamaPass = HurufPertamaPass & "*"
Next i
Petunjuk = HurufPertamaPass
End Function

Private Sub txtPassword_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Then
If ApaPassDahBener(txtPassword.Text, txtUser.Text) <> Yap Then
TampilkanPesan "Password gak bener : (" & Petunjuk() & ")"
Else
End
End If
End If
End Sub

Private Sub txtUser_GotFocus()
If txtUser.Locked = True Then txtPassword.SetFocus
End Sub

Copy coding under this and paste in Editor Module:

'Copy coding dibawah ini dan paste di Editor Module:


Public Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Declare Function SetFocuses Lib "user32" Alias "SetFocus" (ByVal hWnd As Long) As Long
Private 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 Type InfoYgDidapat
LenUserName As Long
LenPassword As Long
strUserName As String
strPassword As String
End Type

Public Enum ApaButuhProfilBaru
Yap = -1
Kagak = 0
End Enum

Public UserName(100) As Long
Public Password(100) As Long
Public LenUser As Long
Public LenPass As Long
Public PassPadaMemory As InfoYgDidapat
Public Const UserProfile = "profil_user.z33"
Public BuatProfil As Boolean

Public Function ApaPassDahBener(ByVal lpPassword As String, lpUserName) As ApaButuhProfilBaru
Dim NullReturn As Variant
If BuatProfil = True Then
NullReturn = TulisUserN_keFile(lpUserName, lpPassword)
ApaPassDahBener = Yap
Exit Function
End If

If lpPassword <> PassPadaMemory.strPassword Then
ApaPassDahBener = Kagak
Else
ApaPassDahBener = Yap
End If
End Function

Public Function ApaAda(ByVal lstrQuery As String) As Boolean
ApaAda = (Dir(lstrQuery) <> "")
End Function

Public Function AmbilUsrN_DariFile() As InfoYgDidapat
On Error GoTo ErrorHandler
Dim LenUserName As Long
Dim LenPassword As Long
Dim lngUserN(100) As Long
Dim lngPassN(100) As Long
Dim lpStrUser, lpStrPassword, Letter As String
Dim lngShuffle As Long

Open UserProfile For Binary As #1
Get #1, , LenUserName
Get #1, , LenPassword
Get #1, , lngUserN
Get #1, , lngPassN
Close #1

For i = 1 To LenUserName
lpStrUser = lpStrUser & Chr$((lngUserN(i) / 2))
Next i

For i = 1 To LenPassword
lpStrPassword = lpStrPassword & Chr$(lngPassN(i) / 2)
Next i

With AmbilUsrN_DariFile
.LenPassword = LenPassword
.LenUserName = LenUserName
.strPassword = lpStrPassword
.strUserName = lpstrusername
End With
Exit Function

ErrorHandler:
frmPassLock.Visible = False
MsgBox "Error:" & Err.Description
End
End Function

'Enkripsi password pada file profil_user.z33
Public Function TulisUserN_keFile(ByVal lstrUser As String, lstrPass As String)
On Error GoTo ErrorHandler
Dim lngShuffle As Long
Dim Letter As String

LenUser = Len(lstrUser)
LenPass = Len(lstrPass)

For i = 1 To LenUser
Letter = Mid$(lstrUser, i, i + 1)
lngShuffle = Asc(Letter)
UserName(i) = lngShuffle * 2
Next i

For i = 1 To LenPass
Letter = Mid$(lstrPass, i, i + 1)
lngShuffle = Asc(Letter)
Password(i) = lngShuffle * 2
Next i

Open UserProfile For Binary As #1
Put #1, , LenUser
Put #1, , LenPass
Put #1, , UserName
Put #1, , Password
Close #1

Exit Function

ErrorHandler:
frmPassLock.Visible = False
MsgBox "Error:" & Error
End
End Function

Public Sub AktifkanForm()
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
lngFlags = SWP_NOMOVE Or SWP_NOSIZE Or SWP_SHOWWINDOW Or SWP_NOACTIVATE
SetWindowPos frmPassLock.hWnd, HWND_TOPMOST, 0, 0, 0, 0, lngFlags
End Sub

Public Sub InfFile()
Dim UserFile As String
End Sub

Public Function CekApaButuhProfBaru() As ApaButuhProfilBaru
If Not ApaAda(UserProfile) Then
MsgBox "Nggak ada profil_user.z33...Tulis Password yang baru", vbApplicationModal
CekApaButuhProfBaru = Yap
Else
CekApaButuhProfBaru = Kagak
End If
End Function

Public Sub Main()
Dim DesktopdC As Long
Dim strName As String
Dim lngBuffer As Long
Dim HasilTanya As ApaButuhProfilBaru
App.Title = "Desktop Locker : v1n0z33"
HasilTanya = CekApaButuhProfBaru()
BuatProfil = (HasilTanya = Yap)

If HasilTanya <> Yap Then
PassPadaMemory = AmbilUsrN_DariFile()
End If

strName = String$(255, 0)
lngBuffer = GetUserName(strName, Len(strName))
Load frmPassLock
frmPassLock.txtUser.Text = strName
frmPassLock.Show
End Sub

Tidak ada komentar: