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

credui

.

    while (true) //Show the dialog again and again, until Cancel is clicked or the entered credentials are correct.

.

        For example, it returns a bool 'credentialsEnteredCorrect':*/

.

      bool credentialsEnteredCorrect = false;

.

      if (credentialsEnteredCorrect) break; //Break the while-loop, if the entered credentials are correct.

difxapi

.
Summary
The DriverPackagePreinstall function preinstalls a driver package for a Plug and Play (PnP) function driver in the driver store and installs the INF file for the driver package in the system INF file directory.

dhcpsapi

.
Summary
Enumerate directory server for DHCP servers. Works with Active Directory.

cards

.

        Dim cardValue As Integer = DirectCast(suit, Integer) + faceValue * 4

.

        Dim cardValue As Integer = DirectCast(suit, Integer) + faceValue * 4

.

        cdtDrawExt(hDc, x, y, width, height, DirectCast(deck, Integer), 1, 0)

.

        cdtDraw(hDc, x, y, DirectCast(deck, Integer), 1, 0)

.

        cdtDrawExt(hDc, x, y, width, height, DirectCast(CardDeck.CrossHatch, Integer), 1, Card.ConvertColor(backgroundColor))

.

        cdtDraw(hDc, x, y, DirectCast(CardDeck.CrossHatch, Integer), 1, Card.ConvertColor(backgroundColor))

.

        Dim cardValue As Integer = DirectCast(suit, Integer) + faceValue * 4

.

        Dim cardValue As Integer = DirectCast(suit, Integer) + faceValue * 4

.

        cdtDrawExt(hDc, x, y, width, height, DirectCast(deck, Integer), 1, 0)

.

        cdtDraw(hDc, x, y, DirectCast(deck, Integer), 1, 0)

.

        cdtDrawExt(hDc, x, y, width, height, DirectCast(CardDeck.CrossHatch, Integer), 1, Card.ConvertColor(backgroundColor))

.

        cdtDraw(hDc, x, y, DirectCast(CardDeck.CrossHatch, Integer), 1, Card.ConvertColor(backgroundColor))

comctl32

.
Summary
Enters the control in 'ReaderMode' a mouse scrolling mode that allows you to scroll in any direction by moving the mouse pointer. Callbacks are used to inform the control of the offset it should scroll. The Control is responsible for updating the scroll position. The function must be passed the READERMODEINFO structure. This function has no public header and must be referenced as ordinal 383, as per MSDN documentation.
.

RECT

.

        Dim rect As New RECT(Me.Width / 2 - 20, Me.Height / 2 - 20, Me.Width / 2 + 20, Me.Height / 2 + 20)

.

        Dim pnt As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(rect))

.

        Marshal.StructureToPtr(rect, pnt, True)

.

       public static void Draw(this ImageList imageList, Graphics g, Rectangle bounds, int index, ImageListDrawColor bgColor, ImageListDrawColor fgColor, NativeMethods.ImageListDrawingStyle style = NativeMethods.ImageListDrawingStyle.Normal, int overlayImageIndex = 0)

.

       public static void Draw(this ImageList imageList, Graphics g, Rectangle bounds, int index, ImageListDrawColor bgColor, ImageListDrawColor fgColor, NativeMethods.ImageListDrawingStyle style = NativeMethods.ImageListDrawingStyle.Normal, int overlayImageIndex = 0)

.
Summary
TaskDialogIndirect - Show a Vista TaskDialog with custom button names and many other features.
.

static extern HRESULT TaskDialogIndirect

.

    public static extern IntPtr TaskDialogIndirect

.

TaskDialogIndirect(ref config, out ret, out selRadio, out setVerification);

.

Declare Function TaskDialogIndirect Lib "comctl32.dll" (TODO) As TODO

.

Private Shared Function TaskDialogIndirect(<[In]> pTaskConfig As TASKDIALOGCONFIG, <Out> ByRef pnButton As Integer, <Out> ByRef pnRadioButton As Integer, <MarshalAs(UnmanagedType.Bool), Out> ByRef pfverificationFlagChecked As Boolean) As HRESULT

.

A full wrapper for Vista's TaskDialog & TaskDialogIndirect can be found here:

.

    /// <summary>The TaskDialogIndirect function creates, displays, and operates a task dialog. The task dialog contains application-defined icons, messages, title, verification check box, command links, push buttons, and radio buttons. This function can register a callback function to receive notification messages.</summary>

.

    internal static extern Result TaskDialogIndirect([In] TaskDialogConfig taskConfig, [Out] out int button, [Out] out int radioButton, [MarshalAs(UnmanagedType.Bool), Out] out bool verificationFlagChecked);

.
Documentation
[TaskDialogIndirect] on MSDN
.
Summary
TaskDialogIndirect - Show a Vista TaskDialog with custom button names and many other features.
.

static extern HRESULT TaskDialogIndirect

.

    public static extern IntPtr TaskDialogIndirect

.

TaskDialogIndirect(ref config, out ret, out selRadio, out setVerification);

.

Declare Function TaskDialogIndirect Lib "comctl32.dll" (TODO) As TODO

.

Private Shared Function TaskDialogIndirect(<[In]> pTaskConfig As TASKDIALOGCONFIG, <Out> ByRef pnButton As Integer, <Out> ByRef pnRadioButton As Integer, <MarshalAs(UnmanagedType.Bool), Out> ByRef pfverificationFlagChecked As Boolean) As HRESULT

.

A full wrapper for Vista's TaskDialog & TaskDialogIndirect can be found here:

.

    /// <summary>The TaskDialogIndirect function creates, displays, and operates a task dialog. The task dialog contains application-defined icons, messages, title, verification check box, command links, push buttons, and radio buttons. This function can register a callback function to receive notification messages.</summary>

.

    internal static extern Result TaskDialogIndirect([In] TaskDialogConfig taskConfig, [Out] out int button, [Out] out int radioButton, [MarshalAs(UnmanagedType.Bool), Out] out bool verificationFlagChecked);

.
Documentation
[TaskDialogIndirect] on MSDN

wintrust

.

         UntrustedRoot = 0x800B0109          // CERT_E_UNTRUSTEDROOT - A certification chain processed correctly but terminated in a root certificate that is not trusted by the trust provider.

mpr

.

        RESOURCEDISPLAYTYPE_DIRECTORY,

.

        CONNECT_REDIRECT = 0X80,

.
Summary
The WNetAddConnection2 function makes a connection to a network resource. The function can redirect a local device to the network resource.
.

  //      RESOURCEDISPLAYTYPE_DIRECTORY,

.

    Directory = 0x09,

.

        RESOURCEDISPLAYTYPE_DIRECTORY,

.

    RESOURCEDISPLAYTYPE_DIRECTORY = 0x00000009,

.

    RESOURCEDISPLAYTYPE_DIRECTORY = &H9

.
Summary
Makes a connection to a network resource. The function can redirect a local device to a network resource.
.

    DIRECTORY    = 0x00000009,

.

    REDIRECT        = 0x00000080,

rasapi32

.

        RASET_Direct = 3,

.

Call RasGetEntryProperties beforehand, passing to it a null RASENTRY to get the correct buffer size (dwEntryInfoSize below).

aygshell

.

Microsoft.SmartDevice.Connectivity.Device.ProvisionDevice(string, Device.ConfigActions), although it is a desktop managed method and only works remotely, whereas this P/Invoke can be executed directly on the device.

userenv

.
Summary
Create a user profile directory structure in the profile's directory
.
Summary
Determines the profiles directory on the current machine. ie c:\Users on Vista and later
.

static extern bool GetProfilesDirectory(StringBuilder path, ref int size);

.

   if (GetProfilesDirectory(path, ref size) )

.

    if (GetProfilesDirectory(path, &size) ) {

.

        MessageBox(NULL, path, "GetProfilesDirectory()", MB_OK);

.

WINBOOL WINAPI GetProfilesDirectoryA(LPSTR lpProfileDir, LPDWORD lpcchSize);

.

    if (GetProfilesDirectory(path, &size) ) {

.

        MessageBox(NULL, path, "GetProfilesDirectory()", MB_OK);

.
Documentation
[GetProfilesDirectory] on MSDN

msvcrt

20: fopen
.

// "incorrect" way

.

// "correct" way

21: memcmp
.
WARNING
22: memcpy
.

        new Rectangle(0, 0, width, height),

.

        new Rectangle(0, 0, width, height),

hhctrl

.

    struct RECT

.

        public RECT(int left, int top, int right, int bottom)

.

        public RECT(Rectangle r)

.

        public static RECT FromXYWH(int x, int y, int width, int height)

.

            return new RECT(x, y, x + width, y + height);

.

        internal RECT rcMargins = RECT.FromXYWH(-1, -1, -1, -1);

printui

.

Advantages of using the function directly in your program instead of calling rundll32.exe are meanful error codes and no external process needs to be called resulting in more control.

winhttp

.

ERROR_WINHTTP_INCORRECT_HANDLE_TYPE - The type of handle supplied is incorrect for this operation.

winscard

.

SCARD_SHARE_DIRECT = 0x00000003 - Direct control of the reader, even without a card

shell32

.
Summary
Structure for using SHAppBarMessage. Also needs the RECT structure.
.

    //        RECT rc;

.

    public RECT rc;

.
Summary
.

    public RECT rc;

.

    Public rc As RECT

.

    public RECT rc;

.

    // The previous examples on this page used incorrect

30: CSIDL
.

            CSIDL_DESKTOPDIRECTORY      = 0x0010,    // <user name>\Desktop

.

            CSIDL_COMMON_DESKTOPDIRECTORY   = 0x0019,    // All Users\Desktop

.

            CSIDL_WINDOWS           = 0x0024,    // GetWindowsDirectory()

.

            CSIDL_SYSTEM            = 0x0025,    // GetSystemDirectory()

.

            CSIDL_SYSTEMX86         = 0x0029,    // x86 system directory on RISC

31: CSIDL
.

        /// Version 5.0. The file system directory that is used to store administrative tools for an individual user.

.

        /// The Microsoft Management Console (MMC) will save customized consoles to this directory, and it will roam with the user.

.

        /// The file system directory that corresponds to the user's nonlocalized Startup program group.

.

        /// Version 4.71. The file system directory that serves as a common repository for application-specific data.

.

        /// Version 6.0. The file system directory acting as a staging area for files waiting to be written to CD.

.

        /// Version 5.0. The file system directory containing administrative tools for all users of the computer.

.

        /// The file system directory that corresponds to the nonlocalized Startup program group for all users.

.

        /// Version 5.0. The file system directory containing application data for all users. A typical path is

.

        /// The file system directory that contains files and folders that appear on the desktop for all users.

.

        CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019,

.

        /// The file system directory that contains documents that are common to all users. A typical paths is

.

        /// The file system directory that serves as a common repository for favorite items common to all users.

.

        /// Version 6.0. The file system directory that serves as a repository for music files common to all users.

.

        /// Version 6.0. The file system directory that serves as a repository for image files common to all users.

.

        /// The file system directory that contains the directories for the common program groups that appear on the

.

        /// The file system directory that contains the programs and folders that appear on the Start menu for all users.

.

        /// The file system directory that contains the programs that appear in the Startup folder for all users.

.

        /// The file system directory that contains the templates that are available to all users. A typical path is

.

        /// Version 6.0. The file system directory that serves as a repository for video files common to all users.

.

        /// The file system directory that serves as a common repository for Internet cookies. A typical path is

.

        /// The file system directory used to physically store file objects on the desktop (not to be confused with

.

        CSIDL_DESKTOPDIRECTORY = 0x0010,

.

        /// The file system directory that serves as a common repository for the user's favorite items. A typical path is

.

        CSIDL_HISTORY = 0x0022, // The file system directory that serves as a common repository for Internet history items.

.

        /// Version 4.72. The file system directory that serves as a common repository for temporary Internet files.

.

        /// Version 5.0. The file system directory that serves as a data repository for local (nonroaming) applications.

.

        /// The file system directory that serves as a common repository for music files. A typical path is

.

        /// Version 5.0. The file system directory that serves as a common repository for image files.

.

        /// Version 6.0. The file system directory that serves as a common repository for video files.

.

        /// A file system directory containing the link objects that may exist in the My Network Places virtual folder.

.

        /// Previous to Version 6.0. The file system directory used to physically store a user's common repository of documents.

.

        /// The file system directory that contains the link objects that can exist in the Printers virtual folder.

.

        /// Version 6.0. The file system directory containing user profile folders. A typical path is C:\Documents and Settings.

.

        /// The file system directory that contains the user's program groups (which are themselves file system directories).

.

        /// The file system directory that contains shortcuts to the user's most recently used documents. A typical path is

.

        /// The file system directory that contains Send To menu items. A typical path is C:\Documents and Settings\username\SendTo.

.

        /// The file system directory containing Start menu items. A typical path is C:\Documents and Settings\username\Start Menu.

.

        /// The file system directory that corresponds to the user's Startup program group. The system starts these programs

.

        /// The file system directory that serves as a common repository for document templates. A typical path is

.

        /// Version 5.0. The Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables.

.

this.fileSystemWatcher.IncludeSubdirectories = true;

.

static extern IntPtr FindExecutable(string lpFile, string lpDirectory, [Out] StringBuilder lpResult);

.

Private Shared Function FindExecutable(ByVal lpFile As String, ByVal lpDirectory As String, ByRef lpResult As StringBuilder) As IntPtr

.

            string lpFile, string lpDirectory, StringBuilder lpResult);

.

/// It is recommended to call that function directly to determine Administrator group status rather than calling IsUserAnAdmin.

.

''' It is recommended to call that function directly to determine Administrator group status rather than calling IsUserAnAdmin.

.

    /// <param name="prcClip">A pointer to a RECT structure that specifies a selection within the window's

.

struct RECT{

.
Summary
Removes illegal characters from a file or directory name. Enforces the 8.3 filename format on drives that do not support long file names.
37: Run
.

public static extern string Shell(IntPtr HWND, string operation, string file, string parameters, string directory, int showcmd);

.

///         Retrieves the bounding rectangle of the Windows taskbar. Note that this applies only to the

.

    Public Structure RECT

.

    Public rc As RECT

.

    Public T_SIZE As RECT

.

        // Browsing for directory.

.

You need to be in an STA thread for the BIF_NEWDIALOGSTYLE to work correctly. Use the STAThread attribute on your Main function, or create a new thread and call SetApartmentState before it is started. The default apartment state is MTA so if this isn't working for you, that could be why.

.

Shell Notifications in C# [http://www.thecodeproject.com/csharp/shellnotifications.asp] (Note: the parameter to this function is incorrect in the example. The C# Signature above is correct)

.
Summary
.

static extern int SHCreateDirectoryEx(IntPtr hwnd, string pszPath, IntPtr psa);

.

SHCreateDirectoryEx(IntPtr.Zero, @"D:\test\", IntPtr.Zero);

.
Documentation
[SHCreateDirectoryEx] on MSDN
.

    <MarshalAs(UnmanagedType.LPTStr)> Public lpDirectory As String

.

        public string lpDirectory;

.

"explore"    - Opens the Windows Explorer in the folder specified in lpDirectory.

.

Retrieves the Notifyicon bounding rectangle.

.

    static extern int Shell_NotifyIconGetRect([In]ref NOTIFYICONIDENTIFIER identifier, [Out]out RECT iconLocation);

.

RECT

.

    public struct RECT

.

    private static extern int Shell_NotifyIconGetRect([In]ref NOTIFYICONIDENTIFIER identifier, [Out]out RECT iconLocation);

.

    public static RECT GetNotifyIconRect(IntPtr windowHandle, uint taskbarIconId)

.

        var rect = new RECT();

.

        var hresult = Shell_NotifyIconGetRect(ref notifyIcon, out rect);

.

        return rect;

.
Documentation
[Shell_NotifyIconGetRect] on MSDN
.

Retrieves the Notifyicon bounding rectangle.

.

    static extern int Shell_NotifyIconGetRect([In]ref NOTIFYICONIDENTIFIER identifier, [Out]out RECT iconLocation);

.

RECT

.

    public struct RECT

.

    private static extern int Shell_NotifyIconGetRect([In]ref NOTIFYICONIDENTIFIER identifier, [Out]out RECT iconLocation);

.

    public static RECT GetNotifyIconRect(IntPtr windowHandle, uint taskbarIconId)

.

        var rect = new RECT();

.

        var hresult = Shell_NotifyIconGetRect(ref notifyIcon, out rect);

.

        return rect;

.
Documentation
[Shell_NotifyIconGetRect] on MSDN
.
  • Correctly treat pTo and pFrom as zero delimited double zero terminated.
.

            FOF_NORECURSION = 0x1000,  // don't recurse into directories.

.

        // Version 5.0. The file system directory that is used

.

        // consoles to this directory, and it will roam with the user.

.

        // Version 5.0. The file system directory containing

.

        // Version 4.71. The file system directory that serves as

.

        // Version 5.0. The file system directory containing

.

        // The file system directory that contains documents

.

        // The file system directory that serves as a common repository

.

        // The file system directory that serves as a common repository

.

        // Version 4.72. The file system directory that serves as

.

        // Version 5.0. The file system directory that serves as a data

.

        // Version 5.0. The file system directory that serves as

.

        // Previous to Version 6.0. The file system directory used to

.

        // Version 5.0. The Windows directory or SYSROOT.

.

        // Fonts directory. A typical path is c:\Windows\Fonts.

.

        CSIDL_DESKTOPDIRECTORY    = 0x0010,    // <user name>\Desktop

.

        CSIDL_COMMON_DESKTOPDIRECTORY = 0x0019,    // All Users\Desktop

.

        CSIDL_WINDOWS         = 0x0024,    // GetWindowsDirectory()

.

        CSIDL_SYSTEM          = 0x0025,    // GetSystemDirectory()

.

        CSIDL_SYSTEMX86           = 0x0029,    // x86 system directory on RISC

.

        Throw New ApplicationException("Can't get window's directory")

.

    /// Gets the system fonts directory path.

.

    /// <returns>The fonts directory path</returns>

.

    private static String GetFontsDirectory()

.

    struct RECT

.

    public RECT rcImage;

.

        int GetImageRect(

.

        ref RECT prc);

.

SHGetImageList is not exported correctly in XP. See http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q316931

.

        Throw New ApplicationException("Can't get specified directory.")

.

    COMMON_DESKTOPDIRECTORY = &H19

.

    DESKTOPDIRECTORY = &H10

.

/// <param name="pidl">Address of an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop).</param>

.

''' <param name="pidl">Address of an item identifier list that specifies a file or directory location relative to the root of the namespace (the desktop).</param>

.
.

    fileP = My.Computer.FileSystem.SpecialDirectories.MyDocuments

.

    MessageBox.Show(c.FileSystem.SpecialDirectories.MyDocuments);

.
.

        CSIDL_DESKTOPDIRECTORY      = 0x0010,    // <user name>\Desktop

.

        CSIDL_COMMON_DESKTOPDIRECTORY   = 0x0019,    // All Users\Desktop

.

        CSIDL_WINDOWS       = 0x0024,    // GetWindowsDirectory()

.

        CSIDL_SYSTEM        = 0x0025,    // GetSystemDirectory()

.

        CSIDL_SYSTEMX86     = 0x0029,    // x86 system directory on RISC

.

System.Drawing.SystemIcons, although note that not all icons are included and at least the Shield icon is incorrect on Win 7 / Win 2008.

.

(not 100% certain this is correct, need to test)

.

    ''' Sets the parent directory containing the files that will be selected.

.

Setting Pack = 4 correctly aligns the data and doesn't add any padding bytes that throw off struct size/values.

.

        /// A full-screen (exclusive mode) Direct3D application is running.

.

        RunningDirect3dFullScreen = 3,

.

        /// Calculates the working directory from the file name

.

        CalcDirectory = 0x0004,

.

        RunFileDialogFlags.CalcDirectory

ntdsapi

.
Summary
The DsCrackNames function converts an array of directory service object names from one format to another. Name conversion enables client applications to map between the multiple names used to identify various directory service objects. For example, user objects can be identified by SAM account names (domain\username), user principal name (username@domain.com), or distinguished name.
.

The success of the name conversion request depends on where the client is bound. Clients bind to specific instances of the directory service using some variant of DsBind. If bound to a global catalog, the scope of the name mapping is the entire forest. If not bound to a global catalog, the scope of the name mapping is the domain not covered by a global catalog for that domain controller. If not bound to a global catalog and a name is not found, but the input name unambiguously identifies its domain and this domain is in the forest, then the return data identifies the DNS domain name for the domain of interest. Clients are expected to use this data to bind to the correct domain controller or global catalog and call DsCrackNames again with the new bind handle.

.

System.DirectoryServices.ActiveDirectory.

.
Summary
The DsUnBind function finds an RPC session with a domain controller and unbinds a handle to the directory service (DS).

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


 
Access PInvoke.net directly from VS: