Had a similar problem with my 1996 model lantra.
It doesn't have power windows but eventually I started getting a problem whereby upon winding the window up, it seemed to fall forward out of it's rails. The first time it happened I didn't even realise, and by the time I had wound it all teh way up it was just out to fall outwards onto the road as I was driving.
I found that this was a combination of issues though. The black glue that is used to hold the window into the frame had let go, so it was falling out of it's guide. I re-glued it in though and even though that attachment is solid now, the windown still tends to push forward (ie lean toward teh front of the car) as I start winding it up. When this happens the rear of the window comes out of the rubber guide. Most of the time it goes back in place properly as the window approaches closing, but not always.
I've inspected the window mechanism and there seems to be excess play in component that slides up and down main guide inside the door. I haven't seen any screws I can simply tighten up at this stage but I haven't investigated too thoroughly at this stage.
Black 2004 Tiburon, 2.7L V6, 6-speed manual, Australian version