Sign in to follow this  

VB6 Starting/Restarting Messenger Service

This topic is 3371 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How would you go about Starting or Restarting the Messenger Service (NET SEND) from within VB6? Also how can you retrieve the IP address of your computer also via VB6? Thanks in advance. Spawned218.

Share this post


Link to post
Share on other sites
Have you tried using win32 api?

http://visualbasic.about.com/od/usevb6/l/aa103002a.htm
E.g. Private Declare Function GetActiveWindow Lib "user32" () As Long

I am sorry I could not find the right functions, though... :(

Share this post


Link to post
Share on other sites
The messenger service has been effectively (and thankfully) killed since XP SP2, and is not available in Vista. You will probably need to find an alternative route to what you wish to do.

As for retrieving the local IP address, I don't have VB6 installed but here's some VBScript that works here using WMI:
Function GetLocalIP()
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled=True")
For Each objItem In colItems
For Each objValue In objItem.IPAddress
GetLocalIP = objValue
Exit Function
Next
Next
End Function

MsgBox(GetLocalIP())
See here for more info.

Share this post


Link to post
Share on other sites

This topic is 3371 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this