I use my windows button quite a lot while playing the game and I have never crashed. If you are running the game in a different resolution than the one your desktop is in, switching between the two resolutions might cause your video driver to destabilize and cause issues.
I would probably start by making sure you have the latest drivers for your video card. Also, if possible, try running both your desktop and STO in the same resolution to put less demand on your machine when you use the windows button. I run full screen, but my res is 1080p for both the game and my desktop.
I can't say that this will work, but with the limited information you provided this is really all I can offer.