|
Forum
|
|
|
Add an array string to ComboBox Source snippet, I have i coding an routine for my new toy for add an array string to a combobox.
|
|
| ragdog |
|

Extremely Active Member
     
Group: Moderators
Posts: 873
Member No.: 5019
Joined: 13-May 07

|
Hi
I have i coding an routine for my new toy for add an array string to a combobox.
| CODE | .data szTable db "0", 0 db "1", 0 db "2", 0 db "3", 0 db "4", 0 db "5", 0 db "6", 0 db "7", 0 db "8", 0 db "9", 0,0
;lpSetCursel; set cursel ;szArray; offset to the array ;IDC_ID; Resource id of the combobox ;hwnd ; hmm no comments :lol: ;call AddComboBoxItems
AddComboBoxItems proc hWnd:HWND,IDC_ID:DWORD,szArray:DWORD,lpSetCursel:BYTE push esi push edi invoke GetDlgItem, hWnd,IDC_ID mov esi,eax mov edi, szArray .while byte ptr[edi]!= 0 invoke StrStrI,edi,edi invoke SendMessage,esi,CB_ADDSTRING,0,edi xor eax,eax or ecx, -1 repnz scasb .endw invoke SendMessage, esi, CB_SETCURSEL, lpSetCursel, 0 pop edi pop esi ret AddComboBoxItems endp
|
I have me wonder why i cannot post in the source snipped froum Greets, ragdog
|
| |
|
|
|
| ChillyWilly |
|
Very Very Active Member
    
Group: Members
Posts: 91
Member No.: 5730
Joined: 5-January 08

|
i tried like this but only monday shows the list doesnt drop down to show the others | CODE | .data week db "Monday",0 db "Tuesday",0 db "Wednesday",0 db "Thursday",0 db "Friday",0 db "Saturday",0 db "Sunday",0 db 0; terminator
.data? hInstance dd ? .code start: invoke GetModuleHandle, NULL mov hInstance, eax invoke InitCommonControls invoke DialogBoxParam, hInstance, IDD_MAIN, 0, offset DlgProc, 0 invoke ExitProcess, eax
AddComboBoxItems proc hWnd:HWND,IDC_ID:DWORD,szArray:DWORD,lpSetCursel:BYTE push esi push edi invoke GetDlgItem, hWnd,IDC_ID mov esi,eax mov edi, szArray .while byte ptr[edi]!= 0 invoke StrStrI,edi,edi invoke SendMessage,esi,CB_ADDSTRING,0,edi xor eax,eax repnz scasb .endw invoke SendMessage, esi, CB_SETCURSEL, lpSetCursel, 0 pop edi pop esi ret AddComboBoxItems endp DlgProc proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD mov eax,uMsg .if eax == WM_INITDIALOG invoke LoadIcon,hInstance,200 invoke SendMessage, hWin, WM_SETICON, 1, eax invoke AddComboBoxItems,hWin,1002,addr week,0 .elseif eax == WM_COMMAND mov eax,wParam .if eax == IDB_EXIT invoke SendMessage, hWin, WM_CLOSE, 0, 0 .endif .elseif eax == WM_CLOSE invoke EndDialog, hWin, 0 .endif
xor eax,eax ret DlgProc endp
end start |
|
| |
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
|
|
|