Desktop Functions: Smart Device Functions:
|
Search Results for "system" in [All]dmcl401: dmAPIGet
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 4: InternetDial [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())) msdelta12: CreateDeltaW
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> 17: WNetEnumResource
[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 coredll20: CeRunAppAtEvent
21: CeRunAppAtTime
(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
System.DateTime dt = System.DateTime.Now.AddMinutes( 5 );
notificationTrigger.StartTime = new SYSTEMTIME( dt );
notificationTrigger.EndTime = new SYSTEMTIME();
System.DateTime dt = System.DateTime.Now.AddMinutes( 5 );
notificationTrigger.StartTime = new SYSTEMTIME( dt );
notificationTrigger.EndTime = new 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; 26: CloseHandle
using HANDLE = System.IntPtr;
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using HANDLE = System.IntPtr; 27: CreateEvent
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. 28: CreateProcess
"C:\\WINDOWS\\SYSTEM32\\Calc.exe", 29: EventModify
using HANDLE = System.IntPtr; using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using HANDLE = System.IntPtr; 30: FormatMessageW
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) 31: GetCapture private void Form_Load(object sender, System.EventArgs e)
throw new System.ComponentModel.Win32Exception(); 34: GetIdleTime 35: GetKeyState
Const VK_NUMLOCK As Integer = CInt(System.Windows.Forms.Keys.NumLock) 36: GetLastError
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 39: GetSystemInfo
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);
static extern bool GetSystemMemoryDivision(ref uint lpdwStorePages, ref uint lpdwRamPages, ref uint lpdwPageSize);
Public Declare Function GetSystemMemoryDivision Lib "coredll.dll" _ public static extern int GetSystemMemoryDivision
Declare Function GetSystemMemoryDivision Lib "coredll.dll" (TODO) As TODO
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 SystemPowerStatusEx2 = new SYSTEM_POWER_STATUS_EX2();
if (GetSystemPowerStatusEx2(SystemPowerStatusEx2, Marshal.SizeOf(SystemPowerStatusEx2), true) > 0) {
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 SystemPowerStatusEx2 = new SYSTEM_POWER_STATUS_EX2();
if (GetSystemPowerStatusEx2(ref SystemPowerStatusEx2, Marshal.SizeOf(SystemPowerStatusEx2), true) > 0) { 44: GetWindowLong
static extern System.UInt32 GetWindowLong(IntPtr hWnd, int nIndex);
Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As System.UInt32
static extern void GwesPowerOffSystem();
Declare Sub GwesPowerOffSystem Lib "coredll.dll" ()
extern static void GwesPowerOffSystem();
GwesPowerOffSystem(); 47: ImmSetOpenStatus
// System.Windows.Forms.MessageBox.Show ("IME has be Opened");
// System.Windows.Forms.MessageBox.Show ("IME has be Opened"); 48: keybd_event 49: MessageBox <System.Runtime.InteropServices.DllImport("kernel32.dll", _ System.Windows.Forms.MessageBox.Show(string message) 50: NOTIFYICONDATA 51: OpenEvent 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. 52: PlaySound
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); 54: RegCreateKeyEx 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. 55: RegDeleteKey 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. 56: RegDeleteValue 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. 57: RegFlushKey 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. 58: RegOpenKeyEx 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. 59: RegQueryInfoKey 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. 60: ResetEvent
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. |