The dehumidifier will remove moisture content from the air, but it heats the room while doing it. Unlike a window air conditioner, a dehumidifier does not contain Freon to absorb the heated air and it does not vent heated air outside.
Air in a dehumidifier passes through cooling coils, known as the evaporator. It then passes through a series of heating coils, known as the condenser. The dry heated air fills the room.
In a window air conditioner, heated air from the room enters the unit and passes through the evaporator filled with Freon. The Freon cools the air and the air conditioner pipes the cooled air back into the room. The heated air and liquid by-product is vented outside.