Bob
Sun Nov 13 04:15:40 CST 2005
:-)
--
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Brian P. Hammer" <BrianHammer@community.nospam> wrote in message
news:%23YT%23amB6FHA.3136@TK2MSFTNGP09.phx.gbl...
> Never mind.... It's too late to miss the simple thing of my app name...
>
> Brian
>
> "Brian P. Hammer" <BrianHammer@community.nospam> wrote in message
> news:%23Da6iSB6FHA.2888@tk2msftngp13.phx.gbl...
>> Bob - This doesn't seem to work in 2005. RunningProcesses.Length always
>> return 0
>>
>> Thanks,
>> Brian
>>
>> Public Enum....
>>
>> <Runtime.InteropServices.DllImport("User32.dll")> _
>> Public Shared Function ShowWindowAsync(ByVal hWnd As IntPtr, ByVal
>> swCommand As Integer) As Integer
>> End Function
>>
>>
>> <STAThread()> _
>> Public Shared Sub Main()
>> Dim RunningProcesses As Process() = Process.GetProcessesByName("Test")
>> 'Change the name above to suit your application
>> If (RunningProcesses.Length = 1) Then
>> Application.Run(New MainGUI.MDIMain)
>> Else
>> ShowWindowAsync(RunningProcesses(0).MainWindowHandle,
>> ShowWindowConstants.SW_SHOWMINIMIZED)
>> ShowWindowAsync(RunningProcesses(0).MainWindowHandle,
>> ShowWindowConstants.SW_RESTORE)
>> End If
>> End Sub
>>
>> "Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
>> news:eHX33A%235FHA.3416@TK2MSFTNGP15.phx.gbl...
>>> See the article in Windows Forms Tips and Tricks.
>>>
>>> It doesn't use a mutex but it does bring the running application to the
>>> foreground.
>>>
>>> --
>>> Bob Powell [MVP]
>>> Visual C#, System.Drawing
>>>
>>> Ramuseco Limited .NET consulting
>>>
http://www.ramuseco.com
>>>
>>> Find great Windows Forms articles in Windows Forms Tips and Tricks
>>>
http://www.bobpowell.net/tipstricks.htm
>>>
>>> Answer those GDI+ questions with the GDI+ FAQ
>>>
http://www.bobpowell.net/faqmain.htm
>>>
>>> All new articles provide code in C# and VB.NET.
>>> Subscribe to the RSS feeds provided and never miss a new article.
>>>
>>>
>>>
>>>
>>>
>>> "Brian P. Hammer" <BrianHammer@community.nospam> wrote in message
>>> news:uvSogH95FHA.4036@TK2MSFTNGP11.phx.gbl...
>>>> All - I have used mtux to check for a running app and close it down if
>>>> it a previous app instance is running. Now, when a user double clicks
>>>> on one of the saved application files, I'd like for the existing
>>>> instance of the application to come to the front and use the file the
>>>> user double clicked. I have no issues doing this when no instance of
>>>> the app is running but if it is already running, how do I go about
>>>> this?
>>>>
>>>> Thanks,
>>>> Brian
>>>>
>>>>
>>>
>>>
>>
>>
>
>