http://www.oschina.net/code/snippet_103482_14802
看到这个稀奇古怪的语言画国旗,代码真心简洁。试着用C语言实现,确实麻烦不少——主要是数字全要自己算啊。
1.[代码][C/C++]代码
#include
#include
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
void DrawFiveStarFlag(HDC hdc, int x, int y, int w);
void DrawFivePointedStar(HDC hdc, int x, int y, int r, float d);
/* Current app instance */
HINSTANCE hInst;
/* Make the class name into a global variable */
TCHAR szClassName[] = TEXT("WindowsApp");
int WINAPI
WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data