Silly as it sounds to cure an engine problem, clue here is the electric windows....
Pull the drivers side door apart and clean the electric consul with CO2 contact cleaner in a spray pack. Dust on the contacts is a known issue...
Had to drive 220km with the drivers side window down (in rain
) )
Back to the engine problems. I would be checking error codes and looking at O2 sensors, TPS and CPS in that order. That is presuming you have done plugs, etc recently...
HTH