Click here to Skip to main content
16,013,082 members
Home / Discussions / C#
   

C#

 
AnswerRe: Urgent Pin
Colin Angus Mackay26-Jun-06 5:58
Colin Angus Mackay26-Jun-06 5:58 
AnswerRe: Urgent Pin
Jun Du26-Jun-06 6:03
Jun Du26-Jun-06 6:03 
GeneralRe: Urgent Pin
[DK]KiloDunse26-Jun-06 7:49
[DK]KiloDunse26-Jun-06 7:49 
AnswerRe: Urgent Pin
Dave Kreskowiak26-Jun-06 9:04
mveDave Kreskowiak26-Jun-06 9:04 
QuestionHow to find which applications are running? Pin
smurfy3426-Jun-06 4:45
smurfy3426-Jun-06 4:45 
AnswerRe: How to find which applications are running? Pin
Jun Du26-Jun-06 4:56
Jun Du26-Jun-06 4:56 
AnswerRe: How to find which applications are running? [modified] Pin
Mike Poz26-Jun-06 13:20
Mike Poz26-Jun-06 13:20 
AnswerRe: How to find which applications are running? Pin
engsrini27-Jun-06 3:52
engsrini27-Jun-06 3:52 
using System;<br />
using System.Runtime.InteropServices;<br />
using System.Windows.Forms;<br />
using System.Diagnostics;<br />
using System.Reflection;<br />
<br />
 public class OneInstnace<br />
 { <br />
 [STAThread]<br />
 public static void Main()<br />
 {<br />
 //Get the running instance.<br />
 Process instance = RunningInstance();<br />
 if (instance == null)<br />
 {<br />
 //There isn't another instance, show our form.<br />
 Application.Run (new Form());<br />
 }<br />
 else<br />
 {<br />
 //There is another instance of this process.<br />
 HandleRunningInstance(instance);<br />
 }<br />
 }<br />
 public static Process RunningInstance()<br />
 {<br />
 Process current = Process.GetCurrentProcess();<br />
 Process[] processes = Process.GetProcessesByName (current.ProcessName);<br />
<br />
 //Loop through the running processes in with the same name<br />
 foreach (Process process in processes)<br />
 {<br />
 //Ignore the current process<br />
 if (process.Id != current.Id)<br />
 {<br />
 //Make sure that the process is running from the exe file.<br />
 if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") ==<br />
 current.MainModule.FileName)<br />
 {<br />
 //Return the other process instance.<br />
 return process;<br />
 }<br />
 }<br />
 }<br />
<br />
 //No other instance was found, return null.<br />
 return null;<br />
 }<br />
<br />
<br />
 public static void HandleRunningInstance(Process instance)<br />
 {<br />
 //Make sure the window is not minimized or maximized<br />
 ShowWindowAsync (instance.MainWindowHandle , WS_SHOWNORMAL);<br />
<br />
 //Set the real intance to foreground window<br />
 SetForegroundWindow (instance.MainWindowHandle);<br />
 }<br />
<br />
 [DllImport("User32.dll")] <br />
<br />
private static extern bool ShowWindowAsync(<br />
 IntPtr hWnd, int cmdShow);<br />
 [DllImport("User32.dll")] private static extern bool<br />
 SetForegroundWindow(IntPtr hWnd);<br />
 private const int WS_SHOWNORMAL = 1;<br />
 }<br />
<br />

--Srini--Rose | [Rose]
QuestionHow can I implement Double click event for button Pin
For_IT26-Jun-06 4:18
For_IT26-Jun-06 4:18 
AnswerRe: How can I implement Double click event for button [modified] Pin
J4amieC26-Jun-06 4:58
J4amieC26-Jun-06 4:58 
GeneralRe: How can I implement Double click event for button Pin
Jun Du26-Jun-06 5:22
Jun Du26-Jun-06 5:22 
GeneralRe: How can I implement Double click event for button Pin
For_IT27-Jun-06 9:38
For_IT27-Jun-06 9:38 
Question Showing a Control underneath another Control Pin
StyrofoamSUV26-Jun-06 3:58
StyrofoamSUV26-Jun-06 3:58 
AnswerRe: Showing a Control underneath another Control Pin
MatthewAnderson26-Jun-06 4:08
MatthewAnderson26-Jun-06 4:08 
GeneralRe: Showing a Control underneath another Control Pin
StyrofoamSUV26-Jun-06 4:17
StyrofoamSUV26-Jun-06 4:17 
QuestionProblem in accessing the VSS Pin
AnnnS26-Jun-06 3:47
AnnnS26-Jun-06 3:47 
QuestionCompact Access Database using C# Pin
sgrass-11126-Jun-06 3:13
sgrass-11126-Jun-06 3:13 
QuestionMultiple Tables in one XML file Pin
PBS_LKI26-Jun-06 3:12
PBS_LKI26-Jun-06 3:12 
AnswerRe: Multiple Tables in one XML file Pin
Dustin Metzgar26-Jun-06 3:25
Dustin Metzgar26-Jun-06 3:25 
GeneralRe: Multiple Tables in one XML file Pin
PBS_LKI26-Jun-06 3:38
PBS_LKI26-Jun-06 3:38 
GeneralRe: Multiple Tables in one XML file Pin
Dustin Metzgar26-Jun-06 4:08
Dustin Metzgar26-Jun-06 4:08 
GeneralRe: Multiple Tables in one XML file Pin
PBS_LKI26-Jun-06 4:26
PBS_LKI26-Jun-06 4:26 
GeneralRe: Multiple Tables in one XML file Pin
Dustin Metzgar26-Jun-06 5:07
Dustin Metzgar26-Jun-06 5:07 
AnswerRe: Multiple Tables in one XML file Pin
Rob Graham26-Jun-06 5:14
Rob Graham26-Jun-06 5:14 
GeneralRe: Multiple Tables in one XML file Pin
PBS_LKI26-Jun-06 23:17
PBS_LKI26-Jun-06 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.