mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 15:23:04 +00:00
Added check for valid DC
svn path=/trunk/; revision=1255
This commit is contained in:
parent
0afbea5a1c
commit
fb7b00bd59
1 changed files with 5 additions and 3 deletions
|
@ -8,7 +8,7 @@
|
|||
int main (void)
|
||||
{
|
||||
HDC Desktop, MyDC;
|
||||
HPEN RedPen, GreenPen;
|
||||
HPEN RedPen, GreenPen;
|
||||
HBITMAP MyBitmap;
|
||||
DWORD shit;
|
||||
|
||||
|
@ -16,6 +16,8 @@ int main (void)
|
|||
|
||||
// Set up a DC called Desktop that accesses DISPLAY
|
||||
Desktop = CreateDCA("DISPLAY", NULL, NULL, NULL);
|
||||
if (Desktop == NULL)
|
||||
return 1;
|
||||
|
||||
// Create a red pen and select it into the DC
|
||||
RedPen = CreatePen(PS_SOLID, 8, 0x0000ff);
|
||||
|
@ -35,10 +37,10 @@ int main (void)
|
|||
// Bitblt from the DISPLAY DC to MyDC and then back again in a different location
|
||||
BitBlt(MyDC, 0, 0, 151, 251, Desktop, 50, 50, SRCCOPY);
|
||||
|
||||
// Draw a rectangle on the memory DC before bltting back with a green pen
|
||||
// Draw a rectangle on the memory DC before bltting back with a green pen
|
||||
GreenPen = CreatePen(PS_SOLID, 3, 0x00ff00);
|
||||
SelectObject(MyDC, GreenPen);
|
||||
Rectangle(MyDC, 10, 10, 50, 50);
|
||||
Rectangle(MyDC, 10, 10, 50, 50);
|
||||
|
||||
BitBlt(Desktop, 400, 100, 151, 251, MyDC, 0, 0, SRCCOPY);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue