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]

msvcrt

.

// "incorrect" way

.

// "correct" way

.
WARNING
.

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

.

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

wininet

.
Summary
Sends commands directly to an FTP server.
.
Summary
Creates a new directory on the FTP server
.

static extern bool FtpCreateDirectory(IntPtr hConnect, string lpszDirectory);

.

  Private Shared Function FtpCreateDirectory(ByVal hConnect As IntPtr, ByVal lpszDirectory As String) As Boolean

.
Documentation
[FtpCreateDirectory] on MSDN
.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/FtpDeleteFile.asp

.
Summary
.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/FtpFindFirstFile.asp

.
Summary
Retrieves the current directory for the specified FTP session.
.

static extern bool FtpGetCurrentDirectory(IntPtr hConnect,

.

   StringBuilder directory, ref int bufferLength);

.

Declare Function FtpGetCurrentDirectory Lib "wininet.dll" _

.

   (ByVal hConnect As IntPtr, ByVal directory As StringBuilder, ByRef bufferLength As Integer) _

.

    If FtpGetCurrentDirectory(Me.hINetConn, s, nLen) Then

.
Documentation
[FtpGetCurrentDirectory] on MSDN
.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/FtpGetCurrentDirectory.asp

.

    private const long INTERNET_OPEN_TYPE_DIRECT = 1;

.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/FtpGetFile.asp

.
Summary
Remove an directory at the FTP site
.

public static extern bool FtpRemoveDirectory(IntPtr ulSession, string lpszDirectory);

.

Declare Function FtpRemoveDirectory Lib "wininet.dll" (TODO) As TODO

.
Documentation
[FtpRemoveDirectory] on MSDN
.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/ftpputfile.asp

.
Summary
Changes to a different working directory on the FTP server.
.

static extern bool FtpSetCurrentDirectory(IntPtr hFtpConnection, string lpszDirectory);

.

Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" (ByVal hConnect As IntPtr, ByVal lpszDirectory As String) As Boolean

.

Dim changed As Boolean = FtpSetCurrentDirectory(hINetConn, changePath)

.
Documentation
[FtpSetCurrentDirectory] on MSDN
.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/InternetFindNextFile.asp

.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetgetconnectedstate.asp

.

Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/InternetGetLastResponseInfo.asp

.

const int INTERNET_OPEN_TYPE_DIRECT = 1; // direct to net

.

Const INTERNET_OPEN_TYPE_DIRECT = 1 ' // direct to net

.

    IntPtr hInternet = InternetOpen("browser", INTERNET_OPEN_TYPE_DIRECT, null, null, 0);

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.

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

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

22: 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.
28: 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

mapi32

.

The calling application's working directory may be changed after using this function.

.
Caution
I'm finding that calling this function sets your Current Working Directory to something other than what it was before the call is made. In my case, it was setting it to @"C:\Program Files\Common Files\SYSTEM\MSMAPI\1033"
.

string currentDirectory = System.IO.Directory.GetCurrentDirectory();

.

// Restore the proper working directory.

.

System.IO.Directory.SetCurrentDirectory (currentDirectory);

wtsapi32

.

    WTSWorkingDirectory = 2,

.

    WTSClientDirectory = 11,

.

    WTSWorkingDirectory = 2

.

    WTSClientDirectory = 11

winscard

.

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

faultrep

.

Enables an application to "manually" report faults to Microsoft. Although you can use this function to report application crashes, Microsoft recommends that applications not handle fatal errors directly but instead rely on the crash reporting capability provided by the operating system.

ole32

.
Summary
Registers security and sets the default security values for the process, but this can't be directly called from managed code.
.
Summary
Registers security and sets the default security values for the process, but this can't be directly called from managed code.
.
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.
.

The ref modifier or the [MarshalAs(LPStruct)] attribute are required on the guid parameter; otherwise it is marshaled incorrectly and the call will fail with an access violation.

.

The Windows API documentation states that this function automatically calls AddRef on the resulting instance before returning. The .Net framework seems aware of this at some level, as the object is freed correctly with a single call to Marshal.ReleaseComObject()

.

// complete example at http://www.codeproject.com/Articles/34663/DirectShow-Examples-for-Using-SampleGrabber-for-Gr

.

using DirectShowLib;

.

namespace Utilities.DirectShow.Capture

.

    ///  Property pages for a DirectShow filter (e.g. hardware device). These

.

    public class DirectShowPropertyPage : PropertyPage

.

        public DirectShowPropertyPage(string name, ISpecifyPropertyPages specifyPropertyPages)

.

      uint dwAspect, IntPtr hdcDraw, [In] ref RECT lprcBounds);

.

       public static extern int OleDraw(IntPtr pUnk, int dwAspect, IntPtr hdcDraw, ref Rectangle lprcBounds);

.

           Rectangle rect = new Rectangle(0,

.

                          c.ClientRectangle.Width,

.

                          c.ClientRectangle.Height);

.

           Bitmap bmp = new Bitmap(rect.Width, rect.Height);

.

           OleDraw(pUnk, 1, hdc, ref rect);

60: STGM
.

    DIRECT        = 0x00000000,

.

    DIRECT_SWMR    = 0x00400000,

.

    DIRECT        = 0

.

    DIRECT_SWMR    = 4194304

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


 
Access PInvoke.net directly from VS: