mirror of
https://github.com/LMMS/lmms.git
synced 2026-01-26 07:18:13 -05:00
Minor fixes
From MSDN: "In WM_SYSCOMMAND messages, the four low-order bits of the wParam parameter are used internally by the system. To obtain the correct result when testing the value of wParam, an application must combine the value 0xFFF0 with the wParam value by using the bitwise AND operator." Also calculate the required window size using AdjustWindowRect, rather than hard-coding some constants.
This commit is contained in:
@@ -730,8 +730,10 @@ void RemoteVstPlugin::initEditor()
|
||||
m_windowWidth = er->right - er->left;
|
||||
m_windowHeight = er->bottom - er->top;
|
||||
|
||||
SetWindowPos( m_window, 0, 0, 0, m_windowWidth + 8,
|
||||
m_windowHeight + 26, SWP_NOACTIVATE |
|
||||
RECT windowSize = { 0, 0, m_windowWidth, m_windowHeight };
|
||||
AdjustWindowRect( &windowSize, dwStyle, false );
|
||||
SetWindowPos( m_window, 0, 0, 0, windowSize.right - windowSize.left,
|
||||
windowSize.bottom - windowSize.top, SWP_NOACTIVATE |
|
||||
SWP_NOMOVE | SWP_NOZORDER );
|
||||
pluginDispatch( effEditTop );
|
||||
|
||||
@@ -1968,7 +1970,7 @@ LRESULT CALLBACK RemoteVstPlugin::wndProc( HWND hwnd, UINT uMsg,
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if( uMsg == WM_SYSCOMMAND && wParam == SC_CLOSE )
|
||||
else if( uMsg == WM_SYSCOMMAND && (wParam & 0xfff0) == SC_CLOSE )
|
||||
{
|
||||
__plugin->hideEditor();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user