Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 21:07

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



VB 2010 Express ... Target

Discussion on VB 2010 Express ... Target within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2012
Posts: 134
Received Thanks: 6
VB 2010 Express ... Target

Yoo..

aloha guys..


that's my first topic here ....

i wish u answer me fast

well.. i'm trying to make auto keyboard clicker

that's the code
Code:
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)

sorry for ma bad english
modameryou is offline  
Old 10/16/2013, 16:58   #2
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Look for SendMessage/PostMessage
qkuh is offline  
Old 10/16/2013, 17:22   #3
 
elite*gold: 0
Join Date: May 2012
Posts: 134
Received Thanks: 6
i will try u help me if u can too
modameryou is offline  
Old 10/16/2013, 22:34   #4
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
Code:
    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
This will work in most cases.
berkay2578 is offline  
Old 10/17/2013, 06:57   #5
 
elite*gold: 0
Join Date: May 2012
Posts: 134
Received Thanks: 6
i only can put it in the public class

so it runs itself when i open the program ?

BTW this didn't work

and

(...) what these for ??

it said error and i removed them

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
modameryou is offline  
Old 10/17/2013, 08:16   #6
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
Let's say your target process' name is "iTarget.exe". Create a timer and use SendF5("iTarget")
berkay2578 is offline  
Old 10/17/2013, 18:19   #7
 
elite*gold: 0
Join Date: May 2012
Posts: 134
Received Thanks: 6
Testing

Still didn't work

Code:
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

My client name is " S4Client.exe "
modameryou is offline  
Old 10/17/2013, 18:44   #8
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
You don't event know how to declare an integer in VB, do you?

sigh.. just put SendF5("S4Client")
berkay2578 is offline  
Thanks
1 User
Old 10/17/2013, 21:34   #9
 
davydavekk's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 101
Received Thanks: 42
Don't c&p code, learn VB.
davydavekk is offline  
Old 10/18/2013, 01:04   #10
 
elite*gold: 0
Join Date: May 2012
Posts: 134
Received Thanks: 6
lol i tried this

i'm not that pro

but i tried to put SendF5("S4Client")

it doesn't work
modameryou is offline  
Old 10/18/2013, 04:06   #11
 
davydavekk's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 101
Received Thanks: 42
Quote:
Originally Posted by modameryou View Post
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
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
davydavekk is offline  
Old 10/18/2013, 07:13   #12
 
elite*gold: 0
Join Date: May 2012
Posts: 134
Received Thanks: 6
Quote:
Originally Posted by davydavekk View Post
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
I'm X32 bit ..
modameryou is offline  
Old 10/18/2013, 09:46   #13
 
elite*gold: 15
Join Date: Aug 2012
Posts: 3,041
Received Thanks: 6,394
Postmessage sends inputkeys. You have to use sendmessage if target exe catches it with "preview key down" event.
berkay2578 is offline  
Old 10/18/2013, 21:04   #14
 
davydavekk's Avatar
 
elite*gold: 0
Join Date: May 2013
Posts: 101
Received Thanks: 42
Try without the ".exe"
davydavekk is offline  
Reply


Similar Threads Similar Threads
[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 :)
i need Visual C++ 2010 Express Edition
03/26/2011 - WarRock - 7 Replies
Someone can give me download for Visual C++ 2010 Express Edition
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.



All times are GMT +2. The time now is 21:07.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.