My application is acting as client .In my windows screen everything is right but as my server application gets connected with my client application ,my window screen gets hanged .My client application is running perfectly ok but i cannot minimize or cancel my client application window,it gets hang. I think this is because onpaint() and other function all are running at the same time . which i feel its a DeadLock. Any idea to solve the problem .