我正在尝试从 3 个编辑框中获取 rgb 值,以便在运行时更改窗口的颜色。下面的代码没有给我我需要的数值。
const int bufferSize = 1024;
char fade1Buffer[bufferSize] = "";
char fade2Buffer[bufferSize] = "";
char fade3Buffer[bufferSize] = "";
HWND Editbox1 = GetDlgItem(hWnd,IDC_MAINFADE1_EDIT);
SendMessage(Editbox1, WM_GETTEXT, (WPARAM)bufferSize, (LPARAM)fade1Buffer);
HWND Editbox2 = GetDlgItem(hWnd,IDC_MAINFADE2_EDIT);
SendMessage(Editbox2, WM_GETTEXT, (WPARAM)bufferSize, (LPARAM)fade2Buffer);
HWND Editbox3 = GetDlgItem(hWnd,IDC_MAINFADE3_EDIT);
SendMessage(Editbox3, WM_GETTEXT, (WPARAM)bufferSize, (LPARAM)fade3Buffer);
//fill our main window background
FadeVert(hWnd, RGB(fade1Buffer, fade2Buffer,fade3Buffer), RGB(255, 255, 255), (int) Client_Rect.top,
(int) Client_Rect.left, (int) Client_Rect.right, (int) Client_Rect.bottom);