When you use a combo box in a dialog box, you usually respond to the WM_INITDIALOG message by initializing the combo box. The code example in Creating a Spell Dialog Box calls the application-defined OpenDictionary
function to load the dictionary. It then calls the application-defined SelectNextWord
and InitSpellList
functions to select the first misspelled word.
SelectNextWord
selects the next word in the edit control and copies it to the specified buffer. InitSpellList
determines whether the selected word is in the dictionary. If not, it places the word in the selection field of the combo box and adds suggested spellings to the list.
The dialog box procedure processes the WM_DESTROY message to free the resources allocated to the spelling dictionary.