yoyo269
Messages postés
1403
Date d'inscription
lundi 23 février 2004
Statut
Membre
Dernière intervention
11 janvier 2009
2
20 mai 2006 à 14:13
Il faut tout d'abord mettre ton image dans les ressources de ton projet :
img_fond BITMAP "C:\\...\\...\\Image.bmp"
Puis mettre ceci dans ton code:
HBITMAP img_fond = LoadBitmap(hInst, "img_fond");
HWND FenetrehWnd = CreerFenetre(WS_EX_LAYERED, "Fenetre", FenetreProc, CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, (HBRUSH)CreatePatternBrush(img_fond), "Titre", WS_OVERLAPPEDWINDOW | WS_POPUP | WS_VISIBLE | WS_TABSTOP, (GetSystemMetrics(SM_CXSCREEN) - 720) / 2, (GetSystemMetrics(SM_CYSCREEN) - 580) / 2, 720, 580, HWND_DESKTOP, hInst, true);
if (!FenetrehWnd) return 0;
Avec comme fonction CreerFenetre :/*Création de fenêtre*/
HWND CreerFenetre(int StyleEtendu, char * NomClasse, WNDPROC NomProc, int StyleClasse, HBRUSH hBrush, char * Texte, int Style, int Gauche, int Haut, int Largeur, int Hauteur, HWND hWnd, HINSTANCE hInstance, bool EnrClasse)
{
if (EnrClasse)
{
WNDCLASSEX F_ESIP;
F_ESIP.hInstance = hInstance;
F_ESIP.lpszClassName = NomClasse;
F_ESIP.lpfnWndProc = NomProc;
F_ESIP.style = StyleClasse;
F_ESIP.cbSize = sizeof(WNDCLASSEX);
F_ESIP.hIcon = LoadIcon(hInstance, "A");
F_ESIP.hIconSm = LoadIcon(hInstance, "A");
F_ESIP.hCursor = LoadCursor(NULL, IDC_ARROW);
F_ESIP.lpszMenuName = NULL;
F_ESIP.cbClsExtra = 0;
F_ESIP.cbWndExtra = 0;
F_ESIP.hbrBackground = hBrush;
if (!RegisterClassEx(&F_ESIP))
{
MessageBox(NULL, "Erreur lors de l'enregistrment de la classe de la fenêtre !", "ESIP Messenger", MB_ICONINFORMATION);
return NULL;
}
}
return CreateWindowEx(StyleEtendu, NomClasse, Texte, Style, Gauche, Haut, Largeur, Hauteur, hWnd, NULL, hInstance, NULL);
}
YOYO, @+.
"L'intelligence c'est comme un parachute, quand on en n'a pas...on s'écrase !"