Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 13:19

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

Advertisement



C++ SendMEssage Problem

Discussion on C++ SendMEssage Problem within the C/C++ forum part of the Coders Den category.

Reply
 
Old 02/11/2010, 20:38   #46
 
Σternαl.'s Avatar
 
elite*gold: 20
Join Date: Dec 2009
Posts: 1,850
Received Thanks: 484
Lol, sieht C++ ziemlich ähnlich^^
Und wie kann ich mein Programm jetzt zum Laufen kriegen?
Was gibts denn noch als Möglichkeit außer SendMessage?
Σternαl. is offline  
Old 02/11/2010, 21:22   #47
 
Shadowz75's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 443
Received Thanks: 597
Quote:
Originally Posted by FooFightah View Post
Lol, sieht C++ ziemlich ähnlich^^
Und wie kann ich mein Programm jetzt zum Laufen kriegen?
Was gibts denn noch als Möglichkeit außer SendMessage?

AutoIt ist in C++ geschrieben

Quote:
Was gibts denn noch als Möglichkeit außer SendMessage?
wie schon vorher genannt.
Shadowz75 is offline  
Old 02/11/2010, 21:24   #48


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Quote:
Originally Posted by FooFightah View Post
auf Wiki stand jetzt, dass DirectInput die Windows
Messages umgeht und direkt auf die Hardware geht (oder so ähnlich).
Heißt das jetzt, dass ich mit C++ nicht weiter komme, muss ich das über AutoIt machen?
i lol'd
MrSm!th is offline  
Old 02/11/2010, 21:33   #49
 
Σternαl.'s Avatar
 
elite*gold: 20
Join Date: Dec 2009
Posts: 1,850
Received Thanks: 484
Ich trau mich erst garnicht zu fragen, ob mir jemand zeigen kann, wie man SendInput
benutzt, welche Parameter man brauch, woher man die krigt, etc......

Also?
Und bevor jetzt wieder 5.000 verschiedene Antworten/Theorien kommen:
1.Welche Parameter brauch ich?
2.Wie bekomme ich diese Parameter?
3.Muss ich irgend etwas besonderes beachten?
Σternαl. is offline  
Old 02/11/2010, 22:31   #50


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Quote:
Originally Posted by FooFightah View Post
Ich trau mich erst garnicht zu fragen, ob mir jemand zeigen kann, wie man SendInput
benutzt, welche Parameter man brauch, woher man die krigt, etc......

Also?
Und bevor jetzt wieder 5.000 verschiedene Antworten/Theorien kommen:
1.Welche Parameter brauch ich?
2.Wie bekomme ich diese Parameter?
3.Muss ich irgend etwas besonderes beachten?
the msdn has the answer to all your questions my friend



sei nicht so faul <.<
MrSm!th is offline  
Old 02/11/2010, 22:53   #51
 
Σternαl.'s Avatar
 
elite*gold: 20
Join Date: Dec 2009
Posts: 1,850
Received Thanks: 484
Wie oft denn noch D:
Ich versteh msdn nicht....
Und vor allem steht da nur wenig drinne,
zb stand bei SendMessage nur, dass man UINT Msg,
irgendwas anderes, WPARAM wParam und lParam braucht.
Aber, dass ich da noch
PHP Code:
      void sendKeystroke(char character)  
      {  
          
WPARAM keystroke LOBYTE(VkKeyScanA(character));  
      } 
und
PHP Code:
sendKeystroke('w'); 
brauch, hab ich erst nach 2 Tagen Flame und halben Nervenzusammenbrüchen
erfahren. Von daher find ich msdn in der Beziehung Crap.

So und jetzt wieß ich, dass ich für SendInput
UINT nInputs, LPINPUT pInputs und int cbSize brauch.
Aber woher bekomme ich diese Parameter und was fehlt mir noch
wenn ich die Parameter hab, um endlich die Scheiße zum Laufen zu kriegen?
Σternαl. is offline  
Old 02/11/2010, 23:00   #52


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,902
Received Thanks: 25,407
Quote:
Originally Posted by FooFightah View Post
Wie oft denn noch D:
Ich versteh msdn nicht....
Und vor allem steht da nur wenig drinne,
zb stand bei SendMessage nur, dass man UINT Msg,
irgendwas anderes, WPARAM wParam und lParam braucht.
Aber, dass ich da noch
PHP Code:
      void sendKeystroke(char character)  
      {  
          
WPARAM keystroke LOBYTE(VkKeyScanA(character));  
      } 
und
PHP Code:
sendKeystroke('w'); 
brauch, hab ich erst nach 2 Tagen Flame und halben Nervenzusammenbrüchen
erfahren. Von daher find ich msdn in der Beziehung Crap.

So und jetzt wieß ich, dass ich für SendInput
UINT nInputs, LPINPUT pInputs und int cbSize brauch.
Aber woher bekomme ich diese Parameter und was fehlt mir noch
wenn ich die Parameter hab, um endlich die Scheiße zum Laufen zu kriegen?
Da sieht man, dass du 0 verstanden hast <.<
Die MSDN ist alles andere als Crap, wenn der User halbwegs Intelligenz+Grundlagen + Eigeninitiative hat

1. das brauchst du auch nicht, das ist eine Möglichkeit SendMessage zu nutzen
SendMessage hat viele Funktionen und die können da nicht alle aufgelistet werden
2. die msdn ist sehr umfangreich
3. hättest du dir ja mal das Beispiel ansehen können oder auf andere links klicken können (es gibt immer links wie "See also" oder manchmal sind sogar die Parametertypen selbst verlinkt! also einfach mal augen+hirn nutzen )
4. gibts google
5. die parameter bekommst du nirgendwoher <.< die gibst doch DU der funktion. da stehen beschreibungen der Parameter, lies, wozu sie gut sind, denke nach und probiere aus.
Zusätzlich wie gesagt google oder die Beispiele
6. verdammt noch mal, lern doch erst mal
-die Grundlagen
-wie man mit suchmaschinen und der msdn umgeht
-wie man in der msdn das findet, was man sucht
Ansonsten sehe ich schwarz für eine C&P freie Codingzukunft


edit: Hab mir das mal angesehen.
Wenn du der Englischen Sprache mächtig bist und nicht zu faul, dich durch 2-3 Links zu klicken, erfährst du ganz leicht, wie es geht.


Code:
UINT SendInput(      
    UINT nInputs,
    LPINPUT pInputs,
    int cbSize
);
Quote:
Parameters

nInputs
[in] Number of structures in the pInputs array.
pInputs
[in] Pointer to an array of INPUT structures. Each structure represents an event to be inserted into the keyboard or mouse input stream.
cbSize
[in] Specifies the size, in bytes, of an INPUT structure. If cbSize is not the size of an INPUT structure, the function fails.

Code:
typedef struct tagINPUT { 
  DWORD type; 
  union {MOUSEINPUT mi; 
            KEYBDINPUT ki;
            HARDWAREINPUT hi;
           };
  }INPUT, *PINPUT;
Quote:
Members

type
Specifies the type of the input event. This member can be one of the following values.

INPUT_MOUSE
The event is a mouse event. Use the mi structure of the union.
INPUT_KEYBOARD
The event is a keyboard event. Use the ki structure of the union.
INPUT_HARDWARE
Windows 95/98/Me: The event is from input hardware other than a keyboard or mouse. Use the hi structure of the union.

mi
A MOUSEINPUT structure that contains information about a simulated mouse event.
ki
A KEYBDINPUT structure that contains information about a simulated keyboard event.
hi
Windows 95/98/Me: A HARDWAREINPUT structure that contains information about a simulated event from input hardware other than a keyboard or mouse.
Code:
typedef struct tagKEYBDINPUT {
    WORD wVk;
    WORD wScan;
    DWORD dwFlags;
    DWORD time;
    ULONG_PTR dwExtraInfo;
} KEYBDINPUT, *PKEYBDINPUT;
Quote:
Members

wVk
Specifies a virtual-key code. The code must be a value in the range 1 to 254. The Winuser.h header file provides macro definitions (VK_*) for each value. If the dwFlags member specifies KEYEVENTF_UNICODE, wVk must be 0.
wScan
Specifies a hardware scan code for the key. If dwFlags specifies KEYEVENTF_UNICODE, wScan specifies a Unicode character which is to be sent to the foreground application.
dwFlags
Specifies various aspects of a keystroke. This member can be certain combinations of the following values.

KEYEVENTF_EXTENDEDKEY
If specified, the scan code was preceded by a prefix byte that has the value 0xE0 (224).
KEYEVENTF_KEYUP
If specified, the key is being released. If not specified, the key is being pressed.
KEYEVENTF_SCANCODE
If specified, wScan identifies the key and wVk is ignored.
KEYEVENTF_UNICODE
Windows 2000/XP: If specified, the system synthesizes a VK_PACKET keystroke. The wVk parameter must be zero. This flag can only be combined with the KEYEVENTF_KEYUP flag. For more information, see the Remarks section.

time
Time stamp for the event, in milliseconds. If this parameter is zero, the system will provide its own time stamp.
dwExtraInfo
Specifies an additional value associated with the keystroke. Use the GetMessageExtraInfo function to obtain this information.
MrSm!th is offline  
Old 02/11/2010, 23:06   #53
 
Σternαl.'s Avatar
 
elite*gold: 20
Join Date: Dec 2009
Posts: 1,850
Received Thanks: 484
Hmm, werds dann mal versuchen >_>
So, sry, aber ich hab keine Lust mehr solangsam.....
Ich versteh es einfach nicht, weil ich auch die Grundlagen nicht drauf hab....
Bin jetzt schon fast 3 Tagen drann und immernoch zu keinem Ergebnis gekommen.
Keiner will einem helfen, geschweige denn einfach mal den richtigen Source Posten.
Dauernd heißt es nur, dass ich zu faul oder zu dumm bin und ich das Programmieren
sein lassen soll, und bisher hatt nur flo was richtiges gepostet, sonst hat mir niemand
richtig geholfen und alle sind nur am flamen, tolles Forum......

€dit:
Nett, dass du mir das rausgesucht hast, aber anscheinend fehlt in meinem
Gehirn irgendetwas, das Sachen logisch verknüpfen kann ^^
Wie gesagt, wäre dir unendlich dankbar, wenn du dein kaltes, steinernes
Anti-Leecher-und-anti-Dummköpfe-Herz für mich erwärmen könntest
und mir den Source schicken könntest :>
Σternαl. is offline  
Old 12/11/2010, 01:14   #54
 
elite*gold: 0
Join Date: Feb 2008
Posts: 16
Received Thanks: 1
Hallo zusammen,

es tut mir jetzt schon leid, aber ich bin der nächste der sich damit beschäftigt.
Im gegensatz zu meinem vorgänger, ahbe ich jedoch wenigstens nen tuorial gelesen, was mir ein paar grundlagen geben dürfte.

Sofern ich das richtig verstand, geht sendinput nur in dem aktiven fenster.
da postmessage wohl die nachrichten nur abschickt, jedoch nicht auf die ausführung in externen programm wartet, wollte ich sendmessage benutzen.

laut dem thread hier, geht dies nun allerdings GARNICHT in spielen ?

Sowas wie das schließen der Anwendung bekam ich schon hin, aber selbst das senden nach zb notepad ging nicht. glaube da bräuchte ich auch eine childwindow, ist dies bei spielen auch der fall ?

/edit:
die MFC sieht sehr interessant aus. Habe sie mir gerade geladen, gehe sie mal durch.
Feedback folgt.
Barra Sargtlin is offline  
Reply

Tags
c++, problem, sendmessage


Similar Threads Similar Threads
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;
delphi sendmessage
07/27/2010 - General Coding - 3 Replies
hallo leute ich hab mal eine frage ob mir jemand kurz erläutern könnte wie ich mit sendmessage eine mausbewegung in einem minimierten fenster ausgebe ich habe embarcadero rad studio 2010 hier ist der bisherige "source": uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm)
[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,...
how do i sendmessage a password box
05/11/2007 - Conquer Online 2 - 11 Replies
HI, I'm trying to sendmessage the password to the password box. It gives me the *** in the box but when i click the enter button it gives me the wrong password error. any help would be appreciated



All times are GMT +1. The time now is 13:20.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.