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]

ole32

.

System.Guid.NewGuid()

.

Have a look at [System.Activator.CreateInstance] and its various overloads. Sample:

.

Have a look at [System.Activator.CreateInstance] and its various overloads. Sample:

.

FILETIME, which is defined in [System.Runtime.InteropServices] or [System.Runtime.InteropServices.ComTypes] in the .NET Framework 2.0.

.

[System.DateTime.Now]

.

FILETIME, which is defined in [System.Runtime.InteropServices] or [System.Runtime.InteropServices.ComTypes] in the .NET Framework 2.0.

.

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

.

        System.Threading.Thread.Sleep((int)pause);

.

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

.

        System.Threading.Thread.Sleep((int)pause);

.

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

.

    System.Threading.Thread.CurrentThread.ApartmentState = ApartmentState.STA;

.

    System.Windows.Forms.Application.Run(Application.MainForm);

.

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

.

    System.Threading.Thread.CurrentThread.ApartmentState = ApartmentState.STA;

.

    System.Windows.Forms.Application.Run(Application.MainForm);

.

    System.IntPtr pAthnSvc = new IntPtr();

.

    System.IntPtr pAthzSvc = new IntPtr();

.

    System.IntPtr pAuthnLevel = new IntPtr();

.

    System.IntPtr pImpLevel = new IntPtr();

.

    System.IntPtr pPrivs = new IntPtr();

.

    System.IntPtr pCaps = new IntPtr(4);

.

Marshal.FreeCoTaskMem http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshal.freecotaskmem.aspx

.

static extern int CoUnmarshalInterface(System.Runtime.InteropServices.ComTypes.IStream pStm, [In] ref Guid riid,

.

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

.

    System.IntPtr[] waitHandles = { event.SafeWaitHandle.DangerousGetHandle() };

.

The managed definition for the IMoniker interface is available in System.Runtime.InteropServices.ComTypes

.

As of .NET 2.0, UCOMIMoniker is obsolete and has been replaced with System.Runtime.InteropServices.ComTypes.IMoniker. This extends to all interfaces of the System.Runtime.InteropServices namespace starting with "UCOM...". Each of them are replaced in the System.Runtime.InteropServices.ComTypes namespace, with same name, except for the "UCOM" at the beginning.

.

   out System.Runtime.InteropServices.ComTypes.IMoniker ppmk);

.

For .Net 2.0, use System.Runtime.InteropServices.ComTypes.IMoniker as the final parameter; frameworks 1.0 and 1.1 use System.Runtime.InteropServices.UCOMIMoniker.

.

As of .NET 2.0, UCOMIMoniker is obsolete and has been replaced with System.Runtime.InteropServices.ComTypes.IMoniker. This extends to all interfaces of the System.Runtime.InteropServices namespace starting with "UCOM...". Each of them are replaced in the System.Runtime.InteropServices.ComTypes namespace, with same name, except for the "UCOM" at the beginning.

.

   punk, out System.Runtime.InteropServices.ComTypes.IMoniker ppmk);

.

       [System.Runtime.InteropServices.DllImport("OLE32.DLL", EntryPoint = "CreateStreamOnHGlobal")] // Create a COM stream from a pointer in unmanaged memory

.

    extern public static int CreateStreamOnHGlobal(IntPtr ptr, bool delete, out System.Runtime.InteropServices.ComTypes.IStream pOutStm);

.

    [System.Runtime.InteropServices.DllImport("OLE32.DLL", EntryPoint = "GetHGlobalFromStream")]

.

       out System.Runtime.InteropServices.ComTypes.IRunningObjectTable pprot);

.

In .Net 2.0 use System.Runtime.InteropServices.ComTypes.IRunningObjectTabl as the second parameter. Frameworks 1.0 and 1.1 use a now deprecated type.

.

     System.Runtime.InteropServices.ComTypes.IRunningObjectTable objTbl;

. . .

I find it better to turn off [PreserveSig] for methods that return an HRESULT and have a trailing out parameter, providing that the HRESULT does not have more that one success code (typically S_OK only). This results in a slightly cleaner syntax where the out parameter becomes the return value and a failing HRESULT results in an exception.

.

using System.Diagnostics;

.

using System.Runtime.Interop;

.

[System.Guid] - overloaded constructor that takes a string.

.

using System;

.

using System.Runtime.InteropServices;

.

using System.Windows.Forms;

. . . . . .

The original signature requires a definition for the COM version of IDataObject, as defined in objidl.h. The lack of this definition implies that the [System.Windows.Forms.IDataObject] interface can be used, but this interface, although COM-visible, is not the same as the COM one and results in a [System.InvalidCastException].

.

The alternative posted uses an object, which can then be passed to a [System.Windows.Forms.DataObject] ctor. Ideally though there should be a complete definition for the COM [IDataObject] interface (and all of its supporting types).

.

I find it better to turn off [PreserveSig] for methods that return an HRESULT and have a trailing out parameter, providing that the HRESULT does not have more that one success code (typically S_OK only). This results in a slightly cleaner syntax where the out parameter becomes the return value and a failing HRESULT results in an exception.

.

using System.Diagnostics;

.

using System.Runtime.Interop;

.

using System.Windows.Forms;

.

[System.Windows.Forms.Clipboard.GetDataObject]

.

static extern int OleLoadFromStream(System.Runtime.InteropServices.ComTypes.IStream pStm,

.

static extern int OleLoadFromStream(System.Runtime.InteropServices.ComTypes.IStream pStm,

.

      [System.Runtime.InteropServices.DllImport("OLE32.DLL", EntryPoint = "CreateStreamOnHGlobal")]

.

    extern public static int CreateStreamOnHGlobal(IntPtr ptr, bool delete, out System.Runtime.InteropServices.ComTypes.IStream pOutStm);

.

        System.Runtime.InteropServices.ComTypes.STATSTG fileinfo;

.

    [System.Runtime.InteropServices.DllImport("OLE32.DLL", EntryPoint = "CreateStreamOnHGlobal")]

.

    extern public static int CreateStreamOnHGlobal(IntPtr ptr, bool delete, out System.Runtime.InteropServices.ComTypes.IStream pOutStm);

.

        System.Runtime.InteropServices.ComTypes.STATSTG fileinfo;

.

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

. .

I find it better to turn off [PreserveSig] for methods that return an HRESULT and have a trailing out parameter, providing that the HRESULT does not have more that one success code (typically S_OK only). This results in a slightly cleaner syntax where the out parameter becomes the return value and a failing HRESULT results in an exception.

.

using System.Diagnostics;

.

using System.Runtime.Interop;

30: STGC
.

The Visual Studio SDK now has an OLE InterOp dll (freely available) that wraps all the structured storage functionality. The System.IO.Package in the NET 3.0 also wraps it in internal methods - but you can access them through the packaging api's.

.

See StgOpenStorageEx for an example of using the System.IO.Packaging classes to access OLE structured storage.

.

The Visual Studio SDK now has an OLE InterOp dll (freely available) that wraps all the structured storage functionality. The System.IO.Package in the NET 3.0 also wraps it in internal methods - but you can access them through the packaging api's.

.

See StgOpenStorageEx for an example of using the System.IO.Packaging classes to access OLE structured storage.

.

The System.IO.Packaging namespace contains public StorageInfo and StreamInfo classes that encapsulate OLE structured storage access. Unfortunately, the StorageRoot class, which is needed to create or open the files, is an internal class. However, you can use reflection to access the methods on StorageRoot if necessary. The code below will open a storage file and convert it to XML where each stream is hex encoded.

.

        Type storageRootType = typeof(StorageInfo).Assembly.GetType("System.IO.Packaging.StorageRoot", true, false);

icmp

.

    using System;

.

    using System.Net;

.

    using System.Runtime.InteropServices;

.

tcc -Wall ping.c /WINDOWS/system32/iphlpapi.dll /windows/system32/ws2_32.dll

uxtheme

.

    // System Button States

.

    catch(System.Exception exc)

.

Parameters have the same meaning as for SetSystemVisualStyle, except the new hThemeFile one which is the result of the function.

.
Summary
Changes System Visual Style
.

public static extern int SetSystemVisualStyle(string pszFilename, string pszColor, string pszSize, int dwReserved);

.

Shared Function SetSystemVisualStyle(ByVal pszFilename As String, ByVal pszColor As String, ByVal pszSize As String, ByVal dwReserved As Integer) As Integer

.

SetSystemVisualStyle(@"C:\WINDOWS\resources\Themes\Luna\Luna.msstyles", "Metallic", "NormalSize", 0);

.

SetSystemVisualStyle("C:\WINDOWS\resources\Themes\Luna\Luna.msstyles", "Metallic", "NormalSize", 0)

.

The System.Windows.Forms.VisualStyles namespace allows rendering of various Visual Style elements, which sometimes can be cumbersome if you have alot of elements to work with or just want to keep the code to a minimal (or are on the design team and not the code team). Or you can get the freeware .NET component to place VisualStyleElement parts in the IDE forms designer using the VisualStyleRenderer .NET control. You can

user32

.

[System.Windows.Forms.InputLanguage]

.
Summary
Places the given window in the system-maintained clipboard format listener list.
.

System.Windows.Rect

.

AllowSetForegroundWindow(System.Diagnostics.Process.GetCurrentProcess().Id)

.

The system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:

.

- The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).

.

Imports System.Runtime.InteropServices

.

    Private Shared Function GetSystemMenu(ByVal hWnd As IntPtr, ByVal bRevert As Boolean) As IntPtr

.

        Dim hMenu = GetSystemMenu(Me.Handle, False)

.

Public Shared Function AttachThreadInput(ByVal idAttach As System.UInt32, ByVal idAttachTo As System.UInt32, ByVal fAttach As Boolean) As Boolean

.

If the system must increase the size of the multiple-window- position structure beyond the initial size specified by the nNumWindows parameter but cannot allocate enough memory to do so, the system fails the entire window positioning sequence (BeginDeferWindowPos

.
Summary
.

static extern int BroadcastSystemMessageEx(uint flags, ref uint lpInfo, uint Msg, [MarshalAs(UnmanagedType.SysUInt)] ulong wParam, [MarshalAs(UnmanagedType.SysInt)] long lParam, out BSMINFO pbsmInfo);

.
Documentation
[BroadcastSystemMessageEx] on MSDN
.

  System.Diagnostics.Process.Start("Shutdown", "-a");

.

static extern bool CheckDlgButton(IntPtr hDlg, int nIDButton, System.Windows.Forms.CheckState uCheck);

.

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

.

System.Windows.Forms.Cursor.Clip

.

I read on google about a flaw in the .Net System.Windows.Forms.Clipboard.SetDataObject

.

     System.Windows.Forms.Clipboard.SetDataObject("your message here \n if you would like", true);

.

     System.Windows.Forms.Clipboard.SetDataObject("your message here \n if you would like", true);

.

System.Windows.Forms.Clipboard.SetDataObject("your message here \n if you would like", true);

.

private static extern bool SetSystemCursor(IntPtr hcur, uint id);

.

string folderPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

.

   SetSystemCursor(LoadCursor(IntPtr.Zero, OCR_WAIT), OCR_NORMAL);

.

     SetSystemCursor(CopyIcon(cursor), OCR_NORMAL);

.

     SetSystemCursor(LoadCursor(IntPtr.Zero, OCR_WAIT), OCR_NORMAL);

.

    private void button1_Click(object sender, System.EventArgs e) {

.

    Using s As New System.IO.MemoryStream(embeddedBitmap)

.

If you come across this error "System.Runtime.InteropServices.MarshalDirectiveException: Cannot marshal 'parameter #6': Invalid managed/unmanaged type combination (this value type must be paired with Struct).", you may want to use

.

        [System.Runtime.InteropServices.ComRegisterFunctionAttribute()]

.

                System.Console.WriteLine(e.ToString());

.

        [System.Runtime.InteropServices.ComUnregisterFunctionAttribute()]

.

                System.Console.WriteLine(e.ToString());

.

/// <param name="lpClassName">Pointer to a null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names.</param>

.

/// <param name="x">Specifies the initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner of the parent window's client area. If x is set to CW_USEDEFAULT, the system selects the default position for the window's upper-left corner and ignores the y parameter. CW_USEDEFAULT is valid only for overlapped windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero.</param>

.

/// <param name="nWidth">Specifies the width, in device units, of the window. For overlapped windows, nWidth is the window's width, in screen coordinates, or CW_USEDEFAULT. If nWidth is CW_USEDEFAULT, the system selects a default width and height for the window; the default width extends from the initial x-coordinates to the right edge of the screen; the default height extends from the initial y-coordinate to the top of the icon area. CW_USEDEFAULT is valid only for overlapped windows; if CW_USEDEFAULT is specified for a pop-up or child window, the nWidth and nHeight parameter are set to zero.</param>

.

/// <param name="nHeight">Specifies the height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If the nWidth parameter is set to CW_USEDEFAULT, the system ignores nHeight.</param> <param name="hWndParent">Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows.

.

/// <item>the system class was registered by a different module</item>

.

''' <param name="lpClassName">Pointer to a null-terminated string or a class atom created by a previous call to the RegisterClass or RegisterClassEx function. The atom must be in the low-order word of lpClassName; the high-order word must be zero. If lpClassName is a string, it specifies the window class name. The class name can be any name registered with RegisterClass or RegisterClassEx, provided that the module that registers the class is also the module that creates the window. The class name can also be any of the predefined system class names.</param>

.

''' <param name="x">Specifies the initial horizontal position of the window. For an overlapped or pop-up window, the x parameter is the initial x-coordinate of the window's upper-left corner, in screen coordinates. For a child window, x is the x-coordinate of the upper-left corner of the window relative to the upper-left corner of the parent window's client area. If x is set to CW_USEDEFAULT, the system selects the default position for the window's upper-left corner and ignores the y parameter. CW_USEDEFAULT is valid only for overlapped windows; if it is specified for a pop-up or child window, the x and y parameters are set to zero.</param>

.

''' <param name="nWidth">Specifies the width, in device units, of the window. For overlapped windows, nWidth is the window's width, in screen coordinates, or CW_USEDEFAULT. If nWidth is CW_USEDEFAULT, the system selects a default width and height for the window; the default width extends from the initial x-coordinates to the right edge of the screen; the default height extends from the initial y-coordinate to the top of the icon area. CW_USEDEFAULT is valid only for overlapped windows; if CW_USEDEFAULT is specified for a pop-up or child window, the nWidth and nHeight parameter are set to zero.</param>

.

''' <param name="nHeight">Specifies the height, in device units, of the window. For overlapped windows, nHeight is the window's height, in screen coordinates. If the nWidth parameter is set to CW_USEDEFAULT, the system ignores nHeight.</param> <param name="hWndParent">Handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. This parameter is optional for pop-up windows.

.

''' <item>the system class was registered by a different module</item>

.

using System;

.

using System.Collections.Generic;

.

using System.ComponentModel;

.

using System.Diagnostics;

.

using System.Linq;

.

using System.Text;

.

using System.Runtime.InteropServices;

.

            wndclass.hIcon = Win32.LoadIcon(IntPtr.Zero, new IntPtr((int)SystemIcons.IDI_APPLICATION));

.

Instantiate a [System.Windows.Forms.Form] and set its properties to control its style.

.

The [System.Windows.Forms.NativeWindow] class can be used to encapsulate a window handle. It provides properties and methods that can be used to perform the same behavior as the CreateWindowEx method.

.

[System.Windows.Forms.Form.Close]

.

        System.Threading.Thread.Sleep(10);

.

        if (range.Height > SystemInformation.DragSize.Height

.

                || range.Width > SystemInformation.DragSize.Width)

.

    public const System.Int32 IDANI_OPEN = 1;

.

    public const System.Int32 IDANI_CAPTION = 3;

.

    [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential)]

.

      public RECT(System.Drawing.Rectangle rectangle)

.

      public RECT(System.Drawing.Point location, System.Drawing.Size size)

.

      public System.Int32 Left;

.

      public System.Int32 Top;

.

      public System.Int32 Right;

.

      public System.Int32 Bottom;

.

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

.

    static extern bool DrawAnimatedRects(System.IntPtr hwnd, int idAni,

.

      [System.Runtime.InteropServices.In] ref RECT lprcFrom,

.

      [System.Runtime.InteropServices.In] ref RECT lprcTo);

.

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

.

    static extern System.IntPtr FindWindow(string lpClassName, string lpWindowName);

.

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

.

    static extern System.IntPtr FindWindowEx(System.IntPtr hwndParent, System.IntPtr hwndChildAfter,

.

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

.

    static extern bool GetWindowRect(System.IntPtr hWnd, out RECT lpRect);

.

    static public void ShowHideAnimated(System.Windows.Forms.Form form, System.Boolean show)

.

      System.IntPtr hWnd =

.

        FindWindowEx(FindWindow("Shell_TrayWnd", null), System.IntPtr.Zero, "TrayNotifyWnd", null);

.

      if (hWnd != System.IntPtr.Zero)

.

        to.Left = System.Windows.Forms.SystemInformation.VirtualScreen.Right - form.Width;

.

        to.Top = System.Windows.Forms.SystemInformation.VirtualScreen.Bottom -

.

          System.Windows.Forms.SystemInformation.CaptionHeight -

.

            (System.Windows.Forms.SystemInformation.FrameBorderSize.Height * 2);

.

        to.Right = System.Windows.Forms.SystemInformation.VirtualScreen.Right;

.

        to.Bottom = System.Windows.Forms.SystemInformation.VirtualScreen.Bottom;

.

    [StructLayout(System::Runtime::InteropServices::LayoutKind::Sequential)]

.

    RECT(System::Drawing::Rectangle rectangle) {

.

    RECT(System::Drawing::Point location, System::Drawing::Size size) {

.

    System::Int32 Left;

.

    System::Int32 Top;

.

    System::Int32 Right;

.

    System::Int32 Bottom;

.

          to->Left = System::Windows::Forms::SystemInformation::VirtualScreen.Rig ht - 32;

.

          to->Top = System::Windows::Forms::SystemInformation::VirtualScreen.Bot tom -32;

.

          to->Right = System::Windows::Forms::SystemInformation::VirtualScreen.Rig ht;

.

          to->Bottom = System::Windows::Forms::SystemInformation::VirtualScreen.Bot tom;

.

#define DFCS_INMENU 0x0040 /* modifier for DFC_MENU as captionbtn drawn in systemmenu */

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


 
Access PInvoke.net directly from VS: