Results 1 to 2 of 2

Thread: processes

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2013
    Posts
    242

    processes

    I have a process that is called from within vb2008 code, and if it is the first time the user asks to start a process, then go start it. If it is already running, then I want to maximize the window vs starting a new instance of it. I have tried the findwindow but do not seem to get any sucess out of it.

    adam

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: processes

    Try this approach first ...

    vb.net Code:
    1. If Process.GetProcessesByName("notepad").Length = 0 Then
    2.             Me.Text = "Nah!"
    3.         Else
    4.             AppActivate(Process.GetProcessesByName("notepad").First.Id)
    5.             SendKeys.SendWait("% X") ' note, that IS a space in there
    6.         End If
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width