Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Never return from SetWindowPos() when the controlled app is busy

$
0
0

I have 2 applications.

The 1st one is written by C#, and it calls SetWindowPos() to control the 2nd app.

When the 2nd app runs well, SetWindowPos() works well.

However, if 2nd is busy(no response), the function SetWindowPos() will never return, so the 1st app will pend there, waiting for the return of SetWindowPos().

So, what's the problem?

Attached the code.

ShowWindow(ptr_Wnd, SW_SHOW);
int setWnd_Result = SetWindowPos(ptr_Wnd, HWND_TOPMOST, pos_X, pos_Y, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);

               



Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>