Hello, Here is the code private void button3_Click(object sender, EventArgs e) { button3.Enabled = false; Process proc = new Process(); proc.StartInfo.FileName = "notepad.exe"; proc.EnableRaisingEvents = true; proc.Exited += new EventHandler(proc_Exited); proc.Start(); } void proc_Exited(object sender, EventArgs e) { myDelgate d = new myDelgate(enableBtn); this.Invoke(d); } void enableBtn() { button3.Enabled = true; } Remember u should add the statement public delegate void myDelgate(); inside the class which declare a delegate I hav sucessfully disable the button on starting notepad and enable afte exiting the notepad hope this code will help you.
sourabhsorate
Posts
-
What's the best way to check that -
Remoting Vs Socket for high throughput scenario?Hellow dev, according my knowledge u should go for remoting instead of sockets. Ofcourse u can implement it thorough sockets as well as remoting but remoting gives u more flexibility. Remoting can also handle multiple calls so better is to use remoting.
-
How i Lock my Harddisk drive in c#.netAs i hav seen all previous reply's to "kabhi bhi is tarah se kahabhi kaise bhi sawal mat poocho " but i m interested to give the answer here is solution. Actually locking is not done by the code. What u hav to do is, first understand the Windows Registry basics. Once u hav understood the basic about windows registry u can lock any drive on hard disk. There is key in windows registry(refer it from documentations ). I m not sure but it contais 32 bits. the bit is either 1 or 0 Suppose u want ot lock c: then simply change 1 to 0 at appropriate position. 11111111111111111111111111111111 change it to 11011111111111111111111111111111 I hav written same program that changes this registry key.
-
Getting substring from a linehi ipstefan, my sugession is read contents of file sequentially and check whether the character u r reading is ", it it is then take all next characters untill next " apprears so u can get each character between "". From these chars u can make a string by using + operator and later it can be pasted where u want. Or as u mentioned myString.find() method, i hope find method is custom method not in framework. Instead, u can use following method of class String. String myString = "abcd"; String cutString = myString.Substring(0,3); the value of cutString will be 'abc' . Try to use this method. Ok.. Hope it will help u.
-
Need Some Help PleaseHello Zubair, There are two solutions to solve your problem 1. Either you can use stored procedure or, 2. If you have programming exprience then solve your problem as follow. **First insert record in Primary table, so primary column will autoincrement its value.**Eg. suppose u r inserting student_name 'XYZ' in student table and stud_id is primary column. Now, use select query to find the value of stud_id from student table by using the name of student that u hav just inserted. eg. SELECT stud_id FROM STUDENT WHERE student_name = 'XYZ' Now, u hav obtained stud_id which was autoincremented. **Now, use this value to insert it in child table.**eg. suppose u r inserting it in table studentdetails table INSERT INTO studentdeatails (stud_id,average) VALUES (stud_id, 70) Ok... hope this will help u. Good luck
-
remote computer admin [modified]thank u sir for suggestions. Sir i havent used c++.net i only knew that remote screen capture and remote installation is possible in c++.net hene i dont know the api's can u reply me with list of api's required for this application????? Another problem i faced in c#.net is "DATATYPE CONVERSION" the problem is that according to MSDN LPTSTR,LPSTR,WORD,DWORD are the datatypes of windows o/s which are directly supported by c++.net I have invoked the functions in user32.dll , kernel32.dll to standby , restart , shutdown, hibernate the pc but when i tried to create desktop using createDesktop() given in MSDN i faced problem of datatype conversion from c#.net type to windows or c++.net types I want to know that how to convert such datatypes to c++.net types or windows types please reply me if u have any table consist of datatype conversion
-
remote computer admin [modified]I want to write a program that, 1. allow user to install softwares on remote computer. 2. & view the desktop of remote computer . Whether it is possible to write such a software or program using c#.net. It is possible to write it in c++.net but i want to write it in c#.net so whether it is possible??? please please please help me. If possible then what classes or api's are required for it. Please reply -- modified at 6:33 Thursday 23rd August, 2007