bojo
January 13th, 2008, 09:25 AM
Howdy.
I've begun learning the winAPI in c/C++
My Problem is that i don't know how to populate a list box if it's made using resources?.
IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 239, 66
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Options"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&OK",IDOK,174,18,50,14
PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14
COMBOBOX IDC_COMPORTSELECT,25,16,48,30,CBS_DROPDOWNLIST | CBS_HASSTRINGS
END
Is part of the resource file.
The combo box appears in the dialogue box, but it is empty. Eventually i want to populate it with a list of the available comports on the PC. But for now if i can add in a string or two i will be happy.
but how would i do it?. I can't use sendmessage(..) because i don't know the handle of the combobox.
Also what is WM_KEYDOWN, is macro for keydown, what's the one for enter?. And how hard is it to get device information from device manager?, a list of available comports would be nice.
I've begun learning the winAPI in c/C++
My Problem is that i don't know how to populate a list box if it's made using resources?.
IDD_OPTIONS DIALOG DISCARDABLE 0, 0, 239, 66
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Options"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "&OK",IDOK,174,18,50,14
PUSHBUTTON "&Cancel",IDCANCEL,174,35,50,14
COMBOBOX IDC_COMPORTSELECT,25,16,48,30,CBS_DROPDOWNLIST | CBS_HASSTRINGS
END
Is part of the resource file.
The combo box appears in the dialogue box, but it is empty. Eventually i want to populate it with a list of the available comports on the PC. But for now if i can add in a string or two i will be happy.
but how would i do it?. I can't use sendmessage(..) because i don't know the handle of the combobox.
Also what is WM_KEYDOWN, is macro for keydown, what's the one for enter?. And how hard is it to get device information from device manager?, a list of available comports would be nice.