Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 22:06

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

Advertisement



VB.net Send Keys + Clicks without focus

Discussion on VB.net Send Keys + Clicks without focus within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1
 
zǝro's Avatar
 
elite*gold: 0
Join Date: Apr 2010
Posts: 733
Received Thanks: 511
VB.net Send Keys + Clicks without focus

Guten Abend,

Ich suche nach einem Weg Keys und Clicks in einem minimierten Programm zu emulieren.

Beispiel:
SendKeys.Send("A")
SendKeys.Send("F11")
Mouseclick at x,y
SendKeys.Send("F11")

Das Programm soll kein Focus bekommen also alles im Hintergrund erledigen.
Ich habe es bereits so versucht, aber es sendet ja nur einen Text und keine Keys:

Code:
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
                  (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
    Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
                     (ByVal hWnd As IntPtr, ByVal hWndChildAfterA As IntPtr, ByVal lpszClass As String, ByVal lpszWindow As String) As IntPtr
    Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
                     (ByVal hWnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As IntPtr, ByVal lParam As String) As IntPtr
    Const WM_SETTEXT As Integer = &HC

Private Sub BotGuildBank()
        Dim destination As IntPtr = FindWindow(Nothing, "TITLE")
        Dim destControl As IntPtr = FindWindowEx(destination, IntPtr.Zero, "Edit", Nothing)
        SendMessage(destControl, WM_SETTEXT, IntPtr.Zero, "A")
    End Sub
Hab google schon durchsucht, vielleicht weiß von euch ja jemand einen Rat ^^
zǝro is offline  
Old 06/07/2015, 20:06   #2
 
YatoDev's Avatar
 
elite*gold: 50
Join Date: Sep 2012
Posts: 3,841
Received Thanks: 1,462
Code:
[DllImport("user32.dll", CharSet = CharSet.None, ExactSpelling = false, SetLastError = true)]
        private static extern bool PostMessage(int hWnd, uint Msg, int wParam, int lParam);
Nach jedem aufruf:

Code:
PostMessage((int)handle, 0x0006, 0, 0);
YatoDev is offline  
Old 06/09/2015, 18:28   #3

 
snow's Avatar
 
elite*gold: 724
Join Date: Mar 2011
Posts: 10,480
Received Thanks: 3,319
Arrow General Coding -> .NET Languages

#moved…
snow is offline  
Old 06/12/2015, 19:09   #4
 
elite*gold: 0
The Black Market: 229/0/0
Join Date: Mar 2014
Posts: 2,790
Received Thanks: 6,658
> SendKeys im Minimierten Fenster.


MFG #Lucas#
_set is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[VB]Send.Keys :(..! Please..! Error
10/14/2011 - .NET Languages - 7 Replies
Hi. Sen.keys error. Please help me. does not work in metin2 . :( FORM Public Class Form1 Dim Komut As New AutoItX3Lib.AutoItX3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Interval = Val(TextBox2.Text) * 200 Label1.ForeColor = Color.Green Label1.Text = "ACIK"
[Request] How send clicks on minimized
10/11/2008 - CO2 Programming - 2 Replies
How send clicks on minimized in Visual C# ?
Source code to send clicks (Minimized)
09/09/2008 - CO2 Programming - 0 Replies
Well let an example of some functions in VB6 to send clicks and pfs to the screen. They work with the client miniminized or in background. It is a way that I have not seen used in the examples in the forum but I think it is the most effective. Unfortunately not comment on the code but the idea is this: Send messages BUTTONDOWN / BUTTONUP directly to the window handle control that contains the display or which contains buttons pf. not to the window pricipal Co ...



All times are GMT +2. The time now is 22:06.


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.