Vb 6.0: Beginner: Changing Msn Name |
|
|||||||||
Vb 6.0: Beginner: Changing Msn Name |
20 Oct 2005, 03:24 AM
Post
#1
|
|
yourforum addicted Group: Members Posts: 283 Joined: 14-October 05 From: Oxford, Michigan Member No.: 491 Zodiac Sign: Gender: |
this program will show you how to change your name in visual basic, although in older versions yo used to be able to do this without the ugly options screen flashing, it does not work any more unless the program is proxied into your account, now, to the tutorial
Step 1 for one thing when the 'New Project' dialog opens select "Standard EXE" Step 2 now, we need to add the messenger API, so go Project -> Refrences, look for Messenger API, chek the box and select OK Step 3 Now we need to add some code! double click on the grey box thing on your screen now it should look like this CODE Private Sub Form_Load() End Sub now, above that create a space by clicking before the p and pressing enter, now we will add a declaration, so th program knows when we are using the API, now it should look like this CODE Public WithEvents msn As MessengerAPI.Messenger Private Sub Form_Load() End Sub now we also need to add the declaration in the form load, so inbetween the form load and the end sub put "Set msn = New Messengerapi.Messenger", now it will look like this CODE Public WithEvents msn As MessengerAPI.Messenger Private Sub Form_Load() Set msn = New MessengerAPI.Messenger End Sub Step 4 now we will add a command button there is what you click, now you just drag your pointer on the grey box and let go, now you have a command button!! Step 5 ok, now to change the 'Caption' of the command button on the right side of your screen you will see a properties box, look for the box called captions and change it from 'Command1" to "Click Me" Step 6 now double click on the command button, and the code dialog will appear, now inside you will notice some things have changed, now it should look something like this CODE Public WithEvents msn As MessengerAPI.Messenger Private Sub Command1_Click() End Sub Private Sub Form_Load() Set msn = New MessengerAPI.Messenger End Sub now, in-between "Private Sub Command1_Click()" and "End Sub" add this code CODE msn.OptionsPages 0, MOPT_GENERAL_PAGE Pause 0.5 SendKeys "New nickname here" Pause 0.5 SendKeys "{ENTER}" SendKeys "{ENTER}" Me.Show end sub now it should look like this CODE Public WithEvents msn As MessengerAPI.Messenger Private Sub Command1_Click() msn.OptionsPages 0, MOPT_GENERAL_PAGE Pause 0.5 SendKeys "New nickname here" Pause 0.5 SendKeys "{ENTER}" SendKeys "{ENTER}" Me.Show End Sub Private Sub Form_Load() Set msn = New MessengerAPI.Messenger End Sub now for a little explanation, "msn.OptionsPages 0, MOPT_GENERAL_PAGE", loads the API, and opens the MSN options window, "Pause 0.5" we'll get to that in the next step , "SendKeys "New nickname here"" that means it is going to send those letters, to the options dialog, so that just changes the name part "SendKeys "{ENTER}"" sends enter and resets your name, the next one is just a double check "Me.Show" means it brings this form to the top of your screen Step 6 now were going to add our own sub this time so we will have to type it, now, below the last end sub were going to type "Sub Pause(interval)" and hit enter, now it should look like this CODE Public WithEvents msn As MessengerAPI.Messenger Private Sub Command1_Click() msn.OptionsPages 0, MOPT_GENERAL_PAGE Pause 0.5 SendKeys "New nickname here" Pause 0.5 SendKeys "{ENTER}" SendKeys "{ENTER}" Me.Show End Sub Private Sub Form_Load() Set msn = New MessengerAPI.Messenger End Sub Sub Pause(interval) End Sub now were going to add some code ok, now inbetween "Sub Pause(interval)" and "End Sub" were going to add CODE Current = Timer Do While Timer - Current < Val(interval) DoEvents Loop now it all should look like this CODE Public WithEvents msn As MessengerAPI.Messenger Private Sub Command1_Click() msn.OptionsPages 0, MOPT_GENERAL_PAGE Pause 0.5 SendKeys "New nickname here" Pause 0.5 SendKeys "{ENTER}" SendKeys "{ENTER}" Me.Show End Sub Private Sub Form_Load() Set msn = New MessengerAPI.Messenger End Sub Sub Pause(interval) Current = Timer Do While Timer - Current < Val(interval) DoEvents Loop now for more explaining, all that did was make it so the program waits so long before going on to the next thing, in other words it slows it down becuse the computer will do the sendkeys before the options dialog is open Step 7 not really a step but who cares, click the blue arrow button at the top and press the button
Attached File(s)
-------------------- |
|
Lo-Fi Version | Time is now: 29th March 2024 - 06:00 PM |
Skin and Graphics by Dan Ellis and Anubis. Hosting by Forums & More © 2005-2011. |