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

dbghlp

.

ðChÃÎt90_>dy~'‚"_eNUøÖMi7•Œ^Ê<ÝN¾ì@ˆì SETHDZ˜ê"Vãx‚yF-&1ê̱PC˜9Z$A¯ˆ‚ äί ‘a»!l“¥aåóÒ|±rXíêÐ߁Ùó=À¢ŠG†>¤Œ7zØO<Ä:G.i [ÆÅŸs`VA

MinCore

.
Description
MinCore.lib - Windows 8.1+ API sets

glu32

.

[DllImport("glu32.dll", SetLastError=true)]

comdlg32

.

[DllImport("comdlg32.dll", CharSet = CharSet.Auto, EntryPoint = "ChooseFont", SetLastError=true)]

.

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]

.

[DllImport("comdlg32.dll", SetLastError=true)]

.

<DllImport("comdlg32.dll", SetLastError:=True)> _

.

[DllImport("WinInet.dll", SetLastError=true, CharSet=CharSet.Auto)]

.

<DllImport("WinInet.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _

.

[DllImport("comdlg32.dll", SetLastError=true, CharSet = CharSet.Auto)]

.

<DllImport("comdlg32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _

.

    '  WORD      nFileOffset;

.

    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _

.

        Public fileOffset As Short = 0

.

            Console.WriteLine("Offset from file name: {0}", ofn.fileOffset)

.

            Console.WriteLine("Offset from file extension: {0}", ofn.fileExtension)

.

     WORD nFileOffset;

.

    memset(&ofn, 0, sizeof (ofn));

.

[DllImport("Comdlg32.dll", CharSet=CharSet.Auto, SetLastError=true)]

.

<DllImport("Comdlg32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _

.

    '  WORD      nFileOffset;

.

    <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> _

.

    Public fileOffset As Short = 0

.

[DllImport("comdlg32.dll", SetLastError=true, CharSet=CharSet.Auto)]

.

static extern bool PageSetupDlg(ref PAGESETUPDLG_STRUCT lppsd);

.

<DllImport("comdlg32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _

.

Private Shared Function PageSetupDlg(ByRef lppsd As PAGESETUPDLG_STRUCT) As Boolean

.

PAGESETUPDLG_STRUCT

.
Documentation
[PageSetupDlg] on MSDN
.

[DllImport("comdlg32.dll", CharSet=CharSet.Auto)]

.

<DllImport("comdlg32.dll", CharSet:=CharSet.Auto)> _

.

    <DllImport("comdlg32.dll", CharSet:=CharSet.Auto)> _

.

        Set(ByVal value As IntPtr)

.

        End Set

.

        Dim prnsettings As Printing.PrinterSettings = New Printing.PrinterSettings()

.

        _pdex.hDevMode = prnsettings.GetHdevmode()

.

        _pdex.hDevNames = prnsettings.GetHdevnames()

.

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

.

    Public Const PD_PRINTSETUP As Int32 = 64

.

    Public Const PD_ENABLESETUPHOOK As Int32 = 8192

.

    Public Const PD_ENABLESETUPTEMPLATE As Int32 = 32768

.

    Public Const PD_ENABLESETUPTEMPLATEHANDLE As Int32 = 131072

.

[DllImport("comdlg32.dll", CharSet=CharSet.Auto)]

.

<DllImport("comdlg32.dll", CharSet:=CharSet.Auto)> _

.

    <DllImport("comdlg32.dll", CharSet:=CharSet.Auto)> _

.

        Set(ByVal value As IntPtr)

.

        End Set

.

        Dim prnsettings As Printing.PrinterSettings = New Printing.PrinterSettings()

.

        _pdex.hDevMode = prnsettings.GetHdevmode()

.

        _pdex.hDevNames = prnsettings.GetHdevnames()

.

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

.

    Public Const PD_PRINTSETUP As Int32 = 64

.

    Public Const PD_ENABLESETUPHOOK As Int32 = 8192

.

    Public Const PD_ENABLESETUPTEMPLATE As Int32 = 32768

.

    Public Const PD_ENABLESETUPTEMPLATEHANDLE As Int32 = 131072

.

[DllImport("oleaut32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

<DllImport("oleaut32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, PreserveSig:=False)> _

powrprof

.

[DllImport("powrprof.dll", SetLastError=true)]

.

<DllImport("powrprof.dll", SetLastError := True)> _

.

[DllImport("powrprof.dll", SetLastError=true)]

.

[DllImport("powrprof.dll", SetLastError=true, CharSet = CharSet.Auto)]

.

[DllImport("powrprof.dll", SetLastError=true)]

.

[DllImport("powrprof.dll", SetLastError=true)]

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

[DllImport("powrprof.dll", SetLastError = true)]

.

[DllImport("powrprof.dll", SetLastError=true)]

.

    [DllImport("powrprof.dll", SetLastError = true)]

.

[DllImport("powrprof.dll", SetLastError=true)]

.

[DllImport("powrprof.dll", SetLastError=true)]

.

                     IntPtr SubGroupOfPowerSettingsGuid,

.

   ACCESS_AC_POWER_SETTING_INDEX = 0,

.

   ACCESS_DC_POWER_SETTING_INDEX = 1,

.

   ACCESS_INDIVIDUAL_SETTING = 18,

.

                SubGroupOfPowerSettingsGuid As IntPtr,

.

     ACCESS_AC_POWER_SETTING_INDEX = 0

.

     ACCESS_DC_POWER_SETTING_INDEX = 1

.

     ACCESS_INDIVIDUAL_SETTING = 18

.

        IntPtr SubGroupOfPowerSettingGuid,

.

        IntPtr PowerSettingGuid,

.

        IntPtr SubGroupOfPowerSettingGuid,

.

        IntPtr PowerSettingGuid,

.

                SubGroupOfPowerSettingGuid As IntPtr, PowerSettingGuid As IntPtr, _

.

    ''' Retrieves the friendly name for the specified power setting, subgroup, or scheme, in Unicode (Each Char is 2 bytes).

.

    ''' <param name="RootPowerKey">This parameter is reserved for future use and must be set to NULL</param>

.

    ''' <param name="SubGroupOfPowerSettingGuid">The subgroup of power settings. Use NO_SUBGROUP_GUID to refer to the default power scheme.</param>

.

    ''' <param name="PowerSettingGuid">The identifier of the power setting that is being used.</param>

.

    [DllImport("Powrprof.dll", SetLastError = true)]

.

    private const int PBT_POWERSETTINGCHANGE = 32787; // (0x8013) - A power setting change event has been received.

.

    /// <param name="setting">A structure related to the notification, depends on type parameter</param>

.

    delegate int DeviceNotifyCallbackRoutine(IntPtr context, int type, IntPtr setting);

.

    private static int DeviceNotifyCallback(IntPtr context, int type, IntPtr setting)

.

        case PBT_POWERSETTINGCHANGE:

.

            Console.WriteLine("\tA power setting change event has been received. ");

.
Summary
Queries for a group policy override for specified power settings.
.

    /// Full call to Vista method PowerSettingAccessCheck().

.

    [DllImport("PowrProf.dll", CharSet = CharSet.Auto, SetLastError = true)]

.

    internal static extern UInt32 PowerSettingAccessCheck(

.

                            PowerSettingAccessFlags accessFlags,

.

    /// Partial call to Vista method PowerSettingAccessCheck() supporting null GUID parameter.

.

    [DllImport("PowrProf.dll", CharSet = CharSet.Auto, SetLastError = true)]

.

    private static extern UInt32 PowerSettingAccessCheck(

.

                            PowerSettingAccessFlags accessFlags,

.

    /// Full call to Vista method PowerSettingAccessCheck() supporting empty power setting identifier.

.

    internal static UInt32 PowerSettingAccessCheck(PowerSettingAccessFlags accessFlags)

.

        return PowerSettingAccessCheck(accessFlags, IntPtr.Zero);

.

    public enum PowerSettingAccessFlags

.

        /// Check for overrides on AC power settings.

.

        ACCESS_AC_POWER_SETTING_INDEX = 0x0,

.

        /// Check for overrides on DC power settings.

.

        ACCESS_DC_POWER_SETTING_INDEX = 0x1,

.

Declare Function PowerSettingAccessCheck Lib "powrprof.dll" (TODO) As TODO

.
Documentation
[PowerSettingAccessCheck] on MSDN
.
Summary
Sets the friendly name for the specified power setting, subgroup, or scheme
.

[DllImport("powrprof.dll", SetLastError=true, CharSet=CharSet.Unicode)]

.

            IntPtr SubGroupOfPowerSettingGuid,

.

            IntPtr PowerSettingGuid,

.

        uint set = NativeMethods.PowerWriteFriendlyName(IntPtr.Zero, ref powerPlanId, IntPtr.Zero, IntPtr.Zero, name, BufferSize);

.

        if (set == 0) //verify if the value has been set successfuly

.

[DllImport("powrprof", SetLastError=true)]

.

<DllImport("powrprof.dll", SetLastError:=True)> Private Shared Function ReadGlobalPwrPolicy(ByRef pGlobalPowerPolicy As GLOBAL_POWER_POLICY) As Boolean

.

[DllImport("powrprof.dll", SetLastError=true)]

.

[DllImport("powrprof.dll", SetLastError = true)]

.

private static extern bool SetActivePwrScheme(uint uiID, ref GlobalPowerPolicy lpGlobalPowerPolicy, ref PowerPolicy lpPowerPolicy);

.

[DllImport("powrprof.dll", SetLastError = true)]

.

private static extern bool SetActivePwrScheme(uint uiID, IntPtr lpGlobalPowerPolicy, IntPtr lpPowerPolicy);

.

Declare Function SetActivePwrScheme Lib "powrprof.dll" (TODO) As TODO

.
Documentation
[SetActivePwrScheme] on MSDN
.

[DllImport ("Powrprof.dll", SetLastError = true)]

.

static extern bool SetSuspendState (bool hibernate, bool forceCritical, bool disableWakeEvent);

.

Declare Function SetSuspendState Lib "powrprof.dll" (ByVal Hibernate As Boolean, ByVal ForceCritical As Boolean, ByVal DisableWakeEvent As Boolean) As Boolean

.

            [DllImport("Powrprof.dll", SetLastError = true)]

.

            static extern bool SetSuspendState(bool hibernate, bool forceCritical, bool disableWakeEvent);

.

                SetSuspendState(false, false, false);

.

        'SetSuspendState will put the PC in to a standby mode

.

        Private Declare Function SetSuspendState Lib "powrprof.dll" (ByVal Hibernate As Boolean, ByVal ForceCritical As Boolean, _

.

        'SetSuspendState Example

.

        'SetSuspendState(False, False, False)

.

    Application.SetSuspendState(PowerState.Hibernate, False, False)

.

    Application.SetSuspendState(PowerState.Suspend, False, False)

.

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

.
Documentation
[SetSuspendState] on MSDN
.

[DllImport("powrprof.dll", SetLastError=true)]

.

[DllImport("powrprof", SetLastError=true)]

.

<DllImport("powrprof.dll", SetLastError:=True)> Private Shared Function WriteGlobalPwrPolicy(ByRef pGlobalPowerPolicy As GLOBAL_POWER_POLICY) As Boolean

ole32

.

[DllImport("ole32.dll", SetLastError=true)]

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

<DllImport("ole32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, PreserveSig:=False)> _

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=true)]

.

<DllImport("ole32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True, PreserveSig:=False)> _

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

[DllImport("ole32.dll", CharSet = CharSet.Unicode)]

.

static extern void CoAllowSetForegroundWindow(

.
Documentation
[CoAllowSetForegroundWindow] on MSDN
.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

     Setting unloadDelay=INFINITE uses the system default delay (10 minutes).

.

     Setting unloadDelay=0 forces the unloading of any DLLs without any delay.

.

Setting the delay too short (or zero) can have unintended consequences, as some DLL's will return control before they have finished cleaning up resources, or they will continue executing in the background.

.

     Setting unloadDelay=INFINITE uses the system default delay (10 minutes).

.

     Setting unloadDelay=0 forces the unloading of any DLLs without any delay.

.

Setting the delay too short (or zero) can have unintended consequences, as some DLL's will return control before they have finished cleaning up resources, or they will continue executing in the background.

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, ExactSpelling=true, PreserveSig=false)]

.
Summary
Registers security and sets the default security values for the process, but this can't be directly called from managed code.
.

/// Do not set STAThread since CoInitializeSecurity is called

.

    // Set threading apartment

.
Summary
CoInitializeEx initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required. Values for the dwCoInit parameter are taken from the COINIT enumeration. 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.
.

    [DllImport("ole32.dll", CharSet = CharSet.Auto, SetLastError = true, CallingConvention = CallingConvention.StdCall)]

.
Summary
Registers security and sets the default security values for the process, but this can't be directly called from managed code.
.

/// Do not set STAThread since CoInitializeSecurity is called

.

    // Set threading apartment

.
Summary
The CoSetProxyBlanket API is not safe for use from managed code directly, you must use the .NET marshalling APIs to access the right COM functions.
.

static extern int CoSetProxyBlanket([MarshalAs(UnmanagedType.IUnknown)]

.

Please look at http://msdn2.microsoft.com/en-us/library/aa302389.aspx#secnetch09_callingservicedcompaspnet, which shows how to call CoSetProxyBlanket in C#. As this is published on the MS Patterns and Practices web site I would assume this would be OK and is safe. This reference has code and discusses the issues about transition from .net object to COM IUnknown reference using the Marshal functions.

.
Documentation
[CoSetProxyBlanket] on MSDN
.

    System.Threading.ManualResetEvent event = new System.Threading.ManualResetEvent(false);

.

    /// If set to FALSE, the caller must free the hGlobal after the final release. If set

.

    ExactSpelling=true, PreserveSig=true, CharSet=CharSet.Ansi,

.

          set {_strErrorMsg = value;}

.

     ExactSpelling=true, PreserveSig=true, CharSet=CharSet.Ansi,

.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

    [DllImport("ole32.dll", CharSet=CharSet.Unicode)]

.

    [DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

    [DllImport("ole32.dll", CharSet = CharSet.Unicode)]

.

    ///  property pages do not support persisting their settings.

.

    [DllImport("oleaut32.dll", CharSet=CharSet.Unicode, ExactSpelling=true) ]

.
Summary
.

static extern int OleSetClipboard(IDataObject pDataObj);

.

Public Shared Function OleSetClipboard(ByVal pDataObj As System.Runtime.InteropServices.ComTypes.IDataObject) As Int32

.
Documentation
[OleSetClipboard] on MSDN
.

[DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

    [DllImport("ole32.dll", CharSet=CharSet.Unicode, PreserveSig=false)]

.

Guids generated with this will return the name using the FmtIdToPropStgName Function, and can be used to generate a new IPropertyStorage interface with IPropertySetStorage.Create(). The name returned will be filled to 26 chars with the letter 'a' due to the fixed size of a Guid and the fact that we're passing all zeros in the BitArray after the name finishes to reach this size.

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


 
Access PInvoke.net directly from VS: