Soyez le premier à donner votre avis sur cette source.
Vue 3 346 fois - Téléchargée 457 fois
// ... HWND edit,trackBar; // ... case WM_CREATE: { edit=CreateWindow("EDIT","Bougez le curseur",WS_BORDER|WS_CHILD|WS_VISIBLE |ES_MULTILINE|ES_AUTOVSCROLL|WS_VSCROLL,70,32,280,200,h,0,0,0); // ... } return 0; // ...
void AppendText(char *txt) { // Simulation Console int idx=GetWindowTextLength(edit); SendMessage(edit,EM_SETSEL,idx,idx); // set selection: end of text SendMessage(edit,EM_REPLACESEL,0,(LPARAM)txt); } // ... static char txt[64]="rnPosition verticale: "; // ... case WM_VSCROLL: if ((LOWORD(wP)==TB_THUMBTRACK)&&((HWND)lP==tb)) { char txt[64]="rnPosition verticale: "; _itoa_s(HIWORD(wP),txt+22,63,10); int i=23; while (txt[i]) ++i; txt[i]=' '; txt[i+1]='%'; txt[i+2]=0; AppendText(txt); } return 0; // ...
// ... case WM_CREATE: { edit=CreateWindow("EDIT","Bougez le curseur",WS_BORDER|WS_VISIBLE |ES_MULTILINE|ES_AUTOVSCROLL|WS_VSCROLL,70,32,280,200,h,0,0,0); // ... } return 0; // ...Pour rendre la fenêtre Edit indépendante, il suffit de ne pas adjoindre WS_CHILD au troisième paramètre de la fonction CreateWindow("EDIT",…).
void TopRecentText(char*txt) { SendMessage(edit,EM_SETSEL,0,0); // set selection: begin of text SendMessage(edit,EM_REPLACESEL,0,(LPARAM)txt); } // ... static char txt[64]="Position verticale: "; // ... case WM_VSCROLL: if ((LOWORD(wP)==TB_THUMBTRACK)&&((HWND)lP==trackBar)) { char txt[64]="Position verticale: "; _itoa_s(HIWORD(wP),txt+20,63,10); int i=21; while (txt[i]) ++i; txt[i]=' '; txt[i+1]='%'; txt[i+2]='r'; txt[i+3]='n'; txt[i+4]=0; TopRecentText(txt); } return 0; // ...
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.