as in previous post, i am using followwing code to detect the shutdown
When the program is in the while loop, if a shut down comes, the break point put inside above fucntion is not hit. So what do event i have to put it in the loop so that when a shutdown messge happens, i get out of the loopCode:protected override void WndProc(ref Message m) { if (m.Msg == WM_QUERYENDSESSION) { isShuttingDown = true; } base.WndProc(ref m); }
Did u mean put the code in do while loop?
like this ?
Code:do { path = "d:\\madavas2.txt"; deletefiles(path); createfiles(path); readtext = readroutetable(); regMatch = "Active Routes:"; ActiveRoutes(regMatch, readtext); Thread.Sleep(1000); currentgateway(); statuszain = comparerangeforz(); if (statuszain == true) { statusmada = comparerangeformada(); } if (statusmada == true) { break; } } while (statusmada == false);





Reply With Quote