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 "system" in [All]

dmcl40

.

    return System.Runtime.Interop.Marshal.PtrToStringAnsi( res );

credui

.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters")]

.

    <System.Runtime.InteropServices.DllImport("credui.dll", EntryPoint:="CredUIPromptForWindowsCredentials", CharSet:=CharSet.Unicode)> <CLSCompliant(False)> _

.

      /// The credential provider should align the credential BLOB pointed to by the refOutAuthBuffer parameter to a 32-bit boundary, even if the provider is running on a 64-bit system.

icmp

.

    using System;

.

    using System.Net;

.

    using System.Runtime.InteropServices;

.

tcc -Wall ping.c /WINDOWS/system32/iphlpapi.dll /windows/system32/ws2_32.dll

ws2_32

.

System.Net.Sockets.Socket.Accept()

.

   <System.Runtime.InteropServices.DllImport("ws2_32.dll", CharSet:=System.Runtime.InteropServices.CharSet.Ansi, SetLastError:=True)>

7: send
.

System.Net.Sockets.Socket (class) Socket.SendTo () - better to use It))

.

System.Net.Sockets.Socket (class) Socket.SendTo () - better to use It))

.

    public String systemStatus;

.

    internal string szSystemStatus;

.

        IntPtr s, System.Net.Sockets.IOControlCode dwIoControlCode,

.

                System.Diagnostics.Debug.WriteLine(qs.szServiceInstanceName);

.

        System.Net.Sockets.AddressFamily.InterNetwork,

mqrt

.

MQGetQueueSecurity and MQSetQueueSecurity don't have a managed equivalent in the System.Messaging namespace. If you need to read or change the ACL on a queue to, for example, change the queue owner, you need to use P/Invoke to mqrt.dll.

.

MQGetQueueSecurity and MQSetQueueSecurity don't have a managed equivalent in the System.Messaging namespace. If you need to read or change the ACL on a queue to, for example, change the queue owner, you need to use P/Invoke to mqrt.dll.

.

System.Messaging.MessageQueue.SetPermissions

dnsapi

.

   using System;

.

    using System.Collections.Generic;

.

    using System.ComponentModel;

.

    using System.Linq;

.

    using System.Net;

.

    using System.Net.Sockets;

.

    using System.Runtime.InteropServices;

.

    using System.Text;

.

    using System.Threading;

.

    using System.Threading.Tasks;

.

   using System;

.

    using System.Collections.Generic;

.

    using System.ComponentModel;

.

    using System.Linq;

.

    using System.Net;

.

    using System.Net.Sockets;

.

    using System.Runtime.InteropServices;

.

    using System.Text;

.

    using System.Threading;

.

    using System.Threading.Tasks;

powrprof

.

  IntPtr status = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(SYSTEM_BATTERY_STATE)));

.

    5,  // SystemBatteryState

.

    (UInt32)Marshal.SizeOf(typeof(SYSTEM_BATTERY_STATE))

.

  SYSTEM_BATTERY_STATE batt_status = (SYSTEM_BATTERY_STATE)Marshal.PtrToStructure(status, typeof(SYSTEM_BATTERY_STATE));

.
Summary
Enumerates devices on the system that meet the specified criteria.
.

EnumPwrSchemes is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Applications written for Windows Vista and later should use PowerEnumerate instead.

.
Summary
Retrieves the current system power policy settings, works on both XP and Vista
.
Summary
Retrieves information about the system power capabilities.
.

static extern bool GetPwrCapabilities(out SYSTEM_POWER_CAPABILITIES systemPowerCapabilites);

.

SYSTEM_POWER_CAPABILITIES

.

    static extern bool GetPwrCapabilities(out SYSTEM_POWER_CAPABILITIES systemPowerCapabilites);

.

    static SYSTEM_POWER_CAPABILITIES systemPowerCapabilites;

.

        GetPwrCapabilities(out SYSTEM_POWER_CAPABILITIES);

.

    /// Check out if there is a power botton present in the system.

.

        return systemPowerCapabilites.PowerButtonPresent;

.

    /// Check out if there is a sleep botton present in the system.

.

        return systemPowerCapabilites.SleepButtonPresent;

.

// now we have a list of identifiers for all the power schemes on the system,

.

    private const int PBT_APMRESUMEAUTOMATIC = 18; // (0x12) - Operation is resuming automatically from a low-power state.This message is sent every time the system resumes.

.

    private const int PBT_APMSUSPEND = 4; // (0x4) - System is suspending operation.

.

            Console.WriteLine("\tOperation is resuming automatically from a low-power state.This message is sent every time the system resumes.");

.

            Console.WriteLine("\tSystem is suspending operation.");

.

        uint BufferSize = (uint)System.Text.ASCIIEncoding.Unicode.GetByteCount(name);

.

        /// The device supports system power state D0.

.

        /// The device supports system power state D1.

.

        /// The device supports system power state D2.

.

        /// The device supports system power state D3.

.

        /// The device supports system sleep state S0.

.

        /// The device supports system sleep state S1.

.

        /// The device supports system sleep state S2.

.

        /// The device supports system sleep state S3.

.

        /// The device supports system sleep state S4.

.

        /// The device supports system sleep state S5.

.

        /// The device supports waking from system power state D0.

.

        /// The device supports waking from system power state D1.

.

        /// The device supports waking from system power state D2.

.

        /// The device supports waking from system power state D3.

.

        /// The device supports waking from system sleep state S0.

.

        /// The device supports waking from system sleep state S1.

.

        /// The device supports waking from system sleep state S2.

.

        /// The device supports waking from system sleep state S3.

.

        /// Ignore devices not currently present in the system.

.

        /// Check whether the device is currently enabled to wake the system from a sleep state.

.

If hibernate = true, the system hibernates.

.

If hibernate = false, the system enters a standby state.

.

    using System.Runtime.InteropServices;

.

            /// Suspends the system by shutting power down. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4).

.

            /// <param name="hibernate">If this parameter is TRUE, the system hibernates. If the parameter is FALSE, the system is suspended.</param>

.

            /// the system suspends operation immediately; if it is FALSE, the system broadcasts a PBT_APMQUERYSUSPEND event to each

.

            /// <param name="disableWakeEvent">If this parameter is TRUE, the system disables all wake events. If the parameter is FALSE, any system wake events remain enabled.</param>

.

        Inherits System.Windows.Forms.Form

.

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

.

Public Shared Function SetSuspendState(ByVal state As System.Windows.Forms.PowerState, ByVal force As Boolean, ByVal disableWakeEvent As Boolean) As Boolean

.

     Member of System.Windows.Forms.Application

.

Suspends or hibernates the system, or requests that the system be suspended or hibernated.

.

state: A System.Windows.Forms.PowerState indicating the power activity mode to which to transition.

.

disableWakeEvent: true to disable restoring the system's power status to active on a wake event, false to enable restoring the system's power status to active on a wake event.

.

true if the system is being suspended, otherwise, false.

mapi32

.
Summary
MAPILogoff - The MAPILogoff function ends a session with the messaging system.
.

/// The MAPILogoff function ends a session with the messaging system.

.

''' The MAPILogoff function ends a session with the messaging system.

.

Microsoft Important Note: MAPI32 is not supported in a managed environment, memory leaks may be seen. Use the current alternatives: System.Net.Mail or WebDav or Exhange 2007 webservice interface.

.

  <Runtime.InteropServices.DllImport("MAPI32.DLL", CharSet:=System.Runtime.InteropServices.CharSet.Ansi)> _

.
Caution
I'm finding that calling this function sets your Current Working Directory to something other than what it was before the call is made. In my case, it was setting it to @"C:\Program Files\Common Files\SYSTEM\MSMAPI\1033"
.

string currentDirectory = System.IO.Directory.GetCurrentDirectory();

.

System.IO.Directory.SetCurrentDirectory (currentDirectory);

.

        throw new System.InvalidOperationException();

wlanapi

.
Summary
Enumerates all of the wireless NICs currently plugged into the system.

iphlpapi

.

using System.Runtime.InteropServices;

.

using System.Net;

.

using System.Net.Sockets;

.

        System.Net.IPAddress IPAdd = System.Net.IPAddress.Parse(IPAddress);

.

        System.Net.IPAddress SubNet = System.Net.IPAddress.Parse(SubnetMask);

.

static extern int EnableRouter(IntPtr pHandle, ref System.Threading.NativeOverlapped pOverlapped);

.

Some, but not, all the information provided by the P/Invoke are available from the managed System.Net.NetworkInformation.NetworkInterface (http://msdn.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.aspx) class.

.

        IF_TYPE_IBM370PARCHAN = 72,  // IBM System 360/370 OEMI Channel

.

        IF_TYPE_ESCON = 73,  // IBM Enterprise Systems Connection

.

        [System.Runtime.InteropServices.MarshalAs(UnmanagedType.LPWStr)]

.

        [System.Runtime.InteropServices.MarshalAs(UnmanagedType.LPWStr)]

.

When you do not need the PID information look at: IPGlobalProperties.GetActiveTcpListeners Method from the System.Net.NetworkInformation namespace

.

(Msdn: http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ipglobalproperties.getactivetcplisteners.aspx)

.

public const int AF_INET = 2;    // IP_v4 = System.Net.Sockets.AddressFamily.InterNetwork

.

public const int AF_INET6 = 23;  // IP_v6 = System.Net.Sockets.AddressFamily.InterNetworkV6

.

  using System;

.

  using System.Runtime.InteropServices;

.

  using System.Collections;

.

  using System.Collections.Generic;

.

  using System.Linq;

.

      public const int AF_INET = 2;    // IP_v4 = System.Net.Sockets.AddressFamily.InterNetwork

.

      public const int AF_INET6 = 23;  // IP_v6 = System.Net.Sockets.AddressFamily.InterNetworkV6

.

      Add-Member -InputObject $objOutput -MemberType NoteProperty -Name "LocalAddress" -Value ([System.Net.IPAddress]::new($y[$i].localAddr).IPAddressToString)

.

      Add-Member -InputObject $objOutput -MemberType NoteProperty -Name "RemoteAddress" -Value ([System.Net.IPAddress]::new($y[$i].remoteAddr).IPAddressToString)

.

    /// Get the information about the current Network adapter in the system

.

System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()

.

  System.Net.Dns.GetHostAddresses()

.

  foreach (System.Net.IPAddress strIP in System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName()))

.

    throw new System.ComponentModel.Win32Exception( r );

.

    using System;

.

    using System.Runtime.InteropServices;

.

    using System.ComponentModel;

.

    using System.Net;

.

Use [System.Net.NetworkInformation.IPGlobalProperties].GetIPGlobalProperties().

.

    using System;

.

    using System.Collections.Generic;

.

    using System.Net;

.

    using System.Runtime.InteropServices;

.

        System.Windows.Forms.Application.Run();

.

    using System;

.

    using System.Collections.Generic;

.

    using System.Net;

.

    using System.Runtime.InteropServices;

.

        System.Windows.Forms.Application.Run();

.

    using System;

.

    using System.Collections.Generic;

.

    using System.Net;

.

    using System.Runtime.InteropServices;

.

        System.Windows.Forms.Application.Run();

.

The DestIP and SrcIP arguments should be UInt32 to avoid System.OverflowException when the last nibble of the IP-address is .128 or greater.

.

// This API is now obsolete. --> http://msdn.microsoft.com/en-us/library/system.net.ipaddress.address.aspx

.

static extern int UnenableRouter(ref System.Threading.NativeOverlapped pOverlapped, IntPtr lpdwEnableCount);

shlwapi

.

/// <exception cref="System.IO.FileNotFoundException">Unknown files extension</exception>

.

''' <exception cref="System.IO.FileNotFoundException">Unknown files extension</exception>

.

  using System;

.

  using System.Drawing;

.

  using System.Runtime.InteropServices;

.

    static public System.Drawing.Color HLSToColor(int H,int L,int S)

.

      // Convert Hue, Luminance, and Saturation values to System.Drawing.Color structure.

.

      // ColorHLSToRGB returns a Win32 RGB value (0x00BBGGRR).  To convert to System.Drawing.Color

.

  using System;

.

  using System.Drawing;

.

  using System.Runtime.InteropServices;

.

    //Convert System.Drawing.Color structure to HLS.

.

    static public void ColorToHLS(System.Drawing.Color C,ref int H,ref int L,ref int S)

.
Summary
This interface describes the API implemented by preview handlers. When a handler for a given file type is installed on a system, the shell or custom apps can use it to display the contents of these files in their window. Preview handlers usually do not allow in-place editing and may not display all the information contained in the file (for example, macros inside Office documents are ignored by their preview handlers)
.

[System.Runtime.InteropServices.ComImport]

.

You can use this interface to leverage previewers already installed on a system to display a document preview in a Windows Forms app.

51: IsOS
.
Summary
Checks for specified operating systems and operating system features.
.

     /// Equivalent to PlatformID.Win32Windows. Note that none of those systems

.

     /// systems.

.

     /// GetSystemMetrics(SM_REMOTESESSION).

.

     /// successors. Equivalent to GetSystemMetrics(SM_MEDIACENTER).

.

static extern IntPtr PathAddBackslash([MarshalAs(UnmanagedType.LPTStr)]System.Text.StringBuilder lpszPath);

.

Public Function PathAddBackslash(<MarshalAs(UnmanagedType.LPTStr)>lpszPath As System.Text.StringBuilder) As IntPtr

.

Public Function PathAppend(<MarshalAs(UnmanagedType.LPTStr)>pszPath As System.Text.StringBuilder, _

.

static extern string PathBuildRoot([MarshalAs(UnmanagedType.LPTStr)]szRoot As System.Text.StringBuilder,

.

Public Function PathBuildRoot(<MarshalAs(UnmanagedType.LPTStr)>szRoot As System.Text.StringBuilder, _

.

Declare Unicode Function PathCombine Lib "shlwapi.dll" Alias "PathCombineW" (<MarshalAs(UnmanagedType.LPTStr)> PathOut As System.Text.StringBuilder, <MarshalAs(UnmanagedType.LPTStr)> PathIn As String, <MarshalAs(UnmanagedType.LPTStr)> More As String) As IntPtr

.

                      <MarshalAs(UnmanagedType.LPTStr)> pszOut As System.Text.StringBuilder,

.

using System;

.

using System.Runtime.InteropServices;

.

using System.Text;

.

System.Windows.Forms.TextRenderer.MeasureText(String, Font, Size, TextFormatFlags.ModifyString | TextFormatFlags.PathEllipsis);

.

                      <MarshalAs(UnmanagedType.LPTStr)> pszOut As System.Text.StringBuilder,

.

using System;

.

using System.Runtime.InteropServices;

.

using System.Text;

.

System.Windows.Forms.TextRenderer.MeasureText(String, Font, Size, TextFormatFlags.ModifyString | TextFormatFlags.PathEllipsis);

.

     ByVal path As System.Text.StringBuilder, _

.

     ByRef pathLength As System.UInt32, _

.

    Dim myResult As String = (new System.Uri(myUri)).LocalPath 'returns "C:\Temp\foo.txt"

.

    Private Sub pathFromUrlButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles pathFromUrlButton.Click

.

      Dim sz As System.UInt32

.

      Dim sb As System.Text.StringBuilder

.

      sb = New System.Text.StringBuilder(INTERNET_MAX_URL_LENGTH)

.
Summary
PathFileExists - Determines whether a path to a file system object such as a file or directory is valid
.

/// Determines whether a path to a file system object such as a file or directory is valid.

.

''' Determines whether a path to a file system object such as a file or directory is valid.

.

static extern System.Text.StringBuilder PathGetArgs([MarshalAs(UnmanagedType.LPTStr)]string pszPath);

.

Public Function PathGetArgs(<MarshalAs(UnmanagedType.LPTStr)>pszPath As String) As <MarshalAs(UnmanagedType.LPTStr)> System.Text.StringBuilder

.

Dim args As New System.Text.StringBuilder(255)

.

System.Diagnostics.Debug.WriteLine(args.ToString())

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


 
Access PInvoke.net directly from VS: