Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 01:19

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

Advertisement



How to find events and simulate them

Discussion on How to find events and simulate them within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2010
Posts: 5
Received Thanks: 1
How to find events and simulate them

Guys i want to learn how programs comminication each other for make bots.
Here is an example for calculator;
Code:
#include <windows.h>
#include <iostream>
using namespace std;
int main(){
	
	HWND hwndCalc;
 
 
hwndCalc = FindWindow(NULL, "Calculator");
 
if(!hwndCalc)
 
    return 1;
 
SendMessage(hwndCalc, WM_COMMAND, MAKEWPARAM(0x84, BN_CLICKED), 0);
 
	return 0;
 
}
the point is SendMessage function.Calculator's buttons works in this way.With ollydbg i can find it which i did.But debugging is full of issues.I couldn't debug any normal program with ollydbg.Because it is crashing or accessing violation or exceptions bla bla.

So i'm wondering is there any other way to find how do programs communicate?
nepafter37 is offline  
Old 01/21/2017, 17:41   #2
 
elite*gold: 0
Join Date: Feb 2009
Posts: 1,137
Received Thanks: 573
Every GUI control in Windows is a so called window. These windows are identified via a handle, given by the OS. You can find out the handle through the name (or the text) using the FindWindow(Ex) function. You can find the names with Microsofts software. Those windows can receive messages from the operating System. For example when you click on a window the operating system sends a mousedown and mouseup message. You can send these messages virtually by calling SendMessage or PostMessage.

Quote:
So i'm wondering is there any other way to find how do programs communicate?
What do you mean by that? Programs usually communicate via Pipes, Message Queues (don't confuse them with with the GUI messages send via SendMessage) or Shared Memory. The communication via SendMessage is just the way GUI controls work, Messages are queued for events, and the program checks the queue regularly and checks if any events appeared and the program needs to react. Also these Messages are used to communicate with the Controls (Managed by the operating system). For example to set the Text of a Button you send a SetText message. You can find more information about these message on
warfley is offline  
Old 01/21/2017, 18:06   #3
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,487
Also, many programs are partially exception-driven. This may lead to various stops/breaks while debugging. If you're not actually looking for a bug in the application, you can make the debugger ignore all the exceptions (All common debuggers have options for this).

Also keep in mind that OllyDBG 1.10 does not run on x64 properly. The Plugin "ScyllaHide" supplies a x64-fix.
florian0 is offline  
Reply


Similar Threads Similar Threads
[question] simulate keypress
08/21/2012 - Cabal Online - 3 Replies
can anyone help me with coding a c++ dll that presses a single keyboard key for cabal im creating one but no luck... quite a noob in c++ :)
Simulate click in Npc
08/06/2012 - General Coding - 0 Replies
(sorry for my bad english) =( Hi, there is a way for simulate the clicking on a npc? I need to Know if there and ¿how?. Is for the game Zero online, I want to do is "simulate" a click on an npc in specific, to open a window from anywhere, which normally can not. I am willing to learn what it takes, I would like to make an executable that simulates the "click". I thought about making the post in the section for Zero, but I had my doubts, thank you and sorry if you move. Thanks and hope...
Simulate Keyboard input - Tastatureingaben auf unterster Ebene simulieren.
07/18/2012 - .NET Languages - 5 Replies
Hi! Is there any way to simulate keyboard input in Visual Basic 2005 or higher, so that a Div-X Application receives them? Hallo! Gibt es eine Möglichkeit in Visual Basic 2005 oder höher um Tastatureingaben so zu simulieren, dass ein Div-X Spiel diese empfängt? Thank's FlixLix100



All times are GMT +1. The time now is 01: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.