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]

odbccp32

.

SQLInstallerError does not post error values for itself. SQLInstallerError returns SQL_NO_DATA when it is unable to retrieve any error information (in which case pfErrorCode is undefined). If SQLInstallerError cannot access error values for any reason that would normally return SQL_ERROR, SQLInstallerError returns SQL_ERROR but does not post any error values. If either the lpszErrorMsg argument is NULL or the cbErrorMsgMax is less than or equal to 0, this function returns SQL_ERROR. If the buffer for the error message is too short, SQLInstallerError returns SQL_SUCCESS_WITH_INFO and returns the correct pfErrorCode value for SQLInstallerError.

winmm

.

    private const uint MIDICAPS_STREAM = 8;      // driver supports midiStreamOut directly

.

Unlike Environment.TickCount, you can directly set the resolution of this timer with the TimeBeginPeriod function.

.

        WAVE_FORMAT_DIRECT = 8

.

  WAVE_FORMAT_DIRECT = 8

.

  WAVE_FORMAT_DIRECT = 8

.

Use "Auto" in the Declare statement to have the correct character set selected automatically.

.

See http://social.msdn.microsoft.com/Forums/en-US/windowspro-audiodevelopment/thread/14926e01-635e-4360-998b-ec6124d888a7 - correct C# signature at the bottom (including uDeviceId). This is based on http://msdn.microsoft.com/en-us/library/windows/desktop/dd743866%28v=vs.85%29.aspx which shows a UINT_PTR for that parameter. Note that the _PTR parameters are the only ones that are different sizes in 32 vs. 64 bit mode. In .Net you use IntPtr for that purpose.

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

fbwflib

.
Summary
Adds a file or directory to the exclusion list.
.
Summary
Retrieves the list of files and directories in the exclusion list.
.
Summary
Removes a file or directory from the exclusion list.

httpapi

.

If your use of this API is focused around a single value of ConfigId, you may want to change the IntPtr (pConfigInformation) to point directly to a managed version of the correct underlying structure and let the default marshaller take care of the interop layer marshaling for you (and your memory management).

.

If your use of this API is focused around a single value of ConfigId, you may want to change the IntPtr (pConfigInformation) to point directly to a managed version of the correct underlying structure and let the default marshaller take care of the interop layer marshaling for you (and your memory management).

.

If your use of this API is focused around a single value of ConfigId, you may want to change the IntPtr (pConfigInformation) to point directly to a managed version of the correct underlying structure and let the default marshaller take care of the interop layer marshaling for you (and your memory management).

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,

winhttp

.

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

shlwapi

.

    void SetWindow(IntPtr hwnd, ref RECT rect);

.

    void SetRect(ref RECT rect);

.
Summary
PathAddBackslash - Adds a backslash to the end of a string to create the correct syntax for a path.
.

/// Adds a backslash to the end of a string to create the correct syntax for a path.

.

''' Adds a backslash to the end of a string to create the correct syntax for a path.

.

Current signature is incorrect, because return value is string and CLR trying to release the same string twice (return value and lpszDest). I have unxpected crashes. I think that type of return value should change to IntPtr. This page contains some discussion about this problem: http://objectmix.com/dotnet/747522-p-invoke-signature-pathcombine.html

.
Summary
PathFileExists - Determines whether a path to a file system object such as a file or directory is valid
.

/// Determines whether a path to a file system object such as a file or directory is valid.

.

''' Determines whether a path to a file system object such as a file or directory is valid.

.

ppszOtherDirs is a list of specific directories to search first. It can be null if you want to search only the PATH.

.
Summary
PathIsDirectory - Verifies that a path is a valid directory
.

/// Verifies that a path is a valid directory.

.

/// <returns>Returns (BOOL)FILE_ATTRIBUTE_DIRECTORY if the path is a valid directory; otherwise, FALSE.</returns>

.

[DllImport("shlwapi.dll", EntryPoint = "PathIsDirectoryW",  SetLastError = True, CharSet= CharSet.Unicode)]

.

static extern bool PathIsDirectory([MarshalAs(UnmanagedType.LPTStr)]string pszPath);

.

''' Verifies that a path is a valid directory.

.

''' <returns>Returns (BOOL)FILE_ATTRIBUTE_DIRECTORY if the path is a valid directory; otherwise, FALSE.</returns>

.

<DllImport("shlwapi.dll", EntryPoint:="PathIsDirectoryW",  SetLastError:=True, CharSet:=CharSet.Unicode)> _

.

Public Function PathIsDirectory(<MarshalAs(UnmanagedType.LPTStr)>pszPath As String) As <MarshalAs(UnmanagedType.Bool)> Boolean

.

Public Declare Function PathIsDirectory Lib "shlwapi" Alias "PathIsDirectoryA" _

.

bool System.IO.Directory.Exists(string path)

.

http://msdn.microsoft.com/en-us/library/system.io.directory.exists%28v=vs.110%29.aspx

.
Documentation
[PathIsDirectory] on MSDN
.
Summary
PathIsRoot - Parses a path to determine if it is a directory root.
.

/// Parses a path to determine if it is a directory root.

.

''' Parses a path to determine if it is a directory root.

.

    ''' <param name="dwAttrFrom">The file attributes of <paramref name="pszFrom" />. If this value contains Directory, <paramref name="pszFrom" /> is assumed to be a directory; otherwise, <paramref name="pszFrom" /> is assumed to be a file</param>

.

    ''' <param name="dwAttrTo">The file attributes of <paramref name="pszTo" />. If this value contains Directory, <paramref name="pszTo" /> is assumed to be a directory; otherwise, <paramref name="pszTo" /> is assumed to be a file</param>

.

     @"c:\a\b\path", FileAttributes.Directory,

.

    if (path is DirectoryInfo) {

.

      if (fullName[fullName.Length - 1] != Path.DirectorySeparatorChar) {

.

        fullName += Path.DirectorySeparatorChar;

.

This is similar, but not identical, to Path.GetFileName. If the input string ends with a directory, the directory is returned rather than nothing; for example, "C:\foo\" becomes "foo\", "C:" stays "C:".

.
Summary
Extracts the string from the specified resource when given an indirect string (a string beginning with the @ symbol). All other strings copy to the output buffer unaltered.
.

    public static extern int SHLoadIndirectString(string pszSource, StringBuilder pszOutBuf, int cchOutBuf, IntPtr ppvReserved);

.

    Public Declare Auto Function SHLoadIndirectString Lib "shlwapi.dll" (ByVal pszSource As String, ByVal pszOutBuf As String, ByVal cchOutBuf As UInteger, ByVal ppvReserved As IntPtr) As UInteger

.

int result = SHLoadIndirectString(resourcePath, outBuff, -1, IntPtr.Zero);

.

//SHLoadIndirectString returns S_OK (0) if successful

.

int result = SHLoadIndirectString(sWin8ManifestString, outBuff, outBuff.Capacity, IntPtr.Zero);

.
Documentation
[SHLoadIndirectString] on MSDN

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

34: 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

35: 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.
41: 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,

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


 
Access PInvoke.net directly from VS: