News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

we add string index to combobox

Started by mumin16, May 26, 2009, 10:50:15 AM

Previous topic - Next topic

mumin16

invoke SendDlgItemMessage,hWnd,IDC_MONTH,CB_ADDSTRING,0,CTXT("January")
invoke SendDlgItemMessage,hWnd,IDC_MONTH,CB_ADDSTRING,0,CTXT("February")
invoke SendDlgItemMessage,hWnd,IDC_MONTH,CB_ADDSTRING,0,CTXT("March"")
....
....
.....



can we add string index to combobox as follows?

invoke SendDlgItemMessage,hWnd,IDC_MONTH,CB_ADDSTRING,0,CTXT("January",13,10,"February",13,10,"March",13,10,"......")

Mark Jones

It doesn't appear so mumin, looking through several sources here, they all process each line separately.

MSDN seems to indicate it takes one parameter (LPARAM==LPCTSTR): http://msdn.microsoft.com/en-us/library/bb775828(VS.85).aspx

The code could be simplified by placing the call to SendDlgItemMessage after a jump label, and "invoking" that (with manual stack handling.) Or better yet, just make a separate "cracking" function, pass the hWnd, IDC_MONTH, and CR+LF-seperated string pointers to it, and "crack" each string. Just a little loop and conditional testing.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08