Josh you are a wizard, just didn't think about re-declaring HWND, everything works thanks)
HWND hwndW = window -> GetHandle();
HDC hdcW = GetDC(hwndW);
HICON icon = LoadIconA(GetModuleHandle(NULL), (LPCSTR)IDI_ICON1);
SendMessage(hwndW, WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icon));
HWND hwnd = renderwindow->GetHandle();
HDC hdc = GetDC(hwnd);