Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send("{F5}")
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
End Class
it works perfectly i set the timer to 1000 ms ( 1 sec )
it presses F5 every 1 sec
Here goes the question
CAN I MAKE A TARGET ( PRESS F5 IN a specific PROCESS)
Imports System.Runtime.InteropServices
(...)
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
End Function
Private Sub SendF5(ByVal ProcessName As String)
Dim processes As Process() = Process.GetProcessesByName(ProcessName)
Dim proc As Process = processes(0)
PostMessage(proc.MainWindowHandle, &H100, &H74, 0)
End Sub
and it asked me to move Imports System.Runtime.InteropServices
to the general
Here's how i did it
Code:
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
End Function
Private Sub SendF5(ByVal ProcessName As String)
Dim processes As Process() = Process.GetProcessesByName(S4Client.exe)
Dim proc As Process = processes(0)
PostMessage(proc.MainWindowHandle, &H100, &H74, 0)
End Sub
End Class
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
[B][I][U] WHAT SHOULD I WRITE HERE ! ! ! ! ! ! ! ! ! ![/U][/I][/B]
End Sub
End Class
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
End Function
Private Sub SendF5(ByVal ProcessName As String)
Dim processes As Process() = Process.GetProcessesByName(S4Client.exe)
Dim proc As Process = processes(0)
PostMessage(proc.MainWindowHandle, &H100, &H74, 0)
End Sub
End Class
It's not gonna work because the Process.GetProcessesByName() function takes a string argument. (you forgot the " ", it should be "S4Client")
Do you have a 32 or a 64bits version of Windows ? (you may need a unhider to "find" s4's process)
EDIT : Or you do
Code:
Process.GetProcessesbyName(ProcessName) 'and like that it should work
It's not gonna work because the Process.GetProcessesByName() function takes a string argument. (you forgot the " ", it should be "S4Client")
Do you have a 32 or a 64bits version of Windows ? (you may need a unhider to "find" s4's process)
EDIT : Or you do
Code:
Process.GetProcessesbyName(ProcessName) 'and like that it should work
i got unhider..
and i will try
it didn't work
Code:
Imports System.Runtime.InteropServices
Public Class Form1
Public Class Form1
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function PostMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As Boolean
End Function
Private Sub SendF5(ByVal ProcessName As String)
Dim processes As Process() = Process.GetProcessesByName("S4Client.exe")
Dim proc As Process = processes(0)
PostMessage(proc.MainWindowHandle, &H100, &H74, 0)
End Sub
End Class
End Class
[TuT]Visual Basic 2010 Express 07/01/2013 - Alliance of Valiant Arms - 4 Replies Hey Com.
Könntet Ihr Vllt Hier in den Thread "TuT's" für Visual Basic Posten ?
Damit ich einen Neuen free Hack Für AvA erstellen kann ?
Danke ;) !
[FRAGE] Microsoft Virsual Basic 2011 Express oder Visual C++ 2010 Express??? 07/16/2011 - .NET Languages - 1 Replies Microsoft Virsual Basic 2011 Express oder Visual C++ 2010 Express ???
also die Begründung sollte nicht am schwierigkeitsgrad liegen. ich wollte wissen welches programm sinnvoller ist bzw. ob es ein besseres gibt. das lernen bekomme ich noch hin :)
Vb 08 Express oder 2010 Ultimate 07/29/2010 - .NET Languages - 0 Replies Würde gerne mit einer der Beiden Versionen es schaffen die eigenschaften von Fenstern die in dem Taskmanager stehen zu verändern.
Wisst ihr wie man sowas anstellt?
Also ich will nur wissen wie ich auf den Prozess zugreife und den Dann Verändern kann wie z.b. Den namen mehr nicht!
EDIT:
Wie sowas hier nur für Vb
http://www.elitepvpers.com/forum/epvp-coders-relea ses/665449-mini-release-multi-window-tool.html
What is your aim/wish/target for 2010? 12/31/2009 - Off Topic - 2 Replies Let's put a side the daily efforts, and clear our minds for a bit, and tell each other what is your wish for this year, I will start:
I wish to pass my school year (final year x_x) so I will start college to turn to a computer engineer, and find a better girl friend xD.