The important rule about bathroom electrics is that, apart from shaver sockets, fundamentally you can't have any power sockets in there. There may be some exceptions, but they don't apply here.
However, you can have power going into a bathroom if you hard wire the device and have a switch outside the bathroom that can turn the device off (we have a couple of heated towel rails wired this way).
So as long as your de-humidifier isn't directly above the sink, bath or shower and wired this way it should be OK.
However, with all these things consult an electrician. Even if you do end up doing it yourself getting professional advice is always a good idea.
You can easily run an exhaust fan through a window opening. Look at all the window mounted air conditioners. Same concept without the cooling capability. The main constraints are cost and appearance. As you can imagine, the more handsome the installation, the more it will cost. You basically will want to use a small square duct fan, similar to a very small box fan or very large computer fan. You should consider at least a short duct so you can incorporate a backdraft damper to minimize infiltration when the fan is not in use. You may also want a louvered grille for appearance or privacy reasons. Depending on how this is accomplished, the exterior decorative bars may need to be reworked slightly.
It sounds like this window is in or above the shower itself. In such a case, all electrical work will need to be approved for wet locations (I believe if above 72" from floor, only damp location measures are required, but please verify this). The simplest installation would be to open the window, run the duct through the opening and close off the remaining opening with an insulated panel of some sort. The sliding panes will need to be fixed in place somehow for security. Fan wiring can be run in surface mounted EMT tubing.
A better solution is to remove the wood window, which is not the best material for wet locations. Install the fan/duct and some minimal infill framing in the rough opening. Any wood in contact with masonry should be pressure treated. Install a new PVC window in the new, smaller opening, with obscure glass. A cleaner look will be achieved if you can hide the fan wiring behind finished surfaces. Depending on existing conditions, this can be somewhat simple or quite expensive.
A glass brick solution is also possible. Depending on the size of your opening and the brick module size, it may be an excellent or poor solution. Ideally, you may need no infill panel at all, the duct may fit nicely in one corner. Or so much infill is needed that the glass brick solution is just too visually insubstantial to be worth doing at all.
Best Answer
I have done several different things here. In several houses I have mounted the fan directly on the wall close to the roof with the exhaust going through the side. I have also mounted the fan in the first 16” and punched a 4” hole through the joist is sitting on the wall so it’s not a structural problem. The 3rd and hardest but best looking was to build a small plenum with intakes mounted horizontally at the top with the exhaust through the wall, I also incorporated some lights in the plenum so it looked very nice. The fan on the wall direct exit was the easiest but did not look that great to me. I have used this on homes we flipped where cost and speed matter.
With the fan in the ceiling close to the wall it looked ok but it was closer to the wall than I thought looked good I have used this method many times on new construction it can be done in a remodel but drilling through the sheathing and siding is a bit tougher on a remodel but can be done, if pulling some Sheetrock down it is much easier.
In my own home I have the plenum it really looks nice and is the quietest but close to 3x the cost of just a fan and a exterior jack with a damper. we used this method on ~half a dozen spec homes and I like it the best.