cs_ssefyou
Messages postés120Date d'inscriptionsamedi 3 mai 2008StatutMembreDernière intervention18 juillet 2013
-
24 déc. 2011 à 23:09
cs_ssefyou
Messages postés120Date d'inscriptionsamedi 3 mai 2008StatutMembreDernière intervention18 juillet 2013
-
25 déc. 2011 à 19:17
Bonsoir ,
comment remplir un combobox sous winapi en c ?
j'ai cree un combo en utilisant la fonction createWindowEx()
mais je n'arrive pas à le remplir avec des chaines de caratères
j'ai utilisé la fonction SendMessage mais ça ne fonctionne pas
voilà mon code :
LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_CREATE:
{
//creation d'une label
HWND hlbl1=CreateWindowEx(0,"STATIC","Taille :",WS_CHILD| WS_VISIBLE ,15,20,50,20,hwnd,(HMENU)1,GetModuleHandle(NULL),NULL);
//creation de la zone de texte
HWND hEdit=CreateWindowEx(WS_EX_CLIENTEDGE,
"EDIT","",WS_CHILD|WS_VISIBLE | ES_NUMBER,80,20,100,20,hwnd,(HMENU)2,GetModuleHandle(NULL),NULL);
//limiter le nbr des caracteres
SendMessage(hEdit,EM_SETLIMITTEXT,(WPARAM)6,0);
//creation d'une label
HWND hlbl2=CreateWindowEx(0,"STATIC","Methode de Tri :",WS_CHILD| WS_VISIBLE ,230,20,120,20,hwnd,(HMENU)3,GetModuleHandle(NULL),NULL);
//creation du combobox
HWND hCombo = CreateWindowEx(WS_EX_CLIENTEDGE, "COMBOBOX",NULL, CBS_DROPDOWNLIST | WS_CHILD | CBS_SIMPLE | WS_VISIBLE,360, 20, 150, 20, hwnd, (HMENU)4,0,0);
// ajout des items au combo
SendMessage(hCombo,CB_ADDSTRING,0,(LPARAM)"azerty");
SendMessage(hCombo,CB_ADDSTRING,0,(LPARAM)"qwerty");