Bonjour à tous

Je parcours le forum depuis un moment, je trouve certain truc, mais je pige toujours pas. J'essaie de déplacer une image bitmap sur un axe horizontal (genre texte déroulant dans le bas d'un écran).

Je suis parti de l'exemple win32 "hello world", j'ai un timer qui appel
Code : Sélectionner tout - Visualiser dans une fenêtre à part
InvalidateRect(hWnd,NULL,true);
et mon WM_PAINT qui fait ceci :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
	PAINTSTRUCT ps;
	HDC hdc;
	HDC memoryHdc;
	RECT rcClient;
	hdc = BeginPaint(hWnd, &ps);
	GetClientRect(hWnd, &rcClient);
	int cxClient = rcClient.right-rcClient.left;
	int cyClient = rcClient.bottom-rcClient.top;
	HDC s_hDCBackground = CreateCompatibleDC(hdc);
        // moulinette pour changer de message et modifier ses coordonnées
	bool showMessage = true;	
	if(m_listeBMP.size()!=0 && showMessage)
	{
		if(indice<0)
		{			
			currentIt = m_listeBMP.begin();
			msgcurrent = (*currentIt);
			indice = 0;
		}
		if(msgcurrent.posX <= msgcurrent.width * -1)
		{
			msgcurrent.nbLoopDone++;
			if(msgcurrent.nbLoopDone==msgcurrent.nbLoop)
			{
				currentIt++;
				if(currentIt == m_listeBMP.end())
				{
					currentIt = m_listeBMP.begin();
				}
				msgcurrent = (*currentIt); 
			}
		}else{
			if(msgcurrent.posX == -1)
			{
				msgcurrent.posX = rcClient.right;
			}else{
				msgcurrent.posX = msgcurrent.posX - 3;
			}
 
			// msgcurrent est une struct, .bmp est un HBITMAP
			SelectObject(s_hDCBackground, msgcurrent.bmp);			
			BitBlt(hdc, msgcurrent.posX, 10, cxClient, cyClient, s_hDCBackground, 0, 0, SRCCOPY);
			DeleteDC(s_hDCBackground);
		}
	}
 
	EndPaint(hWnd, &ps);
et pour info, ma struct :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
 
typedef struct Message{
	int dindice;
	int posX;
	int posY;
	int width;
	int height;
	int nbLoop;
	int nbLoopDone;
	HBITMAP bmp;
};
J'ai lu qu'il fallait créer un DC en mémoire, dessiner dedans puis finalement dessiner ce dc dans le dc de la fenêtre... il me semble que c'est ce que je fais ? Mais j'ai toujours un effet de scintillement ?