Soyez le premier à donner votre avis sur cette source.
Vue 5 851 fois - Téléchargée 307 fois
#include <windows.h> #include <commdlg.h> #include "ressource.h" HFONT Verdana = CreateFont(12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Verdana"); HFONT Symbol = CreateFont(15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Symbol"); HFONT Wingdings = CreateFont(15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Wingdings"); BOOL WINAPI DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; case WM_COMMAND: { switch(LOWORD(wParam)) { case QUITTER: DestroyWindow(hwnd); break; case CHANGER: { HWND Texte, Changer, Quitter; Texte = GetDlgItem(hwnd, TEXTE); Changer = GetDlgItem(hwnd, CHANGER); Quitter = GetDlgItem(hwnd, QUITTER); SendMessage(Texte, WM_SETFONT,(WPARAM)Verdana, TRUE); SendMessage(Changer, WM_SETFONT,(WPARAM)Symbol, TRUE); SendMessage(Quitter, WM_SETFONT,(WPARAM)Wingdings, TRUE); /* UpdateWindow(Texte); UpdateWindow(Changer); UpdateWindow(Quitter); */ break; } break; } } default: return FALSE; } return FALSE; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR CmdLine, int CmdShow) { MSG msg; HWND Dlg; Dlg = CreateDialog(GetModuleHandle(NULL),MAKEINTRESOURCE(FENETRE),NULL,(DLGPROC)DlgProc); if(Dlg == NULL) { MessageBox(NULL, "Erreur !", "Erreur :", MB_ICONEXCLAMATION | MB_OK); return 0; } ShowWindow(Dlg, CmdShow); UpdateWindow(Dlg); while(GetMessage(&msg, NULL, 0, 0)>0) { TranslateMessage(&msg); DispatchMessage(&msg); } return msg.wParam; }
bon, j'avoue : il est miraculeux ton code !!!!!!
tu me sauve la vie (ou le prog?) !!!!!!!!
merci infiniment !!
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.