Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[vb] API SendMessage function help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
O-RLY
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 170

PostPosted: Fri Aug 17, 2007 8:58 am    Post subject: [vb] API SendMessage function help Reply with quote

How do I use that function?
I wanna send this:

message: die noob
target: "C:\Program Files\Windows NT\Pinball\PINBALL.EXE"

And btw, can its be done with %systemroot% instead of C drive?
Becasue some of the people got their operation system on D \ E...
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Fri Aug 17, 2007 9:03 am    Post subject: Reply with quote

Eh? Do you know what SendMessage does? And what are you trying to do, send those keys to the application?
_________________
Back to top
View user's profile Send private message
O-RLY
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 170

PostPosted: Fri Aug 17, 2007 9:11 am    Post subject: Reply with quote

Well.. I dont really know lol.
Yea, I trying to send those words to the application, and someone told me that I need to use SendMessage.
I've also got this code from API Guide:

Code:
'This project needs a ListBox, named List1 and a TextBox, named Text1
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Const LB_FINDSTRING = &H18F
Private Sub Form_Load()
    'Add some items to the listbox
    With List1
        .AddItem "Computer"
        .AddItem "Screen"
        .AddItem "Modem"
        .AddItem "Printer"
        .AddItem "Scanner"
        .AddItem "Sound Blaster"
        .AddItem "Keyboard"
        .AddItem "CD-Rom"
        .AddItem "Mouse"
    End With
End Sub
Private Sub Text1_Change()
    'Retrieve the item's listindex
    List1.ListIndex = SendMessage(List1.hwnd, LB_FINDSTRING, -1, ByVal CStr(Text1.Text))
End Sub


I guess the ListBox has the messages which I want to be sent.
But how I choose the target?

If you could explain me a lil better cause I new with API functions, and also new with VB.
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Fri Aug 17, 2007 10:53 am    Post subject: Reply with quote

lolol, sendmessage doesnt send a human message.

it sends a LITERAL message to the handle of a program.

_________________
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Fri Aug 17, 2007 10:56 am    Post subject: Reply with quote

LOL, this made me lol.

SendMessage(hWnd, "Hello Mr.Computer", 0, 0);
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites