|
You last visited: Today at 19:50
Advertisement
C++ SendMessage Problem
Discussion on C++ SendMessage Problem within the C/C++ forum part of the Coders Den category.
08/02/2010, 20:42
|
#1
|
elite*gold: 1
Join Date: Jun 2009
Posts: 1,142
Received Thanks: 158
|
C++ SendMessage Problem
Also ich versuche gerade in C++ einen kleinen Spammer zu programmieren habe aber leider ein Problem.
Mein Code:
PHP Code:
#include <iostream> #include <windows.h> #include <string>
using namespace std;
int main() { HWND hwnd = FindWindow (0,"METIN2");
if (!hwnd) { cout << "METIN2 konnte nicht gefunden werden. Starten sie erst Metin2 dann das Programm.\n\n\n"; }
else { string text; double time; int place;
cout << "METIN2 wurde gefunden.\n"; cout << "Geben sie den Text der gespammt werden soll ein.\n"; cin >> text; cout << "Geben sie nun die Zeitverzögerung mit welcher der Text gespammt werden soll ein (zB. 0.5).\n"; cin >> time; cout << "Wo wollen sie Spammen? Normal (1), Gruppe(2), Gilde(3), Rufen(4)."; cin >> place;
if (place == 1) { while (1<2) { SendMessage (hwnd, text); Sleep (time); } }
} }
Aber wenn ich den compilen will komt diese Fehlermeldung:
Quote:
|
error: cannot convert 'std::string' to 'UINT' for argument '2' to 'LRESULT SendMessageA(HWND__*, UINT, WPARAM, LPARAM)'
|
Weiß nicht wirklich was ich falsch mache.
|
|
|
08/02/2010, 21:00
|
#2
|
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,345
|
Die Fehlermeldung sagt doch ganz deutlich, was falsch ist. Der 2. Parameter muss vom Typ UINT sein.
Mal ganz davon abgesehen braucht SendMessage 4 Parameter.
Und als 2. Parameter suchst du dir da aus, was du brauchst.
|
|
|
 |
Similar Threads
|
C++ SendMEssage Problem
12/11/2010 - C/C++ - 53 Replies
Hey Comunity,
bin C++ Anfänger und hab da ein Problem.
Und zwar möchte ich Tastendrücke mithilfe meines Programms simulieren,
da hab ich mir gedacht, dass ich SendMessage benutze.
Mein Problem ist jetzt, dass ich nicht weiß, wo ich das Parameter
für die "zu drückende" Taste hinschreiben soll bzw. in welcher Form;
als Hex oder VK_KEY_? . Der Bot soll einfach nur ununterbrochen
"w" drücken, jedoch krig ich es einfach nicht hin.
Bei Google hab ich nix gefunden, MSDN hab ich nicht...
|
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 19:50.
|
|