Author Topic: probelms with COMBOBOX  (Read 1105 times)

xandaz

  • Member
  • ****
  • Posts: 529
  • I luv you babe
    • My asm examples
probelms with COMBOBOX
« on: November 20, 2021, 07:07:19 AM »
    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.
Code: [Select]
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
Code: [Select]
.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

  • Member
  • *****
  • Posts: 2502
  • AMD 7-32 / i3 10-64
Re: probelms with COMBOBOX
« Reply #1 on: November 20, 2021, 09:52:15 AM »
Why do you not use combobox address (hDlgItemx )?
Equations in Assembly: SmplMath

xandaz

  • Member
  • ****
  • Posts: 529
  • I luv you babe
    • My asm examples
Re: probelms with COMBOBOX
« Reply #2 on: November 20, 2021, 10:35:18 AM »
   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

  • Member
  • ****
  • Posts: 529
  • I luv you babe
    • My asm examples
Re: probelms with COMBOBOX
« Reply #3 on: November 20, 2021, 11:00:32 AM »
   It's alright. I got it working with SET/GETCURSEL.

xandaz

  • Member
  • ****
  • Posts: 529
  • I luv you babe
    • My asm examples
Re: probelms with COMBOBOX
« Reply #4 on: November 22, 2021, 02:19:16 AM »
   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
Code: [Select]
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

  • Member
  • ****
  • Posts: 578
    • Github
Re: probelms with COMBOBOX
« Reply #5 on: November 22, 2021, 04:04:44 AM »
Probably need to reset your index values to 0 and maybe other values, so that the looping can occur and increment the indexes.
fearless

ASUS Crosshair 8 Hero, AMD 5950X, 32GB, MSI 5700XT, NZXT Kraken Z73, Seasonic 1000W PSU

Github Twitter Mastodon Gitbook

xandaz

  • Member
  • ****
  • Posts: 529
  • I luv you babe
    • My asm examples
Re: probelms with COMBOBOX
« Reply #6 on: November 22, 2021, 04:15:36 AM »
    Oh yeah. That's it I'm sorry for disturbing your peace with little things. These stupid mistakes i keep doing... Sorry pal. Thanks