Win32 simple GPX
Ok I have just gotten an idea on maybe how to move around shapes inside of a window I created. I am using an int array with the MoveToEx and LineTo functions with the shape already drawn out. I would like to take and move it around the screen if possible? I would like to do this without using direct x for now? Thanks
Windows 98/SE/ME SUCKS!
Deal with it!
if(windows crashes)
run Linux
else
yea right!!
RESIST WINDOWS XP!!!!!!!!!!
RESIST .NET TECH!!!!!!!!!!!
Edited by - MARS_999 on May 22, 2001 11:31:41 AM
the HWND of the desktop window is NULL, so just pass NULL to your GetDC(), and ReleaseDC() functions,
if you are drawing in WM_PAINT then don''t use BeginPaint() and EndPaint(), because these will automatically clip your window, use GetDC() and ReleaseDC() here also, but don''t forget to call ValidateRect() or Windows will keep sending your app WM_PAINT messages
if you are drawing in WM_PAINT then don''t use BeginPaint() and EndPaint(), because these will automatically clip your window, use GetDC() and ReleaseDC() here also, but don''t forget to call ValidateRect() or Windows will keep sending your app WM_PAINT messages
I have on the menu a submenu called stuff and then have a option to do draw. When you select draw it draws a crosshair. I have this under WM_COMMAND
case WM_COMMAND:
switch (LOWORD(wParam))
{
case ID_FILE_EXIT:
PostMessage(hwnd, WM_CLOSE, 0, 0);
break;
case ID_STUFF_DRAW:
{
HDC hdc;
hdc = GetDC(hwnd);
MoveToEx(hdc, 320, 40, NULL);
LineTo(hdc, 320, 400);
MoveToEx(hdc, 520, 220, NULL);
LineTo(hdc, 120, 220);
Arc(hdc, 120, 40, 520, 400, 520, 400, 120, 40);
Arc(hdc, 120, 40, 520, 400, 120, 40, 520, 400);
ReleaseDC(hwnd, hdc);
}
break;
}
I would like to use BeginPaint() and EndPaint() but am confused how I would set this up in my menu? Would I just replace what I have under ID_STUFF_DRAW with those functions? Also do I still use MoveToEx() and LineTo() functions with BeginPaint() and EndPaint()? Thanks!
Windows 98/SE/ME SUCKS!
Deal with it!
if(windows crashes)
run Linux
else
yea right!!
RESIST WINDOWS XP!!!!!!!!!!
RESIST .NET TECH!!!!!!!!!!!
case WM_COMMAND:
switch (LOWORD(wParam))
{
case ID_FILE_EXIT:
PostMessage(hwnd, WM_CLOSE, 0, 0);
break;
case ID_STUFF_DRAW:
{
HDC hdc;
hdc = GetDC(hwnd);
MoveToEx(hdc, 320, 40, NULL);
LineTo(hdc, 320, 400);
MoveToEx(hdc, 520, 220, NULL);
LineTo(hdc, 120, 220);
Arc(hdc, 120, 40, 520, 400, 520, 400, 120, 40);
Arc(hdc, 120, 40, 520, 400, 120, 40, 520, 400);
ReleaseDC(hwnd, hdc);
}
break;
}
I would like to use BeginPaint() and EndPaint() but am confused how I would set this up in my menu? Would I just replace what I have under ID_STUFF_DRAW with those functions? Also do I still use MoveToEx() and LineTo() functions with BeginPaint() and EndPaint()? Thanks!
Windows 98/SE/ME SUCKS!
Deal with it!
if(windows crashes)
run Linux
else
yea right!!
RESIST WINDOWS XP!!!!!!!!!!
RESIST .NET TECH!!!!!!!!!!!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement