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 );

wininet

.

    Dim s As New System.Text.StringBuilder

.

    ByVal hInternetSession As System.IntPtr,

.

    ByVal lContext As System.IntPtr) As System.IntPtr

.

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

.

///     Retrieves the connected state of the local system.

.

///         Local system has a valid connection to the Internet, but it might or might not be currently

.

///         <description>Local system uses a local area network to connect to the Internet.</description>

.

///         <description>Local system uses a modem to connect to the Internet.</description>

.

///         <description>Local system is in offline mode.</description>

.

///         <description>Local system uses a proxy server to connect to the Internet.</description>

.

///         <description>Local system has RAS installed.</description>

.

using System;

.

using System.Runtime.InteropServices;

.

Try NetworkInterface.GetIsNetworkAvailable() in the the System.Net.NetworkInformation namespace. It returns true when a network is available and false otherwise. See also: http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.networkinterface.getisnetworkavailable(VS.80).aspx. NOTE: this is all new in .NET 2.0!

.

static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref System.UInt32 pcchCookieData, int dwFlags, IntPtr lpReserved);

.

    ByVal pchCookieData As System.Text.StringBuilder, ByRef pcchCookieData As Integer, ByVal flags As Integer, ByVal reserved As Integer) As _

.

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

.

    static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref System.UInt32 pcchCookieData, int dwFlags, IntPtr lpReserved);

.

static extern bool InternetGetCookieEx(string pchURL, string pchCookieName, StringBuilder pchCookieData, ref System.UInt32 pcchCookieData, int dwFlags, IntPtr lpReserved);

.

    ByVal pchCookieData As System.Text.StringBuilder, ByRef pcchCookieData As Integer, ByVal flags As Integer, ByVal reserved As Integer) As _

.

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

.

     System.Object nullObject = 0;

.

     System.Object nullObjStr = strTemp;

.

Above signature is not working for x64 systems. See INTERNET_CACHE_ENTRY_INFO for a version that works on both x86 and x64.

.

    Private Sub cmdGetPolicy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetPolicy.Click

.

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

.

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

.

    Private Sub cmdSetPolicy_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSetPolicy.Click

.

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

msdelta

.

                      ref System.Runtime.InteropServices.ComTypes.FILETIME lpTargetFileTime,

mpr

.

[DllImport("mpr.dll", CharSet = System.Runtime.InteropServices.CharSet.Ansi)]

.

  //                              string lpUsername, System.UInt32 dwFlags );

.

  using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

.

        Dim errorM = New System.ComponentModel.Win32Exception(returnValue).Message

.

The system updates the user profile with the information that the connection is no longer a persistent one if you pass this constant as <dwFlags>

.

The system updates the user profile with the information that the connection is no longer a persistent one if you pass this constant as <dwFlags>

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)] public string lpLocalName;

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)] public string lpRemoteName;

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)] public string lpComment;

.

    [MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)] public string lpProvider;

.

Imports System.Runtime.InteropServices

.

    <MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> Public lpLocalName As String

.

    <MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> Public lpRemoteName As String

.

    <MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> Public lpComment As String

.

    <MarshalAs(System.Runtime.InteropServices.UnmanagedType.LPTStr)> Public lpProvider As String

.

                      ByVal localName As String, ByVal remoteName As System.Text.StringBuilder, _

.

    Declare Function WNetGetConnection Lib "mpr.dll" Alias "WNetGetConnectionA" (ByVal localName As String, ByVal remoteName As System.Text.StringBuilder, ByRef length As Integer) As Integer

.

    ByVal remoteName As System.Text.StringBuilder, ByRef length As Integer) As Integer

.

        Dim UNC As New System.Text.StringBuilder(length)

.

                      ByVal remoteName As System.Text.StringBuilder, _

irprops

.

        Public lastSeen As SystemTime

.

        Public lastUsed As SystemTime

.

            Me.lastSeen = New SystemTime

.

            Me.lastUsed = New SystemTime

.

    Private Structure SystemTime

coredll

.
NOTIFICATION_EVENT_TIME_CHANGE When the system time is changed. 1
.
Summary
This function prompts the system to start running a specified application at a specified time.
.

       (ByVal AppName As String, ByRef ExecTime As SYSTEMTIME) As Boolean

.

    Public Structure SYSTEMTIME

.

In VB, function will return "true" if successful when adding app to run. However, it returns a "false" when cancelling the app even though the event is successfully cancelled. I'm guessing this is due to the systemtime structure being passed by reference and in this case references nothing. See sample code below. (VB .NET CF)

.

While this wakes the device, the screen may remain powered off. Combine with SetSystemPowerState truly wake up everything.

.

Also, if the app is making a call to wake itself back up, you can get the full path and appname with system.reflection.assembly. See code below for example.

.

    Dim FullAppName As String = System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase

.

    Dim AppPathOnly As String = System.IO.Path.GetDirectoryName(FullAppName)

.

    Dim wakeuptime As SYSTEMTIME

.

    'populate systemtime structure with our new date

.

SYSTEMTIME

.

  System.DateTime dt = System.DateTime.Now.AddMinutes( 5 );

.

  notificationTrigger.StartTime = new SYSTEMTIME( dt );

.

  notificationTrigger.EndTime = new SYSTEMTIME();

.

SYSTEMTIME

.

  System.DateTime dt = System.DateTime.Now.AddMinutes( 5 );

.

  notificationTrigger.StartTime = new SYSTEMTIME( dt );

.

  notificationTrigger.EndTime = new SYSTEMTIME();

.

    public SYSTEMTIME StartTime;

.

    public SYSTEMTIME EndTime;

.

SYSTEMTIME

.

CompactFramework 2 has a setting for ScreenOrientation http://msdn.microsoft.com/en-us/library/microsoft.windowsce.forms.systemsettings.screenorientation%28v=vs.90%29.aspx

.

    using System;

.

    using System.Collections.Generic;

.

    using System.Text;

.

                    SystemSettings.ScreenOrientation = so;

.

                return SystemSettings.ScreenOrientation;

.

using HANDLE = System.IntPtr;

.

using System;

.

using System.Collections.Generic;

.

using System.Text;

.

using System.Runtime.InteropServices;

.

using HANDLE = System.IntPtr;

.

using HANDLE = System.IntPtr;

.

using System;

.

using System.Collections.Generic;

.

using System.Text;

.

using System.Runtime.InteropServices;

.

using HANDLE = System.IntPtr;

.

    Imports System.Runtime.InteropServices

.

    Inherits System.Exception

.

    '''The state of an auto-reset event object remains signaled until a single waiting thread is released, at which time the system automatically sets the state to nonsignaled. If no threads are waiting, the event object's state remains signaled.

.

    "C:\\WINDOWS\\SYSTEM32\\Calc.exe",

.

using HANDLE = System.IntPtr;

.

using System;

.

using System.Collections.Generic;

.

using System.Text;

.

using System.Runtime.InteropServices;

.

using HANDLE = System.IntPtr;

.

        int dwMessageId, int dwLanguageId, System.Text.StringBuilder lpBuffer, int nSize, IntPtr[] Arguments);

.

        int dwMessageId, int dwLanguageId, System.Text.StringBuilder lpBuffer, int nSize, IntPtr[] Arguments);

.

        FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000

.

        System.Text.StringBuilder sbMsg = new System.Text.StringBuilder(1024);

.

        if (FormatMessage(FormatMessageFlags.FORMAT_MESSAGE_FROM_SYSTEM, IntPtr.Zero, win32ErrorCode, 0, sbMsg, sbMsg.Capacity, null) != 0)

.

private void Form_Load(object sender, System.EventArgs e)

.

    throw new System.ComponentModel.Win32Exception();

.

http://msdn2.microsoft.com/en-us/library/system.diagnostics.fileversioninfo.aspx

.
Summary
This function returns the amount of time, in milliseconds, that the system has been idle.
.

   Const VK_NUMLOCK As Integer = CInt(System.Windows.Forms.Keys.NumLock)

.
Summary
GetLastError- retrieves the last system error.
.

Declare Function GetModuleFileNameEx Lib "coredll.dll" (ByVal hProcess As IntPtr, ByVal hModule As IntPtr, ByVal lpFileName As System.Text.StringBuilder, ByVal nSize As Int32) As Int32

.

Declare Function GetModuleFileNameEx Lib "coredll.dll" (ByVal hProcess As IntPtr, ByVal hModule As IntPtr, ByVal lpFileName As System.Text.StringBuilder, ByVal nSize As Int32) As Int32

.

    public static extern void GetSystemInfo(out SYSTEM_INFO lpSystemInfo);

.

    Declare Function GetSystemInfo Lib "coredll.dll" (ByVal lpSystemInfo AS SYSTEM_INFO)

.

[SYSTEM_INFO] on MSDN

.

    public struct SYSTEM_INFO_WCE30

.

    public struct SYSTEM_INFO_WCE50

.

using System;

.

using System.Collections.Generic;

.

using System.Text;

.

using System.Runtime.InteropServices;

.

    [DllImport("kernel32", EntryPoint = "GetSystemInfo", SetLastError = true)]

.

    public static extern void GetSystemInfo30(out SYSTEM_INFO_WCE30 pSi);

.

    [DllImport("kernel32", EntryPoint = "GetSystemInfo", SetLastError = true)]

.

    public static extern void GetSystemInfo50(out SYSTEM_INFO_WCE50 pSi);

.

        SYSTEM_INFO_WCE50 si;

.

        GetSystemInfo50(out si);

.

        SYSTEM_INFO_WCE30 si;

.

        GetSystemInfo30(out si);

.
Documentation
[GetSystemInfo] on MSDN
.
Summary
This function retrieves information from the kernel pertaining to object store and system memory.
.

static extern bool GetSystemMemoryDivision(ref uint lpdwStorePages, ref uint lpdwRamPages, ref uint lpdwPageSize);

.

Public Declare Function GetSystemMemoryDivision Lib "coredll.dll" _

.
Documentation
[GetSystemMemoryDivision] on MSDN
.

public static extern int GetSystemMemoryDivision

.

Declare Function GetSystemMemoryDivision Lib "coredll.dll" (TODO) As TODO

.
Documentation
[GetSystemMemoryDivision] on MSDN
.

public static extern int GetSystemPowerStatusEx2(SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, [MarshalAs(UnmanagedType.U4), In] int dwLen, [MarshalAs(UnmanagedType.Bool), In] bool fUpdate);

.

Declare Function GetSystemPowerStatusEx2 Lib "Coredll.dll" (TODO) As TODO

.

SYSTEM_POWER_STATUS_EX2

.

SYSTEM_POWER_STATUS_EX2 SystemPowerStatusEx2 = new SYSTEM_POWER_STATUS_EX2();

.

if (GetSystemPowerStatusEx2(SystemPowerStatusEx2, Marshal.SizeOf(SystemPowerStatusEx2), true) > 0) {

.
Documentation
[GetSystemPowerStatusEx2] on MSDN
.

public static extern int GetSystemPowerStatusEx2(ref SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, [MarshalAs(UnmanagedType.U4), In] int dwLen, [MarshalAs(UnmanagedType.Bool), In] bool fUpdate);

.

Declare Function GetSystemPowerStatusEx2 Lib "Coredll.dll" (TODO) As TODO

.

SYSTEM_POWER_STATUS_EX2

.

SYSTEM_POWER_STATUS_EX2 SystemPowerStatusEx2 = new SYSTEM_POWER_STATUS_EX2();

.

if (GetSystemPowerStatusEx2(ref SystemPowerStatusEx2, Marshal.SizeOf(SystemPowerStatusEx2), true) > 0) {

.
Documentation
[GetSystemPowerStatusEx2] on MSDN
.

static extern System.UInt32 GetWindowLong(IntPtr  hWnd, int nIndex);

.

    Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As System.UInt32

.
Summary
This function gets information on the physical and virtual memory of the system.
.

static extern void GwesPowerOffSystem();

.

Declare Sub GwesPowerOffSystem Lib "coredll.dll" ()

.

    extern static void GwesPowerOffSystem();

.

        GwesPowerOffSystem();

.
Documentation
[GwesPowerOffSystem] on MSDN
.

            //    System.Windows.Forms.MessageBox.Show ("IME has be Opened");

.

            //    System.Windows.Forms.MessageBox.Show ("IME has be Opened");

.
Summary
The keybd_event function synthesizes a keystroke. The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message. The keyboard driver's interrupt handler calls the keybd_event function (from msdn.microsoft.com)
.

    using System.Collections.Generic;

.

    using System.Text;

.

    using System.Runtime.InteropServices;

.

<System.Runtime.InteropServices.DllImport("kernel32.dll", _

.

System.Windows.Forms.MessageBox.Show(string message)

.
Summary
This structure contains information that the system needs to process taskbar status area messages.
.

Use the DuplicateHandle function to duplicate the handle. Use the CloseHandle function to close the handle. The system closes the handle automatically when the process terminates. The event object is destroyed when its last handle has been closed.

.

    using System;

.

    using System.ComponentModel;

.

    using System.Runtime.InteropServices;

.

    using System.Windows.Forms;

.

    Imports System

.

    Imports System.Diagnostics

.

    Imports System.IO

.

    Imports System.Runtime.InteropServices

.

        obj.m_size = System.Convert.ToUInt32(Marshal.SizeOf(typeof(_RASCONN)));

.

        size = System.Convert.ToUInt32(Marshal.SizeOf((rasconn = new _RASCONN[1])[0] = _RASCONN.CreateStruct()));

.

            size = System.Convert.ToUInt32(Marshal.SizeOf((rasconn = new _RASCONN[size / Marshal.SizeOf(typeof(_RASCONN))])[0] =                         _RASCONN.CreateStruct()) * rasconn.Length);

. . .

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

. . .

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

. . .

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

. . .

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

. . .

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

. . . . .

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call [GC.KeepAlive] after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

.

OutAttribute is used with [StringBuilder] parameters because StringBuilder is a reference type. Using the out keyword will result in passing the reference by-reference, but in this case the reference must be passed by-value.

.

using HANDLE = System.IntPtr;

.

using System;

.

using System.Collections.Generic;

.

using System.Text;

.

using System.Runtime.InteropServices;

.

using HANDLE = System.IntPtr;

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


 
Access PInvoke.net directly from VS: