Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding > Coding Tutorials
You last visited: Today at 06:44

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

Advertisement



SendMessage Tutorial

Discussion on SendMessage Tutorial within the Coding Tutorials forum part of the General Coding category.

Reply
 
Old 09/27/2011, 19:12   #16
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
jup danke hab das schon geschafft gehabt..mit dem abfangen..nur hab ich jetz gemerkt das das übersenden an alle formen nur bei text situation geht..

also wenn ich im spiel stehen und laufen will mit der taste w zb.. dann gehts nicht mehr aber wenn ich den chat öffne und dann wieder was drücke wird das übergeben...
aber im spiel gehts nicht...>.<.. ich verzweifle ...

hast du vllt eine lösung??

mfg
Banana
Banana_jo is offline  
Old 09/27/2011, 19:19   #17
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,810
Laut msdn.microsoft.com:
PHP Code:
//SendMessage
Sends the specified message to a window or windows.

//SendKeys
Sends keystrokes to the active application
Also wie der Name schon sagt, wird bei SendMessage wohl eine "Message" an das Fenster geschickt. Mit der SendKeys-Methode werden keystrokes (= Tastenanschläge) gesendet, aber eben nur an das aktive Fenster. Kannst ja mal versuchen ob das klappt: SendKeys.Send("w")
Müsste aber klappen.. um das nun auch an ein Fenster zu senden, welches im Hintergrund ist, musst du wohl eine andere Methode benutzen, ich glaube das müsste mit DirectInput gehen. Ich kenn mich da aber nicht aus, musst mal googlen..
Kraizy​ is offline  
Old 09/27/2011, 19:41   #18
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
jup bin gerade auch darauf gestoßen...directInput...findet man aber wirklich KEIN tut (also ich nicht jetz in den letzten 30 min)
im internet...

wenn du eins kennst oder so..wär ich dir wirklich sehr dankbar..

ps: danke aber für deine hilfe bis jetz

mfg
Banana

habs jetz doch geschaft...stichwort war keyup und keydown und nicht MW_CHAR
so jetz hab ich halt das problem mit dem timer wieder...das halt die zuletzt gedrückte taste nicht gestoppt wird...ich guck mir mal dein code an oben


mfg
Banana
Banana_jo is offline  
Old 09/27/2011, 20:20   #19
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,810
Teil 3 hinzugefügt.
Kraizy​ is offline  
Old 09/27/2011, 20:22   #20
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
EDIT2:

hast du vllt eine idee wie man die abfrage von tasten auch so simuliert das die zahl zb 49 = 1 ist auch nur angezeigt wird wenn ich die taste auch drücke...

Code:
   
    Public Function getkeypress() As Integer
        For i As Integer = 1 To 255
            If GetAsyncKeyState(i) = -32767 Then
                Return i
            End If
        Next
    End Function

 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Dim key As Integer = getkeypress()

        If key <> 0 Then
            Label1.Text = CStr(key)
            SendMessage(lhWnd, WM_KEYDOWN, Label1.Text, vbNullString)

        End If

    End Sub
habs jetz so...und die zahl die im label steht bleibt auch drinn auch wenn ich nichts mehr drücke aber so darf es halt nicht sein...
hast du vllt ne idee?

mfg
Banana
Banana_jo is offline  
Old 09/27/2011, 20:25   #21
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,810
Du meinst, wenn du eine Taste drückst, soll diese im Label angezeigt werden und wenn du sie wieder los lässt nicht mehr anzeigen? Müsste zu schaffen sein, aber muss jetz off, antworte dir dann morgen nochmal.
Kraizy​ is offline  
Old 09/27/2011, 20:40   #22
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
genau so meine ich das

alles klar wenn ich es bis morgen nicht schon geschafft habe freue ich mich schon drauf :P

danke dir...

mfg
Banana
Banana_jo is offline  
Old 09/28/2011, 15:57   #23
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,810
Also ich hab jetzt zwar eine Methode gefunden, aber dann müsstest du das für jede Taste machen:

PHP Code:
Public Class Form1
   
//GetAsyncKeyState-API
   
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Integer) As Integer

   
//Timer mit einem Interval von z.B. 100
   
Private Sub tmrCheck_Tick(...) Handles tmrCheck.Tick
      Select 
Case True
         
Case GetAsyncKeyState(&H41)
               
Label1.Text "A"
         
Case GetAsyncKeyState(&H42)
               
Label1.Text "B"
         
Case GetAsyncKeyState(&H43)
                
Label1.Text "C"
         
Case Else
                
Label1.Text "Keine Taste"
         
End Select
   End Sub
End 
Class 
Also wie gesagt, müsstest du so nun für jede Taste immer "Case GetAsyncKeyState(...).." schreiben. Am besten fügst du diese Konstanten in eine Liste oder irgendwas hinzu:
und durchläufst sie einfach mit einer Schleife.
Kraizy​ is offline  
Old 09/29/2011, 00:24   #24
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
danke...ich werds mir mal angucken..

.-..naja nur das problem ist...das ja nicht "a" "b" kommen soll sondern die hash codes..und ich hab das jetz eingebunden...aber wenn ich KEINE taste drücke steht noch die letzt gedrückte taste...>.<

EDIT:

also wie kann ich kontrollieren das gerade eine taste im druck ist...?
Banana_jo is offline  
Old 09/29/2011, 15:43   #25
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,810
Was für ein Hashcode? o.O
Wenn du keine Taste drückst, dann wird das Else aufgerufen und im Label wird der Buchstabe nicht mehr angezeigt.
Kraizy​ is offline  
Old 09/29/2011, 17:20   #26
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
ja stimmt sry...hab das nur falsch eingefügt....hast du vllt ne liste wo diese codes drinne stehen? welche taste welche zahl ist?

ja ich weis immer nur eine zahl höer^^..aber für sondertasten und sowas
Banana_jo is offline  
Old 09/29/2011, 18:38   #27
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,810
Kraizy​ is offline  
Old 09/29/2011, 19:42   #28
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
DANKÖÖÖ hab das mit dem keyup auch schon hinbekommen


ohne dich hätt ich das ganze garnicht geschaft
Banana_jo is offline  
Old 09/29/2011, 20:59   #29
 
Kraizy​'s Avatar
 
elite*gold: 0
The Black Market: 471/0/0
Join Date: Apr 2010
Posts: 9,696
Received Thanks: 1,810
Solang nicht nach C&P-Code gefragt wird helfe ich gerne
Kraizy​ is offline  
Old 09/30/2011, 18:34   #30
 
Banana_jo's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 236
Received Thanks: 90
Joa denk ich auch :P

hab da noch ne offene frage :

undzwar wie sende ich denn mausklickst weiter?
Banana_jo is offline  
Reply


Similar Threads Similar Threads
C# - SendMessage/PostMessage
12/21/2013 - CO2 Programming - 3 Replies
Hello, I have recently started to toy around with the idea of sending a mouse click, or other events, to a conquer client that is minimized, or just not in focus. I have been using Spy++ to help along in all the messages the client receives and what not. I have got it kind of working and was wondering if anyone here could give me a hand. //WM_PARENTNOTIFY-SendMessage-ParentWindow bool seven = MouseClickHandler.SendMessage(new IntPtr(0x004F04CA), (int)0x0210, new IntPtr(0x00000201), new...
SRO SendMessage API
02/26/2012 - SRO Coding Corner - 5 Replies
Hello. I want make simple clicker on vSRO. but I can't do so would only click on SRO I know I need to use SendMessage API but I do not know how to do it Can someone show me it on this code: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Timer1.Start()
C++ SendMessage Problem
08/02/2010 - C/C++ - 1 Replies
Also ich versuche gerade in C++ einen kleinen Spammer zu programmieren habe aber leider ein Problem. Mein Code: #include <iostream> #include <windows.h> #include <string> using namespace std;
[Help] C# SendMessage()
05/11/2010 - CO2 Programming - 19 Replies
I'm currenty trying to use the SendMessage Function with CO. According to msdn I need to use this: static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, IntPtr lParam); My question is: How do I find the hWnd? What are the wParam and lParam? And what can I use as wParam and lParam? Any help will be greatly appreciated.
sendmessage?
12/26/2008 - CO2 Programming - 0 Replies
just wondering how it works in C# tried few tutorials with notepad in it and it doesnt send the letters/close it even it finds the window this is how i got it so far (pretty much copypasted, just to see how it works...) private static extern IntPtr FindWindow(string winClass, string WinName); private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); private static extern IntPtr PostMessage(IntPtr hWnd,...



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


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.