Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "Service" in [All]

wininet

.

        uint nService,

.

    private const uint INTERNET_SERVICE_FTP = 1;

.

                    INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);

.

    * Returns a valid handle to the FTP, Gopher, or HTTP session if the connection is successful, or NULL otherwise. To get extended error information, call GetLastError. An application can also use InternetGetLastResponseInfo to determine why access to the service was denied.

.

   string lpszUsername, string lpszPassword, int dwService,

.

    ByVal lService As Int32,

.

    Number of the TCP/IP port on the server to connect to. Can be one of the values in the following list. If this parameter is set to INTERNET_INVALID_PORT_NUMBER, the function uses the default port for the specified service. These values do not cause the function to use this protocol. The value sets the port to be used. A flag must be used to set the service.

.

dwService

.

    Type of service to access. Can be one of these values:

.

    INTERNET_SERVICE_FTP     FTP service.

.

    INTERNET_SERVICE_GOPHER     Gopher service.

.

    INTERNET_SERVICE_HTTP     HTTP service.

.

    Flags specific to the service used. Can be one of these values:

.

    If dwService is:     dwFlags supported

.

    INTERNET_SERVICE_FTP     INTERNET_CONNECT_FLAG_PASSIVE (Use passive mode in all data connections for this FTP session.)

.

The InternetConnect function is required before communicating with any Internet service.

.

[System.Runtime.InteropServices.DllImport("Wininet.dll")]

.

///     <br />Note WinINet does not support server implementations. In addition, it should not be used from a service. For

.

///     server implementations or services use Microsoft Windows HTTP Services (WinHTTP).

.

using System.Runtime.InteropServices;

.

    <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)> Boolean

.

    <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)> Boolean

.

    'sBuffer = System.Runtime.InteropServices.Marshal.AllocHGlobal(dwBufferLength)

.

        MsgBox("1st Party: There was an error: Code " & CStr(System.Runtime.InteropServices.Marshal.GetLastWin32Error()))

.

        MsgBox("There was an error: Code " & CStr(System.Runtime.InteropServices.Marshal.GetLastWin32Error()))

powrprof

.

    using System.Runtime.InteropServices;

winmm

.

   using System.Runtime.InteropServices;

.

<Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential, CharSet:=Runtime.InteropServices.CharSet.Auto)> _

.

     <System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=32)> _

.

[System.Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential, CharSet = System.Runtime.InteropServices.CharSet.Auto)]

.

     [MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst = 32)]

.

         waveOutGetDevCaps(i, wc, System.Runtime.InteropServices.Marshal.SizeOf(wc))  

.

using System.Runtime.InteropServices;

icmp

.

    using System.Runtime.InteropServices;

Interfaces

14: +
.

var obj = System.Runtime.InteropServices.Marshal.BindToMoniker("IIS://localhost/W3SVC") as IADs;

.

Required referenece to System, System.Security, System.Runtime.InteropServices, System.Reflection Namespaces.

.

using System.Runtime.InteropServices;

.

using System.Runtime.CompilerServices;

.

using System.Runtime.InteropServices;

.

Imports System.Runtime.InteropServices

.

Also available in System.Runtime.InteropServices.ComTypes

.

Imports System.Runtime.InteropServices

.

        'to allows this explorer objects also implement IServiceProvider interface

.

        '(don't mix it with System.IServiceProvider!)

.

        Dim sp As _IServiceProvider = TryCast(BandObjectSite, _IServiceProvider)

.

        sp.QueryService(guid, riid, w)

.

        'as a Desk Band. There is no web browser service available.

.

    Imports System.Runtime.InteropServices

.

Imports System.Runtime.InteropServices

.

Public Interface _IServiceProvider

.

    Sub QueryService(ByRef guid As Guid, ByRef riid As Guid, <MarshalAs(UnmanagedType.[Interface])> ByRef Obj As [Object])

.

Imports System.Runtime.InteropServices

.

Imports System.Runtime.InteropServices

.

        'to allows this explorer objects also implement IServiceProvider interface

.

        '(don't mix it with System.IServiceProvider!)

.

        Dim sp As _IServiceProvider = TryCast(BandObjectSite, _IServiceProvider)

.

        sp.QueryService(guid, riid, w)

.

        'as a Desk Band. There is no web browser service available.

.

Imports System.Runtime.InteropServices

.

Imports System.Runtime.InteropServices

.

Public Interface _IServiceProvider

.

    Sub QueryService(ByRef guid As Guid, ByRef riid As Guid, <MarshalAs(UnmanagedType.[Interface])> ByRef Obj As [Object])

.

Imports System.Runtime.InteropServices

.

    using IDataObject_Com = System.Runtime.InteropServices.ComTypes.IDataObject;

.

    'Code converted from C# to VB by online service at Telerik (www.telerik.com)

.

     public System.Runtime.InteropServices.ComTypes.FILETIME mtime;

.

     public System.Runtime.InteropServices.ComTypes.FILETIME ctime;

.

     public System.Runtime.InteropServices.ComTypes.FILETIME atime;

.
Summary
Part of the Task Scheduler 1.0 Interfaces, which consists of IEnumWorkItems, ITask, ITaskScheduler, ITaskTrigger and IScheduledWorkItem. There is some helper code below for actually using the iterator as the marshalling seemed impossible without resorting to the unmanaged helper functions in System.Runtime.InteropServices.Marshal. Not all methods have been tested, so be careful!
.

    using System.Runtime.InteropServices;

.

    [System.Runtime.InteropServices.InterfaceType(1)]

.

    [System.Runtime.InteropServices.Guid("3127CA40-446E-11CE-8135-00AA004BB851")]

.

        void AddError(string pszPropName, ref System.Runtime.InteropServices.ComTypes.EXCEPINFO pExcepInfo);

.

using System.Runtime.InteropServices;

.

  public interface IServiceProvider

.

    void QueryService(ref Guid guidService, ref Guid riid,

.

      IEZoneSecurity.IServiceProvider serviceProvider = null;

.

      object topServiceProviderObj = null;

.

      IServiceProvider topServiceProvider = null;

.

    // Get the client site service provider.

.

    serviceProvider = oleClientSiteObj as IEZoneSecurity.IServiceProvider;

.

    // Get top level browser service provider.

.

    Guid Riid = typeof(IEZoneSecurity.IServiceProvider).GUID;

.

    topServiceProviderObj = null;

.

    serviceProvider.QueryService(ref IID_TopLevelBrowser, ref Riid,

.

                     out topServiceProviderObj);

.

    topServiceProvider = topServiceProviderObj as IServiceProvider;

.

    topServiceProvider.QueryService(ref IID_WebBrowserApp, ref Riid,

.

    if (topServiceProvider != null)

.

      Marshal.ReleaseComObject(topServiceProvider);

.

    if (topServiceProviderObj != null)

.

      Marshal.ReleaseComObject(topServiceProviderObj);

.

    if (serviceProvider!= null)

.

      Marshal.ReleaseComObject(serviceProvider);

.

    using System.Runtime.InteropServices;

.

    Imports System.Runtime.InteropServices

.

    void Stat(out System.Runtime.InteropServices.STATSTG pstatstg, int grfStatFlag);

.

    void Stat(out System.Runtime.InteropServices.STATSTG pstatstg, int grfStatFlag);

.

<Runtime.InteropServices.ComImport()> _

.

<Runtime.InteropServices.InterfaceType(Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)> _

.

<Runtime.InteropServices.Guid("00000002-0000-0000-C000-000000000046")> _

.

    <Runtime.InteropServices.PreserveSig()> Function Alloc(ByVal cb As UInt32) As IntPtr

.

    <Runtime.InteropServices.PreserveSig()> Function Realloc(ByVal pv As IntPtr, ByVal cb As UInt32) As IntPtr

.

    <Runtime.InteropServices.PreserveSig()> Sub Free(ByVal pv As IntPtr)

.

    <Runtime.InteropServices.PreserveSig()> Function GetSize(ByVal pv As IntPtr) As UInt32

.

    <Runtime.InteropServices.PreserveSig()> Function DidAlloc(ByVal pv As IntPtr) As Int16

.

    <Runtime.InteropServices.PreserveSig()> Sub HeapMinimize()

.

Also it works much faster than Managed Reflection Services.

.

of course we can do it with standard Managed Reflection services:

.

Also it works much faster than Managed Reflection Services.

.

using System.Runtime.InteropServices;

.

Requires reference to System.Runtime.InteropServices.

.

using System.Runtime.InteropServices;

.

      Sub GetWindow(<System.Runtime.InteropServices.Out()> ByRef phwnd As IntPtr)

.
Note
.Net2 now includes this definition in System.Runtime.InteropServices.Comtypes namespace, but doesn't include return values for the methods
.
Summary
The IServiceProvider interface is a generic access mechanism to locate a globally unique identifier (GUID) identified service
.

    interface IServiceProvider {

.

    void QueryService(ref Guid guidService, ref Guid riid,

.

Interface IServiceProvider

.

    Sub QueryService(ByRef guidService As Guid, ByRef riid As Guid,

.

The IServiceProvider defined here is different with "System.IServiceProvider". To remove name collisition, rename "IServiceProvider" to other name such as "UCOMIServiceProvider". Otherwise, you should use fully qualified namespace to the interface since you will normally use "using System" directive.

.

The QueryService above does not work for me: ppvObject is always marshalled as IUnknown, as documented in the .Net API docs. I use the following:

.

    interface IServiceProvider {

.

    void QueryService(ref Guid guidService, ref Guid riid,

.
Documentation
[IServiceProvider] on MSDN
.

[System.Runtime.InteropServices.ComTypes.IStream] in the .NET Framework 2.0.

.

    using System.Runtime.InteropServices;

.

The ITfLangBarMgr interface is implemented by the TSF manager and used by text services to manage event sink notification and configure floating language bar display settings. The interface ID is IID_ITfLangBarMgr.

.

    public interface IServiceProvider

.

    int QueryService(

.

        [In] ref Guid guidService,

.

        //QI for serviceprovider

.

        IServiceProvider psp = axWebBrowser as IServiceProvider;

.

        //QueryService for ITravelLogStg

.

        int hr = psp.QueryService(ref SID_STravelLogCursor, ref IID_ITravelLogStg, out oret);

.

Required referenece to System, System.Security, System.Runtime.InteropServices, System.Reflection Namespaces

.

Required referenece to System, System.Security, System.Runtime.InteropServices, System.Reflection Namespaces

.

Populate pszTitle, pszDocString and pszHelpFile using System.Runtime.InteropServices.Marshal.StringToCoTaskMemUni(string).

.

[System.Runtime.InteropServices.STATSTG], or [System.Runtime.InteropServices.ComTypes.STATSTG] in the .NET Framework 2.0.

psapi

.

using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

oleaut32

.

Declare Unicode Function LoadTypeLib Lib "oleaut32.dll" (ByVal szFile As String, ByRef TPpTypeLib As System.Runtime.InteropServices.ComTypes.ITypeLib) As Integer

.

In VB.Net you can substitute [System.Runtime.InteropServices.ComTypes.ITypeLib2] or [System.Runtime.InteropServices.UCOMITypeLib] for [System.Runtime.InteropServices.ComTypes.ITypeLib], defined in mscorlib.dll.

.

Note that in v2.0 (Whidbey) of the .NET Framework, the System.Runtime.InteropServices.UCOMITypeLib interface has been deprecated in favor of System.Runtime.InteropServices.ComTypes.ITypeLib.

.

Declare Unicode Function RegisterTypeLib Lib "oleaut32.dll" (ByVal ptlib As System.Runtime.InteropServices.ComTypes.ITypeLib, ByVal szFullPath As String, ByVal szHelpDir As String) As Integer

.

For the ITypeLib parameter in C#, you can use [System.Runtime.InteropServices.UCOMITypeLib], already defined in mscorlib.dll. Note that in v2.0 (Whidbey) of the .NET Framework, this interface has been deprecated in favor of System.Runtime.InteropServices.ComTypes.ITypeLib.

.

In VB.Net you can substitute [System.Runtime.InteropServices.ComTypes.ITypeLib2] or [System.Runtime.InteropServices.UCOMITypeLib] for [System.Runtime.InteropServices.ComTypes.ITypeLib], defined in mscorlib.dll.

.

System.Runtime.InteropServices.Marshal.FreeBSTR

.

http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.marshal.freebstr.aspx

.

Declare Unicode Function UnRegisterTypeLib Lib "oleaut32.dll" (ByRef LibID As System.Guid, ByVal nVerMajor As Short, ByVal nVerMinor As Short, ByVal lCID As Integer, ByVal tSysKind As System.Runtime.InteropServices.ComTypes.SYSKIND) As Integer

.

In VB.Net you can substitute [System.Runtime.InteropServices.SYSKIND] for [System.Runtime.InteropServices.ComTypes.SYSKIND], defined in mscorlib.dll.

.

Note that in v2.0 (Whidbey) of the .NET Framework, the System.Runtime.InteropServices.SYSKIND interface has been deprecated in favor of System.Runtime.InteropServices.ComTypes.SYSKIND.

wtsapi32

.

static extern TODO TerminalServices(TODO);

.

Declare Function TerminalServices Lib "wtsapi32.dll" (TODO) As TODO

.
Documentation
[TerminalServices] on MSDN
.
Summary
The WTSDisconnectSession function disconnects the logged-on user from the specified Terminal Services session without closing the session. If the user subsequently logs on to the same terminal server, the user is reconnected to the same session.
.

        Throw New Exception(ex.Message & vbCrLf & System.Runtime.InteropServices.Marshal.GetLastWin32Error)

.
Summary
This Terminal Services API call lists all local and remote sessions for a given server, including their state (e.g. connected, disconnected) and type (local, RDP). It is the basis for the output of qwinsta.exe.
.

using System.Runtime.InteropServices;

.

namespace TerminalServices

.

using System.Runtime.InteropServices;

.

$datasize = [system.runtime.interopservices.marshal]::SizeOf([System.Type][mystruct.WTS_SESSION_INFO])

.

     $element =  [system.runtime.interopservices.marshal]::PtrToStructure($ppSessionInfo + ($datasize * $i),[System.type][mystruct.WTS_SESSION_INFO])

.

Imports System.Runtime.InteropServices

.

        Throw New Exception(ex.Message & vbCrLf & System.Runtime.InteropServices.Marshal.GetLastWin32Error)

.
Summary
The WTSFreeMemory function frees memory allocated by a Terminal Services function.
.

The WTSFreeMemory function frees memory allocated by a Terminal Services function.

.

        Throw New Exception(ex.Message & vbCrLf & System.Runtime.InteropServices.Marshal.GetLastWin32Error)

.

/// <param name="sessionId">A Terminal Services session identifier. To indicate the session in which the calling application is running

.

    using System.Runtime.InteropServices;

.

    /// <param name="sessionId">A Terminal Services session identifier. To indicate the session in which the calling application is running

.

            /// Terminal Services session currently attached to the physical console.

.

            /// <remarks>It is not necessary that Terminal Services be running for this function to succeed.</remarks>

.

            /// The WTSFreeMemory function frees memory allocated by a Terminal Services function.

.
Summary
Retrieve the primary access token for the user associated with the specified session ID. The caller must be running in the context of the LocalSystem account and have the SE_TCB_NAME privilege. Only highly trusted service should use this function. The application must not leak tokens, and close the token when it has finished using it.
.
Summary
The WTSSendMessage function displays a message box on the client desktop of a specified Terminal Services session.
.

    String msg = "Terminal Service!";

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: