Hi, I'm learning Win32 Asm in my spare time at work and I have this nagging problem.

I have used a Resource Editor to create a dialog box containing a listbox control. I need to determine the window handle for the listbox to be able to send messages to it. However I cannot find out how to do it.

I have 2 suspicions:
1) There is a function to convert the constant id assigned to the listbox to its window handle. I cannot find any such function

2) I have to trap a message that the listbox sends when it is created. I cannot find a list of messages that are sent by a list box.

I could use WindowFromPoint but its a yucky approach !

Thanks in advance !
Posted on 2002-04-22 10:50:32 by grimaus
Yes there is a Function for C++ to do this




HWND GetDlgItem(
HWND hDlg, // handle to dialog box
int nIDDlgItem // control identifier
);


Parameters

The Parameters are obvious i am guessing
hDlg is the Handle to your Dialog
and nIDDlgItem is the Item Index (ID # of your Combo Box

The Return Value is going to be your Handle that you can use to manipulate the ComboBox or ComboBoxEx
Posted on 2002-04-22 10:54:13 by Volcano_88101