flat assembler
Message board for the users of flat assembler.

Index > Windows > [solved] Add item to combo box control

Author
Thread Post new topic Reply to topic
mns



Joined: 20 Dec 2007
Posts: 150
Location: Piliyandala,Sri lanka
mns 23 Sep 2013, 18:19
i written below code but not successful.Please can some one help me to find where i have done wrong.
format PE GUI 4.0
entry start

include 'WIN32ax.inc'





IDD_DIALOG1 = 101
IDD_DIALOG2 = 102

IDB_BUTTON1 = 201
IDCANCEL = 202

IDB_BITMAP1 = 301
IDB_BITMAP2 = 302
IDB_BITMAP3 = 303
IDB_BITMAP4 = 304

IDC_STATIC1 = 401
IDC_STATIC2 = 402
IDC_STATIC3 = 403

IDC_CALENDER1 = 501

IDB_BITMAPBTN1 = 601

IDC_COMBO1 = 701



txtcombo1 db '84',0
txtcombo2 db '85',0
txtcombo3 db '86',0
txtcombo4 db '87',0
txtcombo5 db '88',0
txtcombo6 db '89',0
txtcombo7 db '90',0

hbit dd ?
vv dd ?
hFile dd ?
dwWritten dd ?
ps dd ?
hdc dd ?
hfont dd ?
calen dd ?
comboboxH dd ?



section '.code' code readable executable


;--------------------------------------------------------------------------------------------------------------------------------------
start: invoke GetModuleHandle,0
mov [vv],eax


;--------------------------------------------------------------------------------------------------------------------------------------

invoke DialogBoxParam,eax,IDD_DIALOG1,0,DlgDlg1,0
invoke ExitProcess,0
or eax,eax
jz exit
exit:
invoke ExitProcess,0



;-------------------------------------------------------------------------------------------------------------------------------------
proc DlgDlg1 hwnddlg1,msg,wparam,lparam


push ebx esi edi

cmp [msg],WM_INITDIALOG
je .wmcreate
;cmp [msg],WM_PAINT
;je .wmpaint
cmp [msg],WM_COMMAND
je .wmcommand
cmp [msg],WM_CLOSE
je .wmclose
xor eax,eax
jmp .finish

.wmcreate:
invoke InitCommonControls



invoke CreateWindowEx,WS_EX_WINDOWEDGE,"button",'EXIT',WS_CHILD+WS_VISIBLE,,48, 258, 90, 35,[hwnddlg1],IDB_BUTTON1,[vv],0


invoke CreateWindowEx,WS_EX_WINDOWEDGE,"COMBOBOX",0,WS_OVERLAPPED+WS_CHILD+WS_VISIBLE+WS_VSCROLL+CBS_DROPDOWNLIST,61,60, 58, 35,[hwnddlg1],IDC_COMBO1,[vv],0
;invoke GetDlgItem,[hwnddlg1],IDC_COMBO1
mov [comboboxH],eax
invoke SendMessage,[comboboxH],CB_ADDSTRING,0,txtcombo1
invoke SendMessage,[comboboxH],CB_ADDSTRING,0,txtcombo2
invoke SendMessage,[comboboxH],CB_ADDSTRING,0,txtcombo3
invoke SendMessage,[comboboxH],CB_ADDSTRING,0,txtcombo4
invoke SendMessage,[comboboxH],CB_ADDSTRING,0,txtcombo5
invoke SendMessage,[comboboxH],CB_ADDSTRING,0,txtcombo6
invoke SendMessage,[comboboxH],CB_ADDSTRING,0,txtcombo7
;invoke SendMessage,[comboboxH],CB_SELECTSTRING,0,txtcombo4





jmp .cmpt


.wmcommand:
cmp [wparam], BN_CLICKED shl 16 + IDB_BUTTON1
je .wmclose
jmp .cmpt





.wmclose:
invoke EndDialog,[hwnddlg1],0
jmp .cmpt

.cmpt :
mov eax,1

.finish:
pop edi esi ebx
ret



endp


;================================imports=============================================================================================================

section '.idata' import data readable
library kernel32,'KERNEL32.DLL',\
user32,'USER32.DLL',\
comctl,'COMCTL32.DLL',\
shell32,'SHELL32.DLL',\
gdi32,'GDI32.DLL',\
comdlg32,'comdlg32.DLL'

include 'api/kernel32.inc'
include 'api/user32.inc'
include 'api/shell32.inc'
include 'api/COMCTL32.inc'
include 'api/gdi32.inc'
include 'api/COMDLG32.inc'
import comctl,\
InitCommonControls,'InitCommonControls'






;====================================================================================================================================================
section '.rsrc' resource data readable

directory RT_DIALOG, dialogs


resource dialogs,\
IDD_DIALOG1, LANG_ENGLISH + SUBLANG_DEFAULT, dialog1


dialog dialog1, '(By-Madhusha)', 0, 0, 120, 180, DS_CENTER + DS_SETFOREGROUND +WS_CAPTION + WS_VISIBLE + WS_CLIPCHILDREN +WS_OVERLAPPED + WS_SYSMENU



enddialog
Post 23 Sep 2013, 18:19
View user's profile Send private message Send e-mail Reply with quote
mns



Joined: 20 Dec 2007
Posts: 150
Location: Piliyandala,Sri lanka
mns 23 Sep 2013, 18:57
Sorry I found the problem.It's the height of the CreateWindowEx of combo box control.when height increased items appeared.
invoke CreateWindowEx,WS_EX_WINDOWEDGE,"COMBOBOX",0,WS_OVERLAPPED+WS_CHILD+WS_VISIBLE+WS_VSCROLL+CBS_DROPDOWNLIST,61,60, 60, 100,[hwnddlg1],IDC_COMBO1,[vv],0


Last edited by mns on 23 Sep 2013, 19:01; edited 1 time in total
Post 23 Sep 2013, 18:57
View user's profile Send private message Send e-mail Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.