Computer Science, asked by moosaashrafaman, 4 months ago

what does not execute next line until the current line is correct​

Answers

Answered by SHIVAMRAIKWAR
6

Explanation:

I'm writing a simple C# console application which opens up four instances of Windows Explorer and uses Pinvoke's MoveWindow to place them around the screen. My problem is that the Process.Start command seems to run too slowly, and the MoveWindow function cannot find the process unless I deliberately slow the program down. Here is my code:

Process.Start(new ProcessStartInfo()

{

FileName = "explorer",

Arguments = location, //Defined elsewhere (for testing just ".")

UseShellExecute = false

});

int[] pos = GetPositions(position); //Little function which gets the positions I want for this window

System.Threading.Thread.Sleep(500);

IntPtr hnd = GetForegroundWindow();

bool ok = MoveWindow(hnd, pos[0], pos[1], pos[2], pos[3], false);

Similar questions