the following window procedure does not add the MIDI Devices on the combo box I want, i'm using CB_ADDSTRING...
where is the problem?????Code:LRESULT CALLBACK wndproc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { int nDevices; MIDIOUTCAPS moutcaps[255]; HWND hwndDevices, hwndListCaps; switch (msg) { case WM_CREATE: int i; // enumerar dispositivos MIDI nDevices = midiOutGetNumDevs(); if (nDevices == 0) { MessageBox (0, "No MIDI devices available.", "Error", MB_ICONSTOP); exit(EXIT_FAILURE); } hwndDevices = GetDlgItem(hwnd, IDC_DEVICE); hwndListCaps= GetDlgItem(hwnd, IDC_LISTCAPS); for (i = 0; i < nDevices; i++) { midiOutGetDevCaps(i, &moutcaps[i], sizeof(MIDIOUTCAPS)); SendMessage(hwndDevices, CB_ADDSTRING, 0, (LPARAM)moutcaps[i].szPname); } return 0; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hwnd, msg, wparam, lparam); }
![]()
![]()




Reply With Quote