Register for your free account! | Forgot your password?

You last visited: Today at 16:21

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

Advertisement



sendmessage?

Discussion on sendmessage? within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2006
Posts: 35
Received Thanks: 14
sendmessage?

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...)
Code:
        [DllImport("User32.dll", CharSet = CharSet.Auto)]
        private static extern IntPtr FindWindow(string winClass, string WinName);
        [DllImport("User32.dll", CharSet = CharSet.Auto)]
        private static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
        [DllImport("User32.dll", CharSet = CharSet.Auto)]
        private static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

        private const uint WM_ACTIVATEAPP = 0x001C;
        private const uint WM_KEYDOWN = 0x0100;
        private const uint WM_KEYUP = 0x0101;
        private const uint WM_SETFOCUS = 0x0007;

        static void Main(string[] args)
        {
            IntPtr WinHandle = IntPtr.Zero;
            WinHandle = FindWindow(null, "Nimetön - Muistio");

            if (WinHandle != IntPtr.Zero)
            {
                Console.WriteLine(WinHandle.ToString());
                SendMessage(WinHandle, WM_ACTIVATEAPP, (IntPtr)1, IntPtr.Zero);
                SendMessage(WinHandle, WM_SETFOCUS, IntPtr.Zero, IntPtr.Zero);
                SendMessage(WinHandle, WM_KEYDOWN, (IntPtr)0x31, (IntPtr)1);
                SendMessage(WinHandle, WM_KEYUP, (IntPtr)0x31, (IntPtr)1);
            }
so could someone clear me out abit?
zarut is offline  
Reply


Similar Threads 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...
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.
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 16:22.


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