How would i "sign in" in msn.
Im trying to make a program that does stuff for msn. First all i want to know is how would you sign in threw this program i am making.
Printable View
How would i "sign in" in msn.
Im trying to make a program that does stuff for msn. First all i want to know is how would you sign in threw this program i am making.
wow is it just me or are people ignoring my threads now?
I have no idea what the conventional method would be, but possibly try out some kind of sendkeys method? It is kind of a longshot, and not very reliable, so don't consider this advice unless you can't find anything else...
How would i use a sendkey?
I could give you a small tutorial on the subject, but the quality would not be half of what you could get on this forum. Search for "sendkey" or "send key" and it should bring up everything you need to know on the subject. Like I said, though, it is not the best option that you could use. In case you don't already know, Sendkey simply sends a certain sequence of keys to the active window. In this case, that should be the msn messenger. You would first send your username, then a tab, then your password, then enter. This would, theoretically log you in. The reason that this method is unreliable, though, is that if your program starts sending the keys before the messenger is fully loaded, the messenger will not recieve everything. Just a pre-warning...
Well Garrett, i'd suggest you visit the API forums on VBF :)
I'm sure we'd be glad to help you there ;)
Also have a looksy at my hwnd example project in the API FAQ thread...i used an example of grabbing msn chat text to get a windows handle by partial caption. Might show you a bit of how you interact with other applications.
:wave:
Hello
I copied this out of vb5's booksonline, hope it helps with the sendkeys idea if you want to use it.
Sends one or more keystrokes to the active window as if typed at the keyboard.
Syntax
SendKeys string[, wait]
The SendKeys statement syntax has these named arguments:
Part Description
string Required. String expression specifying the keystrokes to send.
Wait Optional. Boolean value specifying the wait mode. If False (default), control is returned to the procedure immediately after the keys are sent. If True, keystrokes must be processed before control is returned to the procedure.
Remarks
Each key is represented by one or more characters. To specify a single keyboard character, use the character itself. For example, to represent the letter A, use "A" for string. To represent more than one character, append each additional character to the one preceding it. To represent the letters A, B, and C, use "ABC" for string.
The plus sign (+), caret (^), percent sign (%), tilde (~), and parentheses ( ) have special meanings to SendKeys. To specify one of these characters, enclose it within braces ({}). For example, to specify the plus sign, use {+}. Brackets ([ ]) have no special meaning to SendKeys, but you must enclose them in braces. In other applications, brackets do have a special meaning that may be significant when dynamic data exchange (DDE) occurs. To specify brace characters, use {{} and {}}.
To specify characters that aren't displayed when you press a key, such as ENTER or TAB, and keys that represent actions rather than characters, use the codes shown below:
Key Code
BACKSPACE {BACKSPACE}, {BS}, or {BKSP}
BREAK {BREAK}
CAPS LOCK {CAPSLOCK}
DEL or DELETE {DELETE} or {DEL}
DOWN ARROW {DOWN}
END {END}
ENTER {ENTER}or ~
ESC {ESC}
HELP {HELP}
HOME {HOME}
INS or INSERT {INSERT} or {INS}
LEFT ARROW {LEFT}
NUM LOCK {NUMLOCK}
PAGE DOWN {PGDN}
PAGE UP {PGUP}
PRINT SCREEN {PRTSC}
RIGHT ARROW {RIGHT}
SCROLL LOCK {SCROLLLOCK}
TAB {TAB}
UP ARROW {UP}
F1 {F1}
F2 {F2}
F3 {F3}
F4 {F4}
F5 {F5}
F6 {F6}
F7 {F7}
F8 {F8}
F9 {F9}
F10 {F10}
F11 {F11}
F12 {F12}
F13 {F13}
F14 {F14}
F15 {F15}
F16 {F16}
To specify keys combined with any combination of the SHIFT, CTRL, and ALT keys, precede the key code with one or more of the following codes:
Key Code
SHIFT +
CTRL ^
ALT %
To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". To specify to hold down SHIFT while E is pressed, followed by C without SHIFT, use "+EC".
To specify repeating keys, use the form {key number}. You must put a space between key and number. For example, {LEFT 42} means press the LEFT ARROW key 42 times; {h 10} means press H 10 times.
Note You can't use SendKeys to send keystrokes to an application that is not designed to run in Microsoft Windows. Sendkeys also can't send the PRINT SCREEN key {PRTSC} to any application.
EG.
VB Code:
Dim ReturnValue, I ReturnValue = Shell("Calc.exe", 1) ' Run Calculator. AppActivate ReturnValue ' Activate the Calculator. For I = 1 To 100 ' Set up counting loop. SendKeys I & "{+}", True ' Send keystrokes to Calculator Next I ' to add each value of I. SendKeys "=", True ' Get grand total.
SendKeys just isn't as reliable as API calls would be in this situation, nor would they achieve all the work he wants to do ;)
Like I said before, the sendkeys is not very reliable. The best way for this would definately be to follow up on Ice 531's advice. I have not worked with API calls much, but they would far better serve your purpose here.Quote:
Originally Posted by sherminatortim