Desktop Functions: Smart Device Functions:
|
Search Results for "rect" in [All]wininet1: FtpCommand
static extern bool FtpCreateDirectory(IntPtr hConnect, string lpszDirectory);
Private Shared Function FtpCreateDirectory(ByVal hConnect As IntPtr, ByVal lpszDirectory As String) As Boolean Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/FtpDeleteFile.asp Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/FtpFindFirstFile.asp
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 Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/FtpGetCurrentDirectory.asp 6: FtpGetFile
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
public static extern bool FtpRemoveDirectory(IntPtr ulSession, string lpszDirectory);
Declare Function FtpRemoveDirectory Lib "wininet.dll" (TODO) As TODO Direct Link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/ftpputfile.asp
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) 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 13: InternetOpen 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); kernel3214: ActivateActCtx
public string lpAssemblyDirectory;
private const uint ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID = 0x004; 15: AttachConsole,
16: AttachConsole
17: Beep This function does nothing when imported into a VB6 application. It does however work properly when called directly from a C++ application compiled with MSVC6. 18: ConsoleFunctions
// 11/21/2012 Correcting signature for GetConsoleScreenBufferInfoEx and cleaned up CONSOLE_SCREEN_BUFFER_INFO_EX.ColorTable
ref SMALL_RECT lpReadRegion
[In] ref SMALL_RECT lpScrollRectangle,
IntPtr lpClipRectangle,
[In] ref SMALL_RECT lpConsoleWindow
ref SMALL_RECT lpWriteRegion
public struct SMALL_RECT
public SMALL_RECT srWindow;
public SMALL_RECT srWindow;
SMALL_RECT Selection;
const uint CONSOLE_SELECTION_NOT_EMPTY = 0x0002; //Selection rectangle is not empty 19: CreateDirectory
internal static extern bool CreateDirectory(String path, SECURITY_ATTRIBUTES lpSecurityAttributes);
var security = new System.Security.AccessControl.DirectorySecurity();
return CreateDirectory(path, lpSecurityAttributes); System.IO.Directory.CreateDirectory
static extern bool CreateDirectoryEx(string lpTemplateDirectory, string lpNewDirectory, IntPtr? lpSecurityAttributes = null); 21: CreateFile
# example usage for read access to a directory
FILE_LIST_DIRECTORY = 0x0001, // directory
FILE_ADD_FILE = 0x0002, // directory
FILE_ADD_SUBDIRECTORY = 0x0004, // directory
FILE_READ_EA = 0x0008, // file & directory
FILE_WRITE_EA = 0x0010, // file & directory
FILE_TRAVERSE = 0x0020, // directory
FILE_DELETE_CHILD = 0x0040, // directory
Directory = 0x00000010,
FILE_ATTRIBUTE_DIRECTORY = &H10
//Using directives needed: 22: CreateNamedPipe
Bidirectional = (int)(PIPE_ACCESS_INBOUND+PIPE_ACCESS_OUTBOUND)
case ServerMode.Bidirectional:
NamedPipeStream stream = NamedPipeStream.Create("testpipe", NamedPipeStream.ServerMode.Bidirectional); 23: CreateProcess
string lpCurrentDirectory,
lpCurrentDirectory As String, _
lpCurrentDirectory as string, 24: CreateProcessW
uint dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, 0x1 The link target is a directory. The unmanaged prototype contains a return directive because the CreateSymbolicLink API function returns BOOLEAN, a one-byte data type. The default marshaling for bool is four bytes (to allow seamless integration with BOOL return values). If you were to use the default marshaling for BOOLEAN values, it's likely that you will get erroneous results. The return directive forces PInvoke to marshal just one byte of the return value. Source: http://www.informit.com/guides/content.aspx?g=dotnet&seqNum=762&ns=16196 Also, The parent directory of lpSymlinkFileName must already exist. This is similar to other API's for creating files, which require the parent to exist. 26: CreateThread Try System.Threading.Thread.Start. It doesn't give you all the control of directly calling CreateThread, (such as specifing the flags), but it will get you a vanilla thread to spin up. 27: CTL_CODE
METHOD_IN_DIRECT = 1,
METHOD_OUT_DIRECT = 2, 28: DeviceIoControl
InDirect = 1,
OutDirect = 2,
NetworkRedirector = 0x00000028, gave incorrect results due to signs. 31: FindFirstFile
32: FindFirstFileEx
if ((findData.dwFileAttributes & FileAttributes.Directory) != FileAttributes.Directory)
//"CONIN$" will allow you to grab the input buffer regardless if it is being redirected.
//0x00000001 - FILE_SHARE_READ - seems to be required to get the buffer correctly.
//3 - OPEN_EXISTING - recommended by MSDN to get the buffer correctly ThrowExceptionForHR is for HRESULT values returned directly from NT functions, is it not? 35: FormatMessage ThrowExceptionForHR is for HRESULT values returned directly from NT functions, is it not? 36: GetBinaryType
#Attempts to get the binary type of all files in the current directory
#Attempts to get the binary type of all exe files in the windows directory,
#in the windows system32 directory by bypassing filesystem redirection using "sysnative",
#Put enum object directly into pipeline The code below correctly obtains the compressed file size also if above 4GB. (Fixed VB and C# code, 2012 Eske Rahn)
public SMALL_RECT srWindow;
public SMALL_RECT srWindow;
SMALL_RECT Selection;
const uint CONSOLE_SELECTION_NOT_EMPTY = 0x0002; //Selection rectangle is not empty
static extern uint GetCurrentDirectory(uint nBufferLength, * This sample uses: GetCurrentDirectoryW * static extern uint GetCurrentDirectoryW(uint nBufferLength, StringBuilder lpBuffer); uint folderNameLength = GetCurrentDirectory(MAX_DEEP_PATH, nameBuffer);
Console.WriteLine("Failed to get initial working directory; error = '{0}'", lastError);
Console.WriteLine("Failed to get initial working directory; allocated buffer is shorter than required: '{0}'<'{1}'", MAX_DEEP_PATH, folderNameLength); Directory.GetCurrentDirectory 42: GetDiskFreeSpace
static extern bool GetDiskFreeSpaceEx(string lpDirectoryName,
static extern bool GetDiskFreeSpaceEx(string lpDirectoryName,
/// <param name="folderName">Directory or unc folder name of the volume to
static extern bool GetDiskFreeSpaceEx(string lpDirectoryName,
static extern bool GetDiskFreeSpaceEx(string lpDirectoryName,
/// <param name="folderName">Directory or unc folder name of the volume to 44: GetDriveType
/// <param name="lpRootPathName">A pointer to a null-terminated string that specifies the root directory and returns information about the disk.A trailing backslash is required. If this parameter is NULL, the function uses the root of the current directory.</param>
internal static Int64 GetDirectoryId(string dir)
GetFileInformationByHandleEx(handle, FILE_INFO_BY_HANDLE_CLASS.FileIdBothDirectoryInfo, out fileStruct, (uint)Marshal.SizeOf(fileStruct));
internal static Int64 GetDirectoryId(string dir)
GetFileInformationByHandleEx(handle, FILE_INFO_BY_HANDLE_CLASS.FileIdBothDirectoryInfo, out fileStruct, (uint)Marshal.SizeOf(fileStruct)); 47: GetLastError Calling GetLastError directly via PInvoke is not guaranteed to work due to the CLR's internal interaction with the operating system. Instead, call Marshal.GetLastWin32Error. 48: GetLongPathName The file must exist to get the correct path. This is because the full path comes from the file system information. If an invalid name is given and exception is not thrown rather the name is just a blank space.
string[] paths = Directory.GetFiles( Path.GetDirectoryName(shortName), Path.GetFileName(shortName) ); 49: GetStringType
Public Const CT_TYPE2 As Int32 = &H2 ' Retrieves bi-directional layout info
BidirectionalLayout = CT_TYPE2 50: GetStringTypeEx
Public Const CT_TYPE2 As Int32 = &H2 ' Retrieves bi-directional layout info
BidirectionalLayout = CT_TYPE2
static extern uint GetSystemDirectory([Out] StringBuilder lpBuffer,
<DllImport("kernel32.dll", SetLastError:=true, EntryPoint:="GetSystemDirectoryW", CharSet:=CharSet.Unicode)> _
Public Function GetSystemDirectory(<MarshalAs(UnmanagedType.LPTSTR)>lpBuffer As System.Text.StringBuilder, _
Public Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" _
res = GetSystemDirectory(sbSystemDir,256);
static extern UInt32 GetSystemWindowsDirectory(StringBuilder sb, UInt32 size);
Declare Function GetSystemWindowsDirectoryW Lib "kernel32.dll" (TODO) As TODO
public static String GetSystemWindowsDirectory()
GetSystemWindowsDirectory(sb, i);
public static extern int GetSystemWow64Directory([In, Out] char[] lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);
public static extern int GetSystemWow64Directory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);
Private Declare Function GetSystemWow64Directory Lib "Kernel32.dll" Alias _
"GetSystemWow64DirectoryA" (ByVal lpBuffer As String, ByVal uSize As Long) As Integer
public static extern int GetSystemWow64Directory([In, Out] char[] lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);
int result = GetSystemWow64Directory(path, (uint)path.Length);
private static extern int GetSystemWow64Directory([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpBuffer, [MarshalAs(UnmanagedType.U4)] uint size);
if (GetSystemWow64Directory(buffer, (uint)buffer.Capacity) != 0)
Private Declare Function GetSystemWow64Directory Lib "Kernel32.dll" Alias _
"GetSystemWow64DirectoryA" (ByVal lpBuffer As String, ByVal uSize As Integer) As Integer
Dim Result As Integer = GetSystemWow64Directory(DirPath, DirPath.Length) 54: GetTempFileName
Directory.CreateDirectory(tempFolderName); 55: GetTempPath
Dim dirInfo As DirectoryInfo
If Not Directory.Exists(fFoldername) Then
dirInfo = Directory.CreateDirectory(fFoldername)
Throw New Exception("Directory '" + fFoldername + "' can not be created") 56: GetTickCount Note, the managed API is subtly different than the Win32 API call. The Win32 API call returns an unsigned int while the managed API returned a signed int. Also note that the MSDN documentation for System.Environment.TickCount() is not correct. This managed API rolls over to int.MinValue and not to 0 after 24.9 days. UPDATE, The MSDN documentation has been updated to correctly state the int.MinValue 24.9 day rollover. The new documentation also provides an example of how to correctly return a positive value from the method. http://msdn2.microsoft.com/en-us/library/system.environment.tickcount.aspx
/// <para>To select the correct day in the month, set the wYear member to zero, the wHour and wMinute members to the transition time, the wDayOfWeek member to the appropriate weekday, and the wDay member to indicate the occurence of the day of the week within the month (first through fifth).</para>
/// <para>To select the correct day in the month, set the wYear member to zero, the wHour and wMinute members to the transition time, the wDayOfWeek member to the appropriate weekday, and the wDay member to indicate the occurence of the day of the week within the month (first through fifth).</para>
/// The specified volume is a direct access (DAX) volume. This flag was introduced in Windows 10, version 1607.
''' for the specified directory. Works with UNC. Can throw an exception.
static extern uint GetWindowsDirectory(StringBuilder lpBuffer,
<DllImport("kernel32.dll", SetLastError:=true, EntryPoint:="GetWindowsDirectoryW", CharSet:=CharSet.Unicode)> _
Public Function GetWindowsDirectory(<MarshalAs(UnmanagedType.LPTSTR)>lpBuffer As System.Text.StringBuilder, _
Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" _
Dim Res As Integer = GetWindowsDirectory(WinDir, WinDir.Length)
GetWindowsDirectory(sb,i)
int len = (int)GetWindowsDirectory(sb, MaxPathLength);
_windowsDirectory = sb.ToString(0, len);
GetWindowsDirectory(sb,ref i); 60: MoveMemory
Dim rect As Rectangle = New Rectangle(0, 0, Width, Height)
bitmapData = bitmap.LockBits(rect, ImageLockMode.WriteOnly, PixelFormat.Format1bppIndexed) Cut off search results after 60. Please refine your search. |