1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <windows.h>
#define EXPORT __declspec (dllexport)
RECT SetDRect (short x, short y, short size)
{
RECT retRect = { x, y, x + size, y + size };
return retRect;
}
EXPORT int APIENTRY_WinMain (double n1, double n2, char const *txt)
{
HDC DeskTopDC = GetDC (HWND_DESKTOP);
RECT drawRect;
SetTextColor (DeskTopDC, RGB (255, 0, 0));
SetBkColor (DeskTopDC, RGB (0, 255, 0));
drawRect = SetDRect (n1, n2, strlen (txt) * 10);
DrawText (DeskTopDC, txt, strlen (txt), &drawRect, DT_SINGLELINE
|| DT_TOP);
return 0;
}
int main (void)
{
APIENTRY_WinMain (12.3, 4.5, "Hello world !");
return 0;
} |
Partager