News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

probelms with COMBOBOX

Started by xandaz, November 20, 2021, 07:07:19 AM

Previous topic - Next topic

xandaz

    Hi guys. I've used CB_INSERTSTRING a. nd CB_ADDSTRING and CB_GETTOPINDEX doesn't return the index of the top item. Has anyone been over this? help is needed thanks.loop_0:
push ecx
invoke SendMessageA,hDlgItemx,CB_INSERTSTRING,LibParamsId,esi
invoke MessageBox,0,ustr$(eax),0,MB_OK
inc LibParamsId
loop_1:
lodsb
or al,al
jnz loop_1
pop ecx
loop loop_0
.if eax==BST_CHECKED
invoke GetWindowTextA,hDlgItem_,edi,sizeof LibParams
invoke AlignParams
dec edi
invoke GetDlgItem,hDlg,1016
mov hDlgItem_,eax
invoke SendMessageA,eax,CB_GETTOPINDEX,0,0
push eax
invoke MessageBoxA,0,ustr$(eax),0,MB_OK
pop eax
invoke SendMessageA,hDlgItem_,CB_GETLBTEXT,eax,edi
invoke AlignParams
.endif


HSE

Why do you not use combobox address (hDlgItemx )?
Equations in Assembly: SmplMath

xandaz

   I'm sorry. I'm not following. I'm making this as a DialogBox. I bet if did via Thread i wouldn't be having tihs problems. It doesn't Set CB_SET/GETTOPINDEX or anything....

xandaz

   It's alright. I got it working with SET/GETCURSEL.

xandaz

   I have this procedure to fill the COMBOBOXes of a dialog box but it only works the first time aorund. If i call the dialogbox a second time the COMBOBOXes appear empty. Help needed
SetupLibDialog PROC hDlg:DWORD

local hDlgItemx:DWORD

invoke GetDlgItem,hDlg,1016
or eax,eax
jnz skip_0
invoke Beep,1000,100
skip_0:
mov hDlgItemx,eax
lea esi,MachineItems
mov ecx,9
cld
loop_0:
push ecx
invoke SendMessageA,hDlgItemx,CB_INSERTSTRING,LibParamsId,esi
inc LibParamsId
loop_1:
lodsb
or al,al
jnz loop_1
pop ecx
loop loop_0
invoke SendMessage,hDlgItemx,CB_SETCURSEL,0,0
invoke GetDlgItem,hDlg,1028
mov hDlgItemx,eax
lea esi,SubSystemItems
mov ecx,5
loop_2:
push ecx
invoke SendMessageA,hDlgItemx,CB_INSERTSTRING,SysParamsId,esi
inc SysParamsId
loop_3:
lodsb
or al,al
jnz loop_3
pop ecx
loop loop_2
invoke SendMessage,hDlgItemx,CB_SETCURSEL,0,0
ret
SetupLibDialog endp

fearless

Probably need to reset your index values to 0 and maybe other values, so that the looping can occur and increment the indexes.

xandaz

    Oh yeah. That's it I'm sorry for disturbing your peace with little things. These stupid mistakes i keep doing... Sorry pal. Thanks