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

faultrep

.

using System.Runtime.InteropServices;

ntdsapi

.

using System.Runtime.ConstrainedExecution;

.

using System.Runtime.InteropServices;

.

    using System.Runtime.InteropServices;

secur32

.

using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

.

        /// Requires Windows Server 2003 domain account running in Win2003 native domain mode

comdlg32

.

Imports System.Runtime.InteropServices

.

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _

.

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _

.

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _

.

Imports System.Runtime.InteropServices

.

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _

.

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _

.

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto, Pack:=1), System.Runtime.InteropServices.ComVisible(False)> _

msi

.

        MSIINSTALLCONTEXT_USERUNMANAGED =   2,

.

        MSIINSTALLCONTEXT_ALL       = (MSIINSTALLCONTEXT_USERMANAGED | MSIINSTALLCONTEXT_USERUNMANAGED | MSIINSTALLCONTEXT_MACHINE),

.

        MSIINSTALLCONTEXT_USERUNMANAGED =   2,

.

        MSIINSTALLCONTEXT_ALL       = (MSIINSTALLCONTEXT_USERMANAGED | MSIINSTALLCONTEXT_USERUNMANAGED | MSIINSTALLCONTEXT_MACHINE),    

.

        uint res = MsiInterop.MsiEnumProductsEx(codeToFind, null, (uint)MsiInterop.MSIINSTALLCONTEXT.MSIINSTALLCONTEXT_USERUNMANAGED, 0, code, out junk, szSid, ref pccSid);

.

        MSIINSTALLCONTEXT_USERUNMANAGED =   2,

.

        MSIINSTALLCONTEXT_ALL       = (MSIINSTALLCONTEXT_USERMANAGED | MSIINSTALLCONTEXT_USERUNMANAGED | MSIINSTALLCONTEXT_MACHINE),    

.

You can use this to query product codes from a Windows Service running under the local system account.

.

        uint res = MsiInterop.MsiEnumProductsEx(codeToFind, null, (uint)MsiInterop.MSIINSTALLCONTEXT.MSIINSTALLCONTEXT_USERUNMANAGED, 0, code, out junk, szSid, ref pccSid);

.

     case 1605:  return Resources.MsiErrorUnknownProduct ;

.

     case 1608:  return Resources.MsiErrorUnknownProperty ;

.

     case 1647:  return Resources.MsiErrorUnknownPatch ;

.

      return Resources.AgentErrorUnknown;

.
Summary
Returns the numeric language of the installation that is currently running.
.

     case 1605:  return Resources.MsiErrorUnknownProduct ;

.

     case 1608:  return Resources.MsiErrorUnknownProperty ;

.

     case 1647:  return Resources.MsiErrorUnknownPatch ;

.

      return Resources.AgentErrorUnknown;

.

      UserUnmanaged=2,

.

using System.Runtime.InteropServices;

.

The sample application below demonstrates how to use MsiRecordSetString, MsiOpenDatabase, MsiCreateRecord, MsiCloseHandle, MsiDatabaseOpenView, MsiViewExecute, MsiDatabaseCommit, and MsiViewClose in C# to modify a property value in an MSI database. To run it, simply create a new Windows Console application and replace the code that Visual Studio gives you with the code below. You may have to modify the namespace name. The sample as-is requires a valid MSI database named SETUP.msi, with a property named PROPERTY1 in the Property table, to be located in C:\. You can of course change the path to your MSI database in the calls to ChangeMSIProperty() in Main() and use any existing property you wish.

.

using System.Runtime.InteropServices;

mpr

.

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

.

  using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

.

    [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

ipaqutil

.
Summary
Gets the current state of backlight when running on batteries.
.
Summary
Turns On/Off the backlight, when the iPAQ is running on batteries

dmcl40

.

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

wer

.

¹?`åäUìE㍥Z¡€àj‘­'0½ØË—Tø®ØRh ƒ2»Î¤ã/¨Û ë¿’ô‰Áª2ý\8ÃfŒK¶gêcoo½„õn< JJ¼Ã„yšvÓÀ$㠗(É®ኾïÿ}ˆOZˆâî?¬Bû?px4¼ª™•DÝ뭂}5]swȕ´àÅÑԘ/ýJ0ù]q½¡íAÁBÙµ6¤¶ß°×3Tõ$>Žn}A‚5ûÑÚdÜmÿÎÕ ¼kRun/Ÿ«m®ÈzÖG`èM80T©ÓÈÿÞlVÓÙeþÏOˆ·ƒ`³f#dÛ“dS|êÆÜŸ£$ùÁùàZƒ­½9%ߤ'0}rªd¾_ޖ‘Ò<JÒF㠂³5¼z­qrùê

.

qc«¾æAé_¼;F ƒµu)°âސÔyH0/Ô¢\ëóZµ ¦êz© É>€Ã—áÜՐå“Rrõ%.ruN|,¨–º4>öÏ»0$Ráw7âI"

Structures

.

using System.Runtime.InteropServices;

.

Imports System.Runtime.InteropServices

.

Imports System.Runtime.InteropServices

.

   public CRYPT_OBJID_BLOB IssuerUniqueId;

.

   <System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)> _

27: DCB
.

using System.Runtime.InteropServices;

.

    [System.Runtime.InteropServices.FieldOffset(0)]

.

    [System.Runtime.InteropServices.FieldOffset(32)]

.

    [System.Runtime.InteropServices.FieldOffset(34)]

.

    [System.Runtime.InteropServices.FieldOffset(36)]

.

    [System.Runtime.InteropServices.FieldOffset(38)]

.

    [System.Runtime.InteropServices.FieldOffset(40)]

.

    [System.Runtime.InteropServices.FieldOffset(44)]

.

    [System.Runtime.InteropServices.FieldOffset(46)]

.

    [System.Runtime.InteropServices.FieldOffset(48)]

.

    [System.Runtime.InteropServices.FieldOffset(50)]

.

    [System.Runtime.InteropServices.FieldOffset(52)]

.

    [System.Runtime.InteropServices.FieldOffset(54)]

.

    [System.Runtime.InteropServices.FieldOffset(56)]

.

    [System.Runtime.InteropServices.FieldOffset(58)]

.

    [System.Runtime.InteropServices.FieldOffset(44)]

.

    [System.Runtime.InteropServices.FieldOffset(52)]

.

    [System.Runtime.InteropServices.FieldOffset(56)]

.

    [System.Runtime.InteropServices.FieldOffset(60)]

.

    [System.Runtime.InteropServices.FieldOffset(62)]

.

    [System.Runtime.InteropServices.FieldOffset(64)]

.

    [System.Runtime.InteropServices.FieldOffset(66)]

.

    [System.Runtime.InteropServices.FieldOffset(68)]

.

    [System.Runtime.InteropServices.FieldOffset(70)]

.

    [System.Runtime.InteropServices.FieldOffset(102)]

.

    [System.Runtime.InteropServices.FieldOffset(104)]

.

    [System.Runtime.InteropServices.FieldOffset(108)]

.

    [System.Runtime.InteropServices.FieldOffset(112)]

.

    [System.Runtime.InteropServices.FieldOffset(116)]

.

    [System.Runtime.InteropServices.FieldOffset(116)]

.

    [System.Runtime.InteropServices.FieldOffset(120)]

.

using System.Runtime.InteropServices;

.

Imports System.Runtime.InteropServices

.

<System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)> _

.

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

.

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

.

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

.

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

.

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

.

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

.

    Public ftCreationTime As System.Runtime.InteropServices.ComTypes.FILETIME

.

    Public ftLastAccessTime As System.Runtime.InteropServices.ComTypes.FILETIME

.

    Public ftLastWriteTime As System.Runtime.InteropServices.ComTypes.FILETIME

.

    <Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=260)>

.

[System.Runtime.InteropServices.FILETIME] (obsolete), or [System.Runtime.InteropServices.ComTypes.FILETIME] in the .NET Framework 2.0.

.

There is no reason not to use [System.Runtime.InteropServices.ComTypes.FILETIME], but there still is a need for conversion to [DateTime]:

.

* Note that System.Runtime.InteropServices.FILETIME is now obsolete. Changed to use System.Runtime.InteropServices.ComTypes.FILETIME instead.

.

    //     handle with the GMEM_SHARE flag. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     The storage medium is a disk file identified by a path. If the STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     ISequentialStream::Read to read the data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     to access the metafile's data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    //     The storage medium is an enhanced metafile. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     handle with the GMEM_SHARE flag. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     The storage medium is a disk file identified by a path. If the STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     ISequentialStream::Read to read the data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     to access the metafile's data. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    '     The storage medium is an enhanced metafile. If the System.Runtime.InteropServices.ComTypes.STGMEDIUMSystem.Runtime.InteropServices.ComTypes.STGMEDIUM.pUnkForRelease

.

    RunFromSwapIfInRemovableMedia = &H400

.

    RunFromSwapIfInNetworkMedia = &H800

.

        IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12,

.

        public IMAGE_DATA_DIRECTORY CLRRuntimeHeader;

.

        public IMAGE_DATA_DIRECTORY CLRRuntimeHeader;

.

    ''' runtime library code that calls the aforementioned functions. This field can  

.

    ''' run under Windows 9x or Windows Me, the minimum alignment size is a page (4KB).

.

    ''' IMAGE_SUBSYSTEM_WINDOWS_CUI  // Run as a console mode application

.

    '''                  // When run, the OS creates a console

.

    ' or DllMain, rather, it points to runtime library code that calls the aforementioned functions.

.

    ' executables to run under Windows 9x or Windows Me, the minimum alignment size is a page (4KB).

.

    ' IMAGE_SUBSYSTEM_WINDOWS_CUI (Run as a console mode application.  When run, the OS creates a

.

    ' or DllMain, rather, it points to runtime library code that calls the aforementioned functions.

.

    ' executables to run under Windows 9x or Windows Me, the minimum alignment size is a page (4KB).

.

    ' IMAGE_SUBSYSTEM_WINDOWS_CUI (Run as a console mode application.  When run, the OS creates a

.

    public IMAGE_DATA_DIRECTORY CLRRuntimeHeader;

.

        IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12,

.

The .NET Framework class Font, has a method, Font::FromLogfont that takes an Object reference as it's method parameter. You must define a managed LOGFONT class using the same format as the C# signature above. When using the StructLayout attribute on the class definition, you must set the CharSet property to Auto (the default is Ansi, which will not work correctly). The only difficulty encountered is passing the string value (the designated Font Face Name) to the FromLogfont method; apparently, this must have the attribute: [MarshalAs(UnmanagedType::ByValTStr)] enum value for the method to work correctly. Then, when instantiating a new Font in your managed application, you must cast the LOGFONT class (with appropriate member values assigned) to a System::Object for the function to work without generating a runtime exception.

.

        /// approximately 3 GB for 32-bit processes that are large address aware running

.

mi.cbSize = System.Runtime.InteropServices­.Marshal.SizeOf(typeof(MENUINF­O));

.

using System.Runtime.InteropServices

.

    public int     otmsCharSlopeRun;

.

        Public otmsCharSlopeRun As Int32

.

[System.Runtime.InteropServices.ComVisible(false)]        

.

     public int dwHardwareOverrunErr;

.

     public int dwBufferOverrunErr;

.

     Public dwBufferOverrunErr As Integer

.

     Public dwHardwareOverrunErr As Integer

.

    <System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)> _

45: RECT
.

Imports System.Runtime.InteropServices

.

using System.Runtime.InteropServices;

.

using System.Runtime.InteropServices;

.

            Application.Run(new Form1());

.

        SERVICE_RUNNING = 0x00000004,

.

After your worker thread(s) start and are your service is running, call (before OnStart ends):

.

        myServiceStatus.currentState = (int)State.SERVICE_RUNNING;

.

    SERVICE_RUNNING = 0x00000004,

.

Under x64, the SHFILEOPSTRUCT must be declared without the Pack = 1 parameter, or it will fail. This is a real pain if you want your code to be platform independent, as you have to declare two separate structures, one with Pack = 1, and one without. You then have to declare two different SHFileOperation calls, one for each of the structures. Then you have to decide which one to call depending on whether you are running on 32 or 64 bit.

.

using System.Runtime.InteropServices;

.

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

.

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

.

using System.Runtime.InteropServices; // for CharSet

.

<System.Runtime.InteropServices.StructLayout(LayoutKind.Sequential)> _

.

[System.Runtime.InteropServices.DllImport("Kernel32.dll", SetLastError = true)]

.

[System.Runtime.InteropServices.DllImport("Kernel32.dll", SetLastError = true)]

.

[System.Runtime.InteropServices.DllImport("Kernel32.dll", SetLastError = true)]

.

    pti.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(pti);

.

    <System.Runtime.InteropServices.StructLayout(Runtime.InteropServices.LayoutKind.Sequential)> _

.

    <System.Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.LPTStr)> _

.

<System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)> _

.

    DataTruncation = 0x00000004,

.

    NamedDataTruncation = 0x00000040,

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


 
Access PInvoke.net directly from VS: