Commit 2b9d138c authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Trackbar range should be fixed only in the case of successful

mciSendStringW. It's better to initialize dwCallback parameter if MCI_NOTIFY is specified.
parent 930b7da6
......@@ -1085,15 +1085,16 @@ end_of_mci_open:
strcatW(cmdW, (WCHAR *)lParam);
mwi->lasterror = mciSendStringW(cmdW, NULL, 0, 0);
/* fix the range tracking according to the new time format */
if (!mwi->lasterror)
SendDlgItemMessageW(hWnd, CTL_TRACKBAR, TBM_SETRANGEMAX, 1,
SendMessageW(hWnd, MCIWNDM_GETLENGTH, 0, 0));
}
if (wMsg == MCIWNDM_SETTIMEFORMATA)
HeapFree(GetProcessHeap(), 0, (void *)lParam);
/* fix the range tracking according to the new time format */
if (!mwi->lasterror)
SendDlgItemMessageW(hWnd, CTL_TRACKBAR, TBM_SETRANGEMAX, 1,
SendMessageW(hWnd, MCIWNDM_GETLENGTH, 0, 0));
return 0;
}
......@@ -1159,9 +1160,12 @@ end_of_mci_open:
{
MCI_SET_PARMS mci_set;
mci_set.dwCallback = (DWORD_PTR)hWnd;
mwi->lasterror = mciSendCommandW(mwi->mci, MCI_SET,
MCI_SET_DOOR_OPEN | MCI_NOTIFY,
(DWORD_PTR)&mci_set);
MCIWND_notify_mode(mwi);
MCIWND_UpdateState(mwi);
return mwi->lasterror;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment