Yuck! My guess is termites. Termites live in the soil and build mud tubes to travel in and out of your house for a free meal of luscious floor joists, wall studs or any other tasty morsel that is holding up your home sweet home.
During the warmer months, termites grow wings and swarm, leaving the safety of their deep soil nests to fly off and wreak more havoc on houses. If I'm right, there's no surprise why you found them near the window. Once termites can fly, they head right for the light.
Here's what you'll need to do. First, contact a local pest management professional and order a comprehensive inspection of your home. Much of the damage termites cause may not be obvious to you, but a trained professional can spot it a mile away.
If termites are confirmed, request a treatment be done with a new class of high tech undetectable liquid termiticides like Termidor Termite Defense (see termidorhome.com).
Undetectable termite treatments are applied to the soil around your home where the termites live. Because they can't be seen, smelled or sensed by termites in any way, termites will pass through the treated zone and get it on their bodies. Then they transfer this to other termites in the colony. The whole termite colony will get wiped out, leaving your newly remodeled home officially termite free.