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]

Enums

.
Summary
Indicates the execution contexts in which an object is to be run
.
Summary
A set of values from the COINIT enumeration is passed as the second parameter to CoInitializeEx. This value determines the concurrency model used for incoming calls to objects created by the thread making the call. However, since pinvoke is a dotNET construct you should be aware that dotNET already does a COM initialization and therefore calling a CoInitializeEx function most likely will not do what you expect. This problem occurs when trying to instantiate a COM object from within dotNET where the COM objects threading model is different from dotNETs. Search on Common Language Runtime or CLR and COINIT_APARTMENTTHREADED to find posts on this issue.
.

    using System.Runtime.InteropServices;

.

    using System.Runtime.InteropServices;

.

    ModesPruned = 0x8000000,

.

    ModesPruned = &H8000000

.

  [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential,Pack=4)]

.

      return System.Runtime.InteropServices.Marshal.GetExceptionForHR(hr);

.

    ///The class is configured to run as a security id different from the caller

.

    [Description("The class is configured to run as a security id different from the caller")]

.

    ///A RunAs specification must be &lt;domain name>\<user name> or simply &lt;user name>

.

    [Description("A RunAs specification must be <domain name>\\<user name> or simply <user name>")]

.

    public const int CO_E_RUNAS_SYNTAX = unchecked((int)0x80004017);

.

    public const int CO_E_RUNAS_CREATEPROCESS_FAILURE = unchecked((int)0x80004019);

.

    public const int CO_E_RUNAS_LOGON_FAILURE = unchecked((int)0x8000401A);

.

    ///The common language runtime is not available

.

    [Description("The common language runtime is not available")]

.

    ///Need to run the object to perform this operation

.

    [Description("Need to run the object to perform this operation")]

.

    public const int OLE_E_NOTRUNNING = unchecked((int)0x80040005);

.

    ///Application cannot be run more than once

.

    [Description("Application cannot be run more than once")]

.

    ///Message is too long; some of it had to be truncated before displaying

.

    [Description("Message is too long; some of it had to be truncated before displaying")]

.

    public const int INPLACE_S_TRUNCATED = unchecked((int)0x000401A0);

.

    ///Moniker is already registered in running object table

.

    [Description("Moniker is already registered in running object table")]

.

    ///The task is ready to run at its next scheduled time.

.

    [Description("The task is ready to run at its next scheduled time.")]

.

    ///The task is currently running.

.

    [Description("The task is currently running.")]

.

    public const int SCHED_S_TASK_RUNNING = unchecked((int)0x00041301);

.

    ///The task will not run at the scheduled times because it has been disabled.

.

    [Description("The task will not run at the scheduled times because it has been disabled.")]

.

    ///The task has not yet run.

.

    [Description("The task has not yet run.")]

.

    public const int SCHED_S_TASK_HAS_NOT_RUN = unchecked((int)0x00041303);

.

    ///There are no more runs scheduled for this task.

.

    [Description("There are no more runs scheduled for this task.")]

.

    public const int SCHED_S_TASK_NO_MORE_RUNS = unchecked((int)0x00041304);

.

    ///One or more of the properties that are needed to run this task on a schedule have not been set.

.

    [Description("One or more of the properties that are needed to run this task on a schedule have not been set.")]

.

    ///The last run of the task was terminated by the user.

.

    [Description("The last run of the task was terminated by the user.")]

.

    ///Event triggers don't have set run times.

.

    [Description("Event triggers don't have set run times.")]

.

    ///One or more of the properties that are needed to run this task have not been set.

.

    [Description("One or more of the properties that are needed to run this task have not been set.")]

.

    ///There is no running instance of the task to terminate.

.

    [Description("There is no running instance of the task to terminate.")]

.

    public const int SCHED_E_TASK_NOT_RUNNING = unchecked((int)0x8004130B);

.

    ///The task has been configured with an unsupported combination of account settings and run time options.

.

    [Description("The task has been configured with an unsupported combination of account settings and run time options.")]

.

    ///The Task Scheduler Service is not running.

.

    [Description("The Task Scheduler Service is not running.")]

.

    public const int SCHED_E_SERVICE_NOT_RUNNING = unchecked((int)0x80041315);

.

    //  See asn1code.h for a definition of the OSS runtime errors. The OSS

.

    ///OSS ASN.1 Error: Output buffer is too small, the decoded data has been truncated.

.

    [Description("OSS ASN.1 Error: Output buffer is too small, the decoded data has been truncated.")]

.

    ///The Smart card resource manager is not running.

.

    [Description("The Smart card resource manager is not running.")]

.

    ///The COM+ registry database is already running

.

    [Description("The COM+ registry database is already running")]

.

    public const int COMADMIN_E_REGDB_ALREADYRUNNING = unchecked((int)0x80110475);

.

    ///The specified application is not currently running

.

    [Description("The specified application is not currently running")]

.

    public const int COMADMIN_E_APP_NOT_RUNNING = unchecked((int)0x8011080A);

.

    ///COM+ applications that run as NT service may not be pooled or recycled

.

    [Description("COM+ applications that run as NT service may not be pooled or recycled")]

.

    ///Applications running as NT services may not be recycled.

.

    [Description("Applications running as NT services may not be recycled.")]

.

<System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack := 4)> _

.

        Return System.Runtime.InteropServices.Marshal.GetExceptionForHR(hr)

.

    '''The class is configured to run as a security id different from the caller

.

    <Description("The class is configured to run as a security id different from the caller")> _

.

    '''A RunAs specification must be &lt;domain name>\<user name> or simply &lt;user name>

.

    <Description("A RunAs specification must be <domain name>\<user name> or simply <user name>")> _

.

    Public Const CO_E_RUNAS_SYNTAX As Integer = CInt(&H80004017UI)

.

    Public Const CO_E_RUNAS_CREATEPROCESS_FAILURE As Integer = CInt(&H80004019UI)

.

    Public Const CO_E_RUNAS_LOGON_FAILURE As Integer = CInt(&H8000401aUI)

.

    '''The common language runtime is not available

.

    <Description("The common language runtime is not available")> _

.

    '''Need to run the object to perform this operation

.

    <Description("Need to run the object to perform this operation")> _

.

    Public Const OLE_E_NOTRUNNING As Integer = CInt(&H80040005UI)

.

    '''Application cannot be run more than once

.

    <Description("Application cannot be run more than once")> _

.

    '''Message is too long; some of it had to be truncated before displaying

.

    <Description("Message is too long; some of it had to be truncated before displaying")> _

.

    Public Const INPLACE_S_TRUNCATED As Integer = CInt(&H401a0)

.

    '''Moniker is already registered in running object table

.

    <Description("Moniker is already registered in running object table")> _

.

    '''The task is ready to run at its next scheduled time.

.

    <Description("The task is ready to run at its next scheduled time.")> _

.

    '''The task is currently running.

.

    <Description("The task is currently running.")> _

.

    Public Const SCHED_S_TASK_RUNNING As Integer = CInt(&H41301)

.

    '''The task will not run at the scheduled times because it has been disabled.

.

    <Description("The task will not run at the scheduled times because it has been disabled.")> _

.

    '''The task has not yet run.

.

    <Description("The task has not yet run.")> _

.

    Public Const SCHED_S_TASK_HAS_NOT_RUN As Integer = CInt(&H41303)

.

    '''There are no more runs scheduled for this task.

.

    <Description("There are no more runs scheduled for this task.")> _

.

    Public Const SCHED_S_TASK_NO_MORE_RUNS As Integer = CInt(&H41304)

.

    '''One or more of the properties that are needed to run this task on a schedule have not been set.

.

    <Description("One or more of the properties that are needed to run this task on a schedule have not been set.")> _

.

    '''The last run of the task was terminated by the user.

.

    <Description("The last run of the task was terminated by the user.")> _

.

    '''Event triggers don't have set run times.

.

    <Description("Event triggers don't have set run times.")> _

.

    '''One or more of the properties that are needed to run this task have not been set.

.

    <Description("One or more of the properties that are needed to run this task have not been set.")> _

.

    '''There is no running instance of the task to terminate.

.

    <Description("There is no running instance of the task to terminate.")> _

.

    Public Const SCHED_E_TASK_NOT_RUNNING As Integer = CInt(&H8004130bUI)

.

    '''The task has been configured with an unsupported combination of account settings and run time options.

.

    <Description("The task has been configured with an unsupported combination of account settings and run time options.")> _

.

    '''The Task Scheduler Service is not running.

.

    <Description("The Task Scheduler Service is not running.")> _

.

    Public Const SCHED_E_SERVICE_NOT_RUNNING As Integer = CInt(&H80041315UI)

.

    '  See asn1code.h for a definition of the OSS runtime errors. The OSS

.

    '''OSS ASN.1 Error: Output buffer is too small, the decoded data has been truncated.

.

    <Description("OSS ASN.1 Error: Output buffer is too small, the decoded data has been truncated.")> _

.

    '''The Smart card resource manager is not running.

.

    <Description("The Smart card resource manager is not running.")> _

.

    '''The COM+ registry database is already running

.

    <Description("The COM+ registry database is already running")> _

.

    Public Const COMADMIN_E_REGDB_ALREADYRUNNING As Integer = CInt(&H80110475UI)

.

    '''The specified application is not currently running

.

    <Description("The specified application is not currently running")> _

.

    Public Const COMADMIN_E_APP_NOT_RUNNING As Integer = CInt(&H8011080aUI)

.

    '''COM+ applications that run as NT service may not be pooled or recycled

.

    <Description("COM+ applications that run as NT service may not be pooled or recycled")> _

.

    '''Applications running as NT services may not be recycled.

.

    <Description("Applications running as NT services may not be recycled.")> _

.

    INSTALLSTATE_SOURCEABSENT = -4,  // run from source, source is unavailable

.

    INSTALLSTATE_SOURCE       =  4,  // run from source, CD or net

.

    ''' Run from source, source is unavailable.

.

    ''' Run from source, CD or net.

.

    DataOverrun = 0xc000003c,

.

    OF_CREATE    = 0x00001000,  // Creates a new file. If file exists, it is truncated to zero (0) length.

.

        /// <summary>664. The system has run out of memory. </summary>

.

        /// <summary>710. Serial overrun errors were detected while communicating with the modem. </summary>

.

        ERROR_OVERRUN,

.

        /// <summary>827. The L2TP/IPsec connection cannot be completed because the IKE and AuthIP IPSec Keying Modules service and/or the Base Filtering Engine service is not running. These services are required to establish an L2TP/IPSec connection. </summary>

.

    /// Application is currently running.

.

    RmStatusRunning = 0x1,

.

    /// One or more processes are running in another TS session.

12: SBSP
.

    SBSP_CALLERUNTRUSTED = 0x00800000,

.

            Run_Command = 3

.

        Run_Command = 3

.

    MinorUnstable = 0x00000006,

.

     MinorUnstable = &H6

15: STARTF
.

        STARTF_RUNFULLSCREEN = 0x00000020,  // ignored for non-x86 platforms

.

    STARTF_RUNFULLSCREEN = &H20

.

        /// input supported by a device running Windows 7 or Windows Server 2008 R2. For more information, see Remarks.

.
Summary
Specifies values that identify whether the font size of a highlighted text run should be incremented or decremented.
.

You should use System.Runtime.InteropServices.VarEnum instead.

.

using System.Runtime.InteropServices;

.

            Application.Run(new Form1());

.

     /// A null-terminated string that contains the name of the initial program that Remote Desktop Services runs when the user logs on.

.

     /// A null-terminated string that contains the published name of the application that the session is running.

misc

.

The rapi.dll section needs to be corrected. Rapi is not for running on the .NET Compact Framework, but rather for desktop applications. It does not appear possible to edit this part of the page.

.

There is also IE (6.0.2800.1106.xpsp2) bug: clicking "Edit This Page" brings up error message "A runtime error has occurred... Line: 15 Error: 'ButtonBar' is undefined". Harmless but annoying.

22: FAQ
.

using System.Runtime.InteropServices;

.

For pointer-sized entities such as handles, they must be defined such that they will be 32 bits on a 32-bit machine and 64 bits on a 64-bit machine. IntPtr (or UIntPtr) accomplishes this. The use of int will appear to be fine if you only run the code on a 32-bit machine, but will likely cause your application/component to crash as soon as it gets on a 64-bit machine.

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: