Soyez le premier à donner votre avis sur cette source.
Vue 6 383 fois - Téléchargée 623 fois
#include <windows.h> #include "resource.h" HINSTANCE hinst; char sztxt[400]; HWND hstbmp, hsttxt; BOOL CALLBACK AppDlgProc(HWND hdlg, UINT mssg, WPARAM wParam, LPARAM lParam) { switch(mssg) { case WM_INITDIALOG: RECT rc; int cx, cy; SetClassLong(hdlg, GCL_HICON, (long)LoadIcon(0, IDI_APPLICATION)); hstbmp = GetDlgItem(hdlg, IDST_BMP); GetWindowRect(hstbmp, &rc); cx = rc.right - rc.left; cy = rc.bottom - rc.top; ScreenToClient(hdlg, (POINT*) &rc); hsttxt = GetDlgItem(hdlg, IDST_TXT); SetWindowPos(hsttxt, HWND_TOP, rc.left, rc.top, cx, cy, SWP_SHOWWINDOW); SendDlgItemMessage(hdlg, IDED_TXT, EM_SETLIMITTEXT, 399, 0); return TRUE; case WM_CTLCOLORSTATIC: if(GetWindowLong((HWND)lParam, GWL_ID) == IDST_TXT) { SetBkMode((HDC) wParam, TRANSPARENT); SetTextColor((HDC) wParam, 0xFF); // tu peux enlever ou changer couleur return (BOOL) GetStockObject(NULL_BRUSH); } return 0; case WM_COMMAND: switch(wParam) { case IDBT_TXT: InvalidateRect(hstbmp, 0, 1); SetWindowText(hsttxt, 0); InvalidateRect(hsttxt, 0, 1); GetDlgItemText(hdlg, IDED_TXT, sztxt, 400); SetWindowText(hsttxt, sztxt); return 0; case IDCANCEL: EndDialog(hdlg, 0); } } return 0; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, int) { hinst = hInstance; DialogBox(hinst, MAKEINTRESOURCE(IDD_APP), NULL, AppDlgProc); return 0; }
25 déc. 2004 à 22:58
bien la foto =)
NeoUmbrella Corp.
6 nov. 2004 à 16:15
mais le résultat est sympa :)
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.