the reason rolling up the windows causes it to dim is its pulling alot of power to run the window motor. while also trying to power everything else. if you have a weak battery or an alternator that isn't charging to its full compacity then its gonna dim.
get a multi-meter and see what your battery voltage is with the car off. also check what your alternator is charging at while the car is running.