| View previous topic :: View next topic |
| Author |
Message |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Aug 17, 2007 8:58 am Post subject: [vb] API SendMessage function help |
|
|
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 |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Fri Aug 17, 2007 9:03 am Post subject: |
|
|
Eh? Do you know what SendMessage does? And what are you trying to do, send those keys to the application?
_________________
|
|
| Back to top |
|
 |
O-RLY Expert Cheater
Reputation: 0
Joined: 10 Apr 2007 Posts: 170
|
Posted: Fri Aug 17, 2007 9:11 am Post subject: |
|
|
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 |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Fri Aug 17, 2007 10:53 am Post subject: |
|
|
lolol, sendmessage doesnt send a human message.
it sends a LITERAL message to the handle of a program.
_________________
|
|
| Back to top |
|
 |
Noz3001 I'm a spammer
Reputation: 26
Joined: 29 May 2006 Posts: 6220 Location: /dev/null
|
Posted: Fri Aug 17, 2007 10:56 am Post subject: |
|
|
LOL, this made me lol.
SendMessage(hWnd, "Hello Mr.Computer", 0, 0);
|
|
| Back to top |
|
 |
|