Terminal Services Administration API

S

Sameh Ahmed

Hello there
need to user the Terminal Services Administration API in VB .NET
http://msdn.microsoft.com/library/d...termserv/terminal_services_administration.asp
the point is, in MSDN they only mention stuff for C language.
Any how to link to this API and use it in VB.NET ?
I tried to add a reference to "wtsapi32.dll" and "wtsapi32.lib" in system32
but it gives an error that you can only add reference to assemblies with the
extension "dll" or COM components.
Any ideas?
Regards
Sameh
 
E

Elena Arzac [msft]

You need to use the Declare statement:

example:
' Defines the MessageBox function.
Public Class Win32
Declare Auto Function MessageBox Lib "user32.dll"(hWnd As Integer, _
txt As String, caption As String, Type As Integer) As Integer
End Class
' Calls the MessageBox function.
Public Class DemoMessageBox
Public Shared Sub Main()
Win32.MessageBox(0, "Here's a MessageBox", "Platform Invoke Sample", 0)
End Sub
End Class


Elena Arzac
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top