PDA

View Full Version : how can i know when program is close



lnd
03-14-2009, 01:34 AM
i need to do a defragment the HDD and after the defragment is complete working i need to write "complete defragment" but the message come before it complete the defragment.


result = File.Run("defrag c: -f", "", "", SW_MINIMIZE, false);
result = Dialog.Message("Notice", "complete defragment", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

ShadowUK
03-14-2009, 01:42 AM
i need to do a defragment the HDD and after the defragment is complete working i need to write "complete defragment" but the message come before it complete the defragment.


result = File.Run("defrag c: -f", "", "", SW_MINIMIZE, false);
result = Dialog.Message("Notice", "complete defragment", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);


result = File.Run("defrag c: -f", "", "", SW_MINIMIZE, true);
result = Dialog.Message("Notice", "complete defragment", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

WaitForReturn means that if you set it to true; Until the program is completed, it will stop all code from executing.