Bonjour,

Je m'initie à la prog Windows avec le tutoriel de Cgi sur :
http://chgi.developpez.com/windows/hdc/

dans le chapitre 5 sur les contextes de périphériques j'ai recopié le code mais il ne se compile pas avec Dev-C++
Apparemment il y a un pb avec les fonctions SetBkMode et Textout car le compiler me marque :

[Linker error] undefined reference to `SetBkMode@8'
[Linker error] undefined reference to `TextOutA@20'
ld returned 1 exit status

je vous reproduis le code ici pour vous éviter d'aller le revoir sur la page. je vous remercie par avance pour toute aide

#include <windows.h>

LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASS wc;

wc.style = 0;
wc.lpfnWndProc = MainWndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = NULL;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
wc.lpszMenuName = NULL;
wc.lpszClassName = "MaWinClass";

if(!RegisterClass(&wc)) return FALSE;

hwnd = CreateWindow("MaWinClass", "Titre", WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 400, 300,
NULL, NULL, hinstance, NULL);
if (!hwnd) return FALSE;

ShowWindow(hwnd, nCmdShow);
UpdateWindow(hwnd);


while (GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
/******************************************************************************/

LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_PAINT :
{
int y;
char st[] = "Bienvenue sur Developpez.com" ;
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);

SetBkMode(hdc, TRANSPARENT);
for(y=10; y <= 200; y += 20)
TextOut(hdc, 10, y, st , lstrlen(st));
EndPaint(hwnd, &ps);

return 0;
}

case WM_DESTROY:
PostQuitMessage(0);
return 0;

default:
return DefWindowProc(hwnd, uMsg, wParam, lParam);
}
}