Desktop Functions: Smart Device Functions:
|
Search Results for "RECT" in [All]winscard1: SCardConnect SCARD_SHARE_DIRECT = 0x00000003 - Direct control of the reader, even without a card winspoolI believe the issue(s) discussed re:x64 is actually an odd idiosyncracy under Windows Server 2008 R2 x64, but is not a x86/x64 problem per se. At least testing this under Win7 x64, I have no issues. However, under W2K8 x64, the OutBuffer and InBuffer must NOT be the same (in Win7 x64 this works OK). ALSO, the call to set doc properties with fMode = 14 (Prompt | In | Out) and OutBuffer = IntPtr.Zero CANNOT possibly correct, as in this case there is no place to put the resulting Devmode. Good code shouldn't use "magic numbers" anyway. The following values from WinSpool.h should be used instead of "14" or "0" for the last parameter in this call:
/// A pointer to a null-terminated string that specifies a language monitor (for example, "PJL monitor"). This member can be NULL and should be specified only for printers capable of bidirectional communication. 4: EnumPorts
Redirected = 0x4, 5: GetPrinter
static extern bool GetPrinterDriverDirectory(StringBuilder pName,
GetPrinterDriverDirectory(null, null, 1, str, 1024, ref i);
static extern bool GetPrinterDriverDirectory(StringBuilder pName,
GetPrintProcessorDirectory(null, null, 1, str, 1024, ref i);
static extern bool GetPrinterDriverDirectory(StringBuilder pName,
GetPrintProcessorDirectory(null, null, 1, str, 1024, ref i); Gets the directory of the current PrinterProcessor.
static extern bool GetPrintProcessorDirectory(StringBuilder pName, StringBuilder pEnv, int Level, [Out] StringBuilder outPath, int bufferSize,
Declare Function GetPrintProcessorDirectory Lib "winspool.dll" (TODO) As TODO
static extern bool GetPrintProcessorDirectory(StringBuilder pName,
GetPrintProcessorDirectory(null, null, 1, str, 1024, ref length ); InterfacesAdd StaThread attribute to main application, for correct functionality 10: IADs 11: IAutoComplete2
/// direction as the text in its parent window. If
/// direction from the text in the parent window.</summary>
// hence the read goes directly to e.g. socket
,BINDF_DIRECT_READ = 0x00020000
,BINDSTATUS_REDIRECTING
,BINDSTATUS_DIRECTBIND
INET_E_REDIRECT_FAILED = 0x800C0014,//INET_E_REDIRECTING
INET_E_REDIRECT_TO_DIR = 0x800C0015,
string destdir=Path.GetDirectoryName(this.LocalPath);
if(!Directory.Exists(destdir))
Directory.CreateDirectory(destdir);
case HRESULTS.INET_E_REDIRECT_FAILED:
Description = "Redirect Failed.";break;
case HRESULTS.INET_E_REDIRECT_TO_DIR:
Description = "Redirect To Dir.";break; 13: IDataObject
IEnumFORMATETC EnumFormatEtc(DATADIR direction); 14: IDeskBand
int ResizeBorderDW(ref RECT rcBorder, [In, MarshalAs(UnmanagedType.IUnknown)] ref object punkToolbarSite, [MarshalAs(UnmanagedType.Bool)] bool fReserved);
BandObjectSite = DirectCast(pUnkSite, IInputObjectSite)
Explorer = DirectCast(Marshal.CreateWrapperOfType(TryCast(w, IWebBrowser), GetType(WebBrowserClass)), WebBrowserClass)
Dim boa As BandObjectAttribute() = DirectCast(t.GetCustomAttributes(GetType(BandObjectAttribute), False), BandObjectAttribute())
Dim boa As BandObjectAttribute() = DirectCast(t.GetCustomAttributes(GetType(BandObjectAttribute), False), BandObjectAttribute()) 15: IDeskBand2
int ResizeBorderDW(ref RECT rcBorder, [In, MarshalAs(UnmanagedType.IUnknown)] ref object punkToolbarSite, [MarshalAs(UnmanagedType.Bool)] bool fReserved);
BandObjectSite = DirectCast(pUnkSite, IInputObjectSite)
Explorer = DirectCast(Marshal.CreateWrapperOfType(TryCast(w, IWebBrowser), GetType(WebBrowserClass)), WebBrowserClass)
Dim boa As BandObjectAttribute() = DirectCast(t.GetCustomAttributes(GetType(BandObjectAttribute), False), BandObjectAttribute())
Dim boa As BandObjectAttribute() = DirectCast(t.GetCustomAttributes(GetType(BandObjectAttribute), False), BandObjectAttribute()) 16: IDocHostShowUI The original definition on this page marshalled the strings as UnmanagedType.BStr which I think was incorrect since the underlying type is LPOLESTR. I experienced heap corruption and instability. ShowMessage also did not appear to be called reliably. 17: IKnownFolder
void Redirect ( [In] ref Guid rfid, [In] IntPtr hwnd, [In] uint Flags,
void Redirect ( [In] ref Guid rfid, [In] IntPtr hwnd, [In] uint Flags,
/// <param name="szAppBase">[in] The root directory in which to search for the given assembly. If this value is set to null, <c>FindAssembliesByName</c> will look only in the global assembly cache for the assembly.</param>
/// <param name="szPrivateBin">[in] A list of semicolon-delimited subdirectories (for example, "bin;bin2"), under the root directory, in which to search for the assembly. These directories are probed in addition to those specified in the default probing rules.</param> 20: IObjectWithSite
/// Often, an object needs to communicate directly with a container site that is managing the https://www.pinvoke.net/emoticons/star.gif - Various sites declare OLECMD.cmdf as UInt64. For me this crashes IE7 just after my QueryStatus() method is called, but declaring it as uint works fine. This seems correct given the MSDN definition as a DWORD - http://msdn.microsoft.com/en-us/library/ms690534%28VS.85%29.aspx
/// Defines the directions a table can have
public struct TableDirectionValues
public const string NODIRECTION = "none";
//set initial directory the my documents folder
openDialog.InitialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
openDialog.InitialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
openDialog.InitialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
saveFileDialog.InitialDirectory = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
/// Sets/Gets the search direction
public int FindReplaceOptionSearchDirection
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetFindReplaceOptionSearchDirection),typeof(int)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetFindReplaceOptionSearchDirection, value));
#region Table Direction
/// Sets/Gets the direction of the table
/// <return type=string>value of direction ("LTR" (Left To Right) or "RTL" (Right To Left))</return>
public string TableDirection
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.GetTableDirection),typeof(string)),CultureInfo.CurrentCulture
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTableDirection, value));
/// Gets the number of suggested corrections
/// Corrects the misspelled word
/// <param name="correct">correction of the misspelled word</param>
public void CorrectMisspelledWord(string misspelled, string correct)
if (!String.IsNullOrEmpty(misspelled) && !String.IsNullOrEmpty(correct))
object[] vaIn = { misspelled, correct };
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.CorrectMisspelledWord, vaIn));
throw new InvalidDataException("The misspelled word and the corrected word cannot be null or empty");
/// Corrects all the occurences of this misspelled word
/// <param name="misspelled">the word to correct</param>
/// <param name="correct">correction of the misspelled word</param>
public void CorrectAllOfMisspelledWord(string misspelled, string correct)
if (!String.IsNullOrEmpty(misspelled) && !String.IsNullOrEmpty(correct))
object[] vaIn = { misspelled, correct };
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.CorrectAllOfMisspelledWord, vaIn));
throw new InvalidDataException("The misspelled word and the corrected word cannot be null or empty");
#region Form Direction
/// Checks if the current direction of the form is left to right
public bool IsFormDirectionLeftToRight
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IsFormDirectionLeftToRight),typeof(uint)),CultureInfo.CurrentCulture
/// Checks if the current direction of the form is right to left
public bool IsFormDirectionRightToLeft
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.IsFormDirectionRightToLeft),typeof(uint)),CultureInfo.CurrentCulture
#region Text Direction
/// Sets the direction of the text to be the default direction
public void SetTextDirectionDefault()
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTextDirectionDefault));
/// Sets the direction of the text to be left to right
public void SetTextDirectionLeftToRight()
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTextDirectionLeftToRight));
/// Sets the direction of the text to be right to left
public void SetTextDirectionRightToLeft()
ChkResult(ExecuteCommand(FormControlCommandIds.CommandIds.SetTextDirectionRightToLeft)); 22: IOleObject
void DoVerb(uint iVerb, uint lpmsg, object pActiveSite, uint lindex, uint hwndParent, uint lprcPosRect); 23: IServiceProvider The IServiceProvider defined here is different with "System.IServiceProvider". To remove name collisition, rename "IServiceProvider" to other name such as "UCOMIServiceProvider". Otherwise, you should use fully qualified namespace to the interface since you will normally use "using System" directive. 24: IShellLinkA
/// <summary>Retrieves the name of the working directory for a Shell link object</summary>
void GetWorkingDirectory([Out(), MarshalAs(UnmanagedType.LPStr)] StringBuilder pszDir, int cchMaxPath);
/// <summary>Sets the name of the working directory for a Shell link object</summary>
void SetWorkingDirectory([MarshalAs(UnmanagedType.LPStr)] string pszDir);
'[helpstring("Retrieves the name of the shell link working directory")]
Sub GetWorkingDirectory(<Out(), MarshalAs(UnmanagedType.LPStr)> ByVal pszDir As StringBuilder, ByVal cchMaxPath As Integer)
'[helpstring("Sets the name of the shell link working directory")]
Sub SetWorkingDirectory(<MarshalAs(UnmanagedType.LPStr)> ByVal pszDir As String) 25: IShellLinkW
/// <summary>Retrieves the name of the working directory for a Shell link object</summary>
void GetWorkingDirectory([Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir, int cchMaxPath);
/// <summary>Sets the name of the working directory for a Shell link object</summary>
void SetWorkingDirectory([MarshalAs(UnmanagedType.LPWStr)] string pszDir);
''' <summary>Retrieves the name of the working directory for a Shell link object</summary>
<PreserveSig()> Function GetWorkingDirectory( _
''' <summary>Sets the name of the working directory for a Shell link object</summary>
<PreserveSig()> Function SetWorkingDirectory( _ 26: IShellView
[In, Out] ref RECT prcView,
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix"), Flags] 27: IShellView3
[In, Out] ref RECT prcView, 28: ITrayDeskband Guid {E6442437-6C68-4f52-94DD-2CFED267EFB9} leads to the correct TrayDeskband object. 29: IUnknown It is usually not necessary to call IUnknown's methods directly in your .NET code. The interop runtime code will insert the appropriate method calls for reference counting when the managed proxy objects are created and freed, and will translate typecast, "is", and "as" operators into calls to QueryInterface. 30: IViewObject
void Draw([MarshalAs(UnmanagedType.U4)] int dwDrawAspect, int lindex, IntPtr pvAspect, DVTARGETDEVICE ptd, IntPtr hdcTargetDev, IntPtr hdcDraw, COMRECT lprcBounds, COMRECT lprcWBounds, IntPtr pfnContinue, int dwContinue);
Sub Draw(<MarshalAs(UnmanagedType.U4)> ByVal dwDrawAspect As UInt32, ByVal lindex As Integer, ByVal pvAspect As IntPtr, <[In]()> ByVal ptd As IntPtr, ByVal hdcTargetDev As IntPtr, ByVal hdcDraw As IntPtr, <MarshalAs(UnmanagedType.Struct)> ByRef lprcBounds As _RECTL, <[In]()> ByVal lprcWBounds As IntPtr, ByVal pfnContinue As IntPtr, <MarshalAs(UnmanagedType.U4)> ByVal dwContinue As UInt32) iphlpapi
TUNNEL_TYPE_DIRECT = 2, 32: GetAdaptersInfo
' Buffer was too small, reallocate the correct size for the buffer.
// Buffer was too small, reallocate the correct size for the buffer. 33: GetIpNetTable
table(index) = DirectCast(Marshal.PtrToStructure(New IntPtr(currentBuffer.ToInt64() + (index * Marshal.SizeOf(GetType(MIB_IPNETROW)))), GetType(MIB_IPNETROW)), MIB_IPNETROW) kernel3234: ActivateActCtx
public string lpAssemblyDirectory;
private const uint ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID = 0x004; 35: AttachConsole,
36: AttachConsole
37: 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 38: CreateDirectory
static extern bool CreateDirectoryEx(string lpTemplateDirectory,
string lpNewDirectory, IntPtr lpSecurityAttributes); 40: CreateNamedPipe
Bidirectional = (int)(PIPE_ACCESS_INBOUND+PIPE_ACCESS_OUTBOUND)
case ServerMode.Bidirectional:
NamedPipeStream stream = NamedPipeStream.Create("testpipe", NamedPipeStream.ServerMode.Bidirectional); 41: CreateProcess
string lpCurrentDirectory,
lpCurrentDirectory As String, _ 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 43: 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. 44: DeviceIoControl
InDirect = 1,
OutDirect = 2,
NetworkRedirector = 0x00000028, gave incorrect results due to signs. 47: FindFirstFile 48: 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? 51: FormatMessage ThrowExceptionForHR is for HRESULT values returned directly from NT functions, is it not? 52: 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 58: 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 60: 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> Cut off search results after 60. Please refine your search. |