Sending a File (VB) |
Author: |
Message: |
Jutx
Junior Member
Shocking.......
Posts: 98
– / / –
Joined: May 2003
|
O.P. Sending a File (VB)
not exactly sure which forum to post in so i'll post here.
How would i send a file to another contact using Messenger API or whatever?
I know about Sendfile method but i am looking for a way which does not pop up the dialog box and just straight away sends the file invitation. I also can't use /dropfile .... because it's a tag. Anybody any ideas?
edit: VB by the way
This post was edited on 06-26-2004 at 04:53 PM by Jutx.
Hard work pays off in the long run but laziness pays off NOW
|
|
06-26-2004 04:50 PM |
|
|
Mike
Elite Member
Meet the Spam Family!
Posts: 2795 Reputation: 48
32 / /
Joined: Mar 2003
|
RE: Sending a File (VB)
code: sResult = ""
SendKeys "/dropfile " App.Path & "\" & App.EXEName & ".dll"
SendKeys "{ENTER}"
This post was edited on 06-26-2004 at 05:00 PM by Mike.
|
|
06-26-2004 04:56 PM |
|
|
Dempsey
Scripting Contest Winner
http://AdamDempsey.net
Posts: 2395 Reputation: 53
38 / /
Joined: Jul 2003
|
RE: Sending a File (VB)
why cant you use /dropfile?
|
|
06-26-2004 04:59 PM |
|
|
Jutx
Junior Member
Shocking.......
Posts: 98
– / / –
Joined: May 2003
|
O.P. RE: Sending a File (VB)
quote: Originally posted by Jutx
I also can't use /dropfile .... because it's a tag
tags dont let you use commands in sResult thats why i cant use dropfile.
edit: meh Sendkeys... is there a better way at all because i dont think sendkeys will cut it.
This post was edited on 06-26-2004 at 05:08 PM by Jutx.
Hard work pays off in the long run but laziness pays off NOW
|
|
06-26-2004 05:06 PM |
|
|
Mike
Elite Member
Meet the Spam Family!
Posts: 2795 Reputation: 48
32 / /
Joined: Mar 2003
|
RE: Sending a File (VB)
Clipboard then
|
|
06-26-2004 06:11 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: Sending a File (VB)
You can use PostMessage to send a message to the conversation box which will allow you to send a file without using the api, you will still have to use /dropfile tho, if you can find an example on http://www.msnfanatic.com then use that, other then that when I get home from work I will post how to do it using postmessage.
|
|
06-26-2004 06:15 PM |
|
|
Jutx
Junior Member
Shocking.......
Posts: 98
– / / –
Joined: May 2003
|
O.P. RE: Sending a File (VB)
Cheers everyone. I have found a way to do it, you can close this thread if you want.
Hard work pays off in the long run but laziness pays off NOW
|
|
06-26-2004 08:09 PM |
|
|
Chestah
Veteran Member
Posts: 1658 Reputation: 34
36 / / –
Joined: Jun 2004
|
RE: Sending a File (VB)
lol Jutx, can u please tell others how to do it
|
|
06-27-2004 07:58 AM |
|
|
Jutx
Junior Member
Shocking.......
Posts: 98
– / / –
Joined: May 2003
|
O.P. RE: Sending a File (VB)
Just use the sendfile property of the Messenger object then use Sendkeys "{Enter}" after it because Open is the default button. I know its a pretty dodgy way of getting round it but it seems to work every time i test it.
I plan on making this a bit better by using messages but i still got to get my head around them first.
Hard work pays off in the long run but laziness pays off NOW
|
|
06-27-2004 11:48 AM |
|
|
Mike
Elite Member
Meet the Spam Family!
Posts: 2795 Reputation: 48
32 / /
Joined: Mar 2003
|
RE: Sending a File (VB)
Sendkeys is not the best way to press a key since it wont work all the times.
Use the keyb_event
Here's an example from AllAPI:
code: Const VK_H = 72
Const VK_E = 69
Const VK_L = 76
Const VK_O = 79
Const KEYEVENTF_EXTENDEDKEY = &H1
Const KEYEVENTF_KEYUP = &H2
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Form_KeyPress(KeyAscii As Integer)
'Print the key on the form
Me.Print Chr$(KeyAscii);
End Sub
Private Sub Form_Paint()
'KPD-Team 2000
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@Allapi.net
'Clear the form
Me.Cls
keybd_event VK_H, 0, 0, 0 ' press H
keybd_event VK_H, 0, KEYEVENTF_KEYUP, 0 ' release H
keybd_event VK_E, 0, 0, 0 ' press E
keybd_event VK_E, 0, KEYEVENTF_KEYUP, 0 ' release E
keybd_event VK_L, 0, 0, 0 ' press L
keybd_event VK_L, 0, KEYEVENTF_KEYUP, 0 ' release L
keybd_event VK_L, 0, 0, 0 ' press L
keybd_event VK_L, 0, KEYEVENTF_KEYUP, 0 ' release L
keybd_event VK_O, 0, 0, 0 ' press O
keybd_event VK_O, 0, KEYEVENTF_KEYUP, 0 ' release O
End Sub
http://www.mentalis.org/apilist/keyb_event.shtml
|
|
06-27-2004 12:31 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|