Click here to Skip to main content
15,914,111 members
Home / Discussions / C#
   

C#

 
GeneralRe: pdf printing Pin
Heath Stewart30-Jan-04 9:39
protectorHeath Stewart30-Jan-04 9:39 
QuestionWhere should I start studying for Managed DirectX if I'm a n00b? Pin
C# n00b30-Jan-04 1:27
C# n00b30-Jan-04 1:27 
AnswerRe: Where should I start studying for Managed DirectX if I'm a n00b? Pin
Mazdak30-Jan-04 1:35
Mazdak30-Jan-04 1:35 
GeneralRe: Where should I start studying for Managed DirectX if I'm a n00b? Pin
C# n00b30-Jan-04 1:42
C# n00b30-Jan-04 1:42 
GeneralRe: Where should I start studying for Managed DirectX if I'm a n00b? Pin
Mazdak30-Jan-04 1:54
Mazdak30-Jan-04 1:54 
GeneralPrinting Problem Pin
cjengler30-Jan-04 1:13
cjengler30-Jan-04 1:13 
GeneralWell now I'm convinced Pin
Rob Manderson29-Jan-04 22:41
protectorRob Manderson29-Jan-04 22:41 
GeneralRe: Well now I'm convinced Pin
Stephane Rodriguez.29-Jan-04 23:24
Stephane Rodriguez.29-Jan-04 23:24 
GeneralRe: Well now I'm convinced Pin
Brian Delahunty30-Jan-04 3:12
Brian Delahunty30-Jan-04 3:12 
GeneralRe: Well now I'm convinced Pin
Stephane Rodriguez.30-Jan-04 4:49
Stephane Rodriguez.30-Jan-04 4:49 
GeneralRe: Well now I'm convinced Pin
Brian Delahunty30-Jan-04 5:45
Brian Delahunty30-Jan-04 5:45 
GeneralRe: Well now I'm convinced Pin
Stephane Rodriguez.30-Jan-04 6:08
Stephane Rodriguez.30-Jan-04 6:08 
GeneralGDI+ problem (tough!) Pin
r929-Jan-04 22:38
r929-Jan-04 22:38 
GeneralRe: GDI+ problem (tough!) Pin
r929-Jan-04 22:39
r929-Jan-04 22:39 
GeneralRe: GDI+ problem (tough!) Pin
Shree30-Jan-04 0:44
Shree30-Jan-04 0:44 
GeneralRe: GDI+ problem (tough!) Pin
r930-Jan-04 1:56
r930-Jan-04 1:56 
Questioncontrolling the autoscroll behaviour of panel? Pin
misterbear29-Jan-04 21:49
misterbear29-Jan-04 21:49 
Answerwhat the ascii figure should look like... Pin
misterbear29-Jan-04 21:55
misterbear29-Jan-04 21:55 
GeneralRe: what the ascii figure should look like... Pin
Heath Stewart30-Jan-04 4:31
protectorHeath Stewart30-Jan-04 4:31 
GeneralRe: what the ascii figure should look like... Pin
misterbear31-Jan-04 11:30
misterbear31-Jan-04 11:30 
GeneralRegular Expression Pin
Member 33502229-Jan-04 20:36
Member 33502229-Jan-04 20:36 
GeneralRe: Regular Expression Pin
Kentamanos29-Jan-04 21:32
Kentamanos29-Jan-04 21:32 
GeneralRe: Regular Expression Pin
Heath Stewart30-Jan-04 4:03
protectorHeath Stewart30-Jan-04 4:03 
Generalprevent re-opening of application Pin
azusakt29-Jan-04 19:46
azusakt29-Jan-04 19:46 
GeneralRe: prevent re-opening of application Pin
Kentamanos29-Jan-04 20:03
Kentamanos29-Jan-04 20:03 
The best method is probably creating a "named" Mutex (in the System.Threading namespace). When your application first comes up, you try to claim the named Mutex, which is system-wide. If you can't claim it, another instance of the application is already running. The only thing you really have to do is make the name of the Mutex very unique. A good way to create something with a very unique name is to use a GUID.

So you do something like set a string up to be the Mutex name you want, like:

string mutexName = "...";

where you use a GUID in place of the ...

Then do something like:

bool weGotIt = false;
Mutex mutex = new Mutex(true, mutexName, out weGotIt);

if (weGotIt)
{
// Run like normal...
}
else
{
// Exit...another instance of the application already has it...
}

Let me know if I didn't explain this well or if you need more help.



I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.

-David St. Hubbins

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.