Terminal Services Administration API

  • Thread starter Thread starter Sameh Ahmed
  • Start date Start date
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
 
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
 
Back
Top