The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: mumin16 on May 26, 2009, 10:50:15 AM

Title: we add string index to combobox
Post by: mumin16 on May 26, 2009, 10:50:15 AM
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,"......")
Title: Re: we add string index to combobox
Post by: Mark Jones on May 26, 2009, 03:37:22 PM
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.