Desktop Functions: Smart Device Functions:
|
Search Results for "RECT" in [All]dwmapiA more reliable approach to get the colorization parameters would be to implement your own method that tries to lookup each parameter directly from the Windows registry, with proper exception handling in the case a value cannot be obtained. The colorization parameters can be found under the key "HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM". Please note that these are also undocumented and as such can also be changed or removed in the future.
static extern int DwmGetWindowAttribute(IntPtr hwnd, DWMWINDOWATTRIBUTE dwAttribute, out RECT pvAttribute, int cbAttribute); You cannot call this function directly. This is how to use it (VB.NET): A more reliable approach to set the colorization parameters would be to implement your own method that tries to set each parameter directly in the Windows registry and sends the WM_DWMCOLORIZATIONCOLORCHANGED message to notify all top-level windows about the change, with proper exception handling in the case a value cannot be set. The colorization parameters can be found under the key "HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM". Please note that these are also undocumented and as such can also be changed or removed in the future.
public struct RECT
public RECT rcDestination;
public RECT rcSource; gdi326: Arc
static extern bool ArcTo(IntPtr hdc, int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect, int nXRadial1, int nYRadial1,
ByVal nLeftRect As Integer, ByVal nTopRect As Integer, _
ByVal nRightRect As Integer, ByVal nBottomRect As Integer, _ 7: ArcTo
static extern bool ArcTo(IntPtr hdc, int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect, int nXRadial1, int nYRadial1,
ByVal nLeftRect As Integer, ByVal nTopRect As Integer, _
ByVal nRightRect As Integer, ByVal nBottomRect As Integer, _ 8: BitBlt The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.
/// rectangle of pixels from the specified source device context into
/// <param name="nXDest">The leftmost x-coordinate of the destination rectangle (in pixels).</param>
/// <param name="nYDest">The topmost y-coordinate of the destination rectangle (in pixels).</param>
/// <param name="nWidth">The width of the source and destination rectangles (in pixels).</param>
/// <param name="nHeight">The height of the source and the destination rectangles (in pixels).</param>
/// <param name="nXSrc">The leftmost x-coordinate of the source rectangle (in pixels).</param>
/// <param name="nYSrc">The topmost y-coordinate of the source rectangle (in pixels).</param>
''' rectangle of pixels from the specified source device context into
''' <param name="nXDest">The leftmost x-coordinate of the destination rectangle (in pixels).</param>
''' <param name="nYDest">The topmost y-coordinate of the destination rectangle (in pixels).</param>
''' <param name="nWidth">The width of the source and destination rectangles (in pixels).</param>
''' <param name="nHeight">The height of the source and the destination rectangles (in pixels).</param>
''' <param name="nXSrc">The leftmost x-coordinate of the source rectangle (in pixels).</param>
''' <param name="nYSrc">The topmost y-coordinate of the source rectangle (in pixels).</param> If a rotation or shear transformation is in effect in the source device context, BitBlt returns an error. If other transformations exist in the source device context (and a matching transformation is not in effect in the destination device context), the rectangle in the destination device context is stretched, compressed, or rotated, as necessary. 9: Chord
static extern bool Chord(IntPtr hdc, int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect, int nXRadial1, int nYRadial1,
Public Function Chord(ByVal hDc As IntPtr, ByVal nLeftRect As Integer, ByVal nTopRect As Integer,
ByVal nRightRect As Integer, ByVal nBottomRect As Integer, ByVal nXRadial1 As Integer, 11: CombineRgn
public static extern IntPtr CreateEllipticRgn(int nLeftRect, int nTopRect,int nRightRect, int nBottomRect);
static extern IntPtr CreateBrushIndirect([In] ref LOGBRUSH lplb); Private Shared Function CreateBrushIndirect( _ Private Declare Function CreateBrushIndirect Lib "gdi32"( _ 13: CreateDIBSection
static extern IntPtr CreateEllipticRgn(int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect); 15: CreateFont
static extern IntPtr CreateFontIndirect([In] ref LOGFONT lplf);
public static extern IntPtr CreateFontIndirect(
static extern IntPtr CreateFontIndirect([In] ref LOGFONT lplf);
public static extern IntPtr CreateFontIndirect(
drawingArea.FillRectangle(lGB, drawingArea.VisibleClipBounds) 18: CreateRectRgn
static extern IntPtr CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
Private Shared Function CreateRectRgn(ByVal nLeftRect As Integer, ByVal nTopRect As Integer, ByVal nRightRect As Integer, ByVal nBottomRect As Integer) As IntPtr
static extern IntPtr CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect,
int nBottomRect);
FillRgn(wDc, CreateRectRgn(0,0,mx,my), brush);
static extern IntPtr CreateRoundRectRgn(int x1, int y1, int x2, int y2,
IntPtr _RegionHandle = CreateRoundRectRgn( 10, 10, 60, 60, 10, 10 ); 20: CreateSolidBrush
static extern IntPtr CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect,
int nBottomRect);
FillRgn(wDc, CreateRectRgn(0,0,mx,my), brush); 21: DPtoLP POINT [] points = { new POINT(rect.Left, rect.Top), new POINT(rect.Right, rect.Bottom) }; 22: Ellipse
static extern bool Ellipse(IntPtr hdc, int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect);
Private Shared Function Ellipse(hdc As IntPtr, nLeftRect As Integer, nTopRect As Integer, nRightRect As Integer, nBottomRect As Integer) As Boolean 23: Escape 24: ExtFloodFill
vGraphics.DrawRectangle(Pens.Blue, new Rectangle(0, 0, 300, 300));
vGraphics.DrawRectangle(Pens.Blue, new Rectangle(50, 70, 300, 300)); 25: ExtTextOut
[In] ref RECT lprc, [MarshalAs(UnmanagedType.LPWStr)] string lpString, See RECT. 26: FillRgn
static extern IntPtr CreateRectRgn(int nLeftRect, int nTopRect, int nRightRect,
int nBottomRect);
FillRgn(wDc, CreateRectRgn(0,0,mx,my), brush); 27: GetClipBox
static extern int GetClipBox(IntPtr hdc, out RECT lprc); 28: GetFontData
/// Gets the full name directly out of specified True Type font file.
// Get the correct name record
NameRecord nameRecord = SeekCorrectNameRecord(br, records);
/// Seeks the correct <see cref="NameRecord"/>.
/// <returns>The <see cref="NameRecord"/> providing access to the correct full font name.</returns>
private static NameRecord SeekCorrectNameRecord(BinaryReader br, int recordCount) 29: GetKerningPairs The only way I've been able to get ALL the kerning data is to parse the files directly; not easy to say the least. 30: GetRegionData
const int RDH_RECTANGLES = 1;
unsafe RECT[] RectsFromRegion(IntPtr hRgn)
RECT [] rects = null;
if (header->iType == RDH_RECTANGLES)
rects = new RECT[header->nCount];
// The rectangle data follows the header, so we offset the specified
// header size and start reading rectangles.
int rectOffset = header->dwSize;
// simple assignment from the buffer to our array of rectangles
rects[i] = *((RECT *)((byte *)bytes+rectOffset+(Marshal.SizeOf(typeof(RECT)) *i)));
// Return the rectangles
return rects; 31: GradientFill
GRADIENT_RECT[] pMesh, // array of gradient rectangles, that each one keeps two indices in pVertex array, to determine its bounds
uint dwNumMesh, // number of gradient rectangles to draw
GRADIENT_FILL dwMode); // Use either GRADIENT_FILL.RECT_H or GRADIENT_FILL.RECT_V. Using the value GRADIENT_FILL.TRIANGLE is wrong in this overload!
GRADIENT_FILL dwMode); // Use only GRADIENT_FILL.TRIANGLE. Both values GRADIENT_FILL.RECT_H and GRADIENT_FILL.RECT_V are wrong in this overload! This method creates one entry each for rectangles and triangles. It's just a matter of convenience and error checking by the compiler. 32: Pie
static extern bool Pie(IntPtr hdc, int nLeftRect, int nTopRect, int nRightRect,
int nBottomRect, int nXRadial1, int nYRadial1, int nXRadial2, int nYRadial2);
Private Shared Function Pie(hdc As IntPtr, nLeftRect%, nTopRect%, nRightRect%, nBottomRect%, nXRadial1%, nYRadial1%, nXRadial2%, nYRadial2%) As Boolean 33: PlayEnhMetaFile
static extern bool PlayEnhMetaFile(IntPtr hdc, IntPtr hemf, ref RECT lpRect); Changed lpRect from being an out parameter to a ref parameter. An out parameter will work in a debug build, but in a release build (with optimizations turned on) will not. Ref parameter works fine. 34: Rectangle
static extern bool Rectangle(IntPtr hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
Private Shared Function Rectangle(hdc As IntPtr, nLeftRect As Integer, nTopRect As Integer, nRightRect As Integer, nBottomRect As Integer) As Boolean 35: RectInRegion 36: RoundRect
static extern bool RoundRect(IntPtr hdc, int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect, int nWidth, int nHeight);
public static extern bool RoundRect(RECT lpRect, Point point);
public static extern bool RoundRect(IntPtr hdc, int nLeftRect, int nTopRect,
int nRightRect, int nBottomRect, int nWidth, int nHeight);
DrawRoundRect(e.Graphics);
public void DrawRoundRect(Graphics gr)
RECT rect = new RECT(0, 0, this.Width, this.Height);
GDI32.RoundRect(hDC, 0, 0, this.Width, this.Height, 20, 20); 37: SelectClipRgn
IntPtr hRegion = CreateRectRgn(left, top, right, bottom); 38: SelectObject
/// <para>SIMPLEREGION - Region consists of a single rectangle.</para>
/// <para>COMPLEXREGION - Region consists of more than one rectangle.</para> 39: SetArcDirection
static extern int SetArcDirection(IntPtr hdc, int ArcDirection); There are two constants defining the direction. 40: SetMapMode
public static extern int Rectangle(IntPtr hDC, int nLeft, int nTop, int nRight, int nBottom); double fAspectRatio = (double)(this.ClientRectangle.Bottom) / (double)(this.ClientRectangle.Right);
this.ClientRectangle.Bottom, // So that (0,0) is at the bottom left.
this.ClientRectangle.Right,
-this.ClientRectangle.Bottom, // Negative so that y gets positive as you go up. // Draw a rectangle. Rectangle(hDC, 10, 25, 990, (int)(990 * fAspectRatio)); 41: SetTextColor
static extern int DrawText(IntPtr hdc, string lpStr, int nCount,ref Rect lpRect, int wFormat);
private struct Rect
public Rect(Rectangle r)
e.Graphics.FillRectangle(backcolorBrush, e.Bounds);
Rect bounds = new Rect(e.Bounds);
e.DrawFocusRectangle(); 42: TextOut [CharSet = CharSet.Auto] According to my experience this parameter should be used when using a LOGFONT structure and the CreateFontIndirect fuction, otherwise the selected font will not be displayed. All flags will be done (lfItalic, lfUnderline ...) but not the lfFaceName string. aygshellMicrosoft.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. mscorsnThis function is exported from mscorsn.dll in v1.0 and v1.1 of the .NET framework, but it will be moved to mscorwks.dll in v2.0. There is a shim in mscoree.dll which will redirect to the appropriate implementation dll, which has the same name. This function is exported from mscorsn.dll in v1.0 and v1.1 of the .NET framework, but it will be moved to mscorwks.dll in v2.0. There is a shim in mscoree.dll which will redirect to the appropriate implementation dll, which has the same name. This function is exported from mscorsn.dll in v1.0 and v1.1 of the .NET framework, but it will be moved to mscorwks.dll in v2.0. There is a shim in mscoree.dll which will redirect to the appropriate implementation dll, which has the same name. This function is exported from mscorsn.dll in v1.0 and v1.1 of the .NET framework, but it will be moved to mscorwks.dll in v2.0. There is a shim in mscoree.dll which will redirect to the appropriate implementation dll, which has the same name. See the supporting function below for the code to the CheckToken() function - it verifies that an assembly contains the correct token data. opengl32
public enum FrontFaceDirection : uint
GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50,
GL_SPOT_DIRECTION = 0x1204,
public static extern void glRectd(double x1, double y1, double x2, double y2);
public static extern void glRectdv(double[] v1, double[] v2);
public static extern void glRectf(float x1, float y1, float x2, float y2);
public static extern void glRectfv(float[] v1, float[] v2);
public static extern void glRecti(int x1, int y1, int x2, int y2);
public static extern void glRectiv(int[] v1, int[] v2);
public static extern void glRects(short x1, short y1, short x2, short y2);
public static extern void glRectsv(short[] v1, short[] v2); kernel3249: ActivateActCtx
public string lpAssemblyDirectory;
private const uint ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID = 0x004; 50: AttachConsole,
51: AttachConsole
52: 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 53: CreateDirectory
static extern bool CreateDirectoryEx(string lpTemplateDirectory,
string lpNewDirectory, IntPtr lpSecurityAttributes); 55: CreateNamedPipe
Bidirectional = (int)(PIPE_ACCESS_INBOUND+PIPE_ACCESS_OUTBOUND)
case ServerMode.Bidirectional:
NamedPipeStream stream = NamedPipeStream.Create("testpipe", NamedPipeStream.ServerMode.Bidirectional); 56: 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 58: 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. 59: DeviceIoControl
InDirect = 1,
OutDirect = 2,
NetworkRedirector = 0x00000028, gave incorrect results due to signs. Cut off search results after 60. Please refine your search. |