Branislav Pavlovic

My Portfolio

  • Home
  • Work
    • Employment Projects
    • Savyva Projects
    • Freelance Projects
    • Inactive Projects
  • My Tips
    • C#
    • WordPress
    • PHP
    • Javascript
    • VB.NET
  • About Me
  • Contact

Running proccess in background

Posted on May 2009
Posted in: VB.NET.

VB.NET class for running process/application as background thread:

Public Class Shell
   
   Private Process1 As Process = New Process()
   Sub New()
   
   End Sub
   
   Public ReadOnly Property Active() As Boolean
      Get
         Return Process1.HasExited
      End Get
   End Property
   
   Public Sub Run(ByVal sProcessPath As String, ByVal sArguments As String)
      Process1.StartInfo.FileName = sProcessPath
      Process1.StartInfo.WindowStyle = ProcessWindowStyle.Minimized
      Process1.StartInfo.CreateNoWindow = False
      Process1.StartInfo.UseShellExecute = True
      Process1.EnableRaisingEvents = True
      Process1.StartInfo.Arguments = sArguments
      Try
         'Start Process
         Process1.Start()
         Wait()
      Catch ex As Exception
         MsgBox(ex.Message)
      Finally
         Process1.Close()
      End Try
   End Sub
   
   Private Sub Wait()
      If Not Process1.HasExited Then
         System.Threading.Thread.Sleep(1000)
      End If
   End Sub
End Class

Example for transparent printing txt file:

Dim sproc As New Shell
sproc.Run("notepad", " /p c:\test\example.txt" )

Example for transparent printing pdf  file with FoxitReader :

Dim pdfAppPath as String = String.Empty
Dim progamsfolder As String = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
If File.Exists(progamsfolder & "\Foxit\FoxitReader.exe") Then pdfAppPath = progamsfolder & "\Foxit\FoxitReader.exe"
   
Dim sproc As New Shell
sproc.Run(pdfAppPath, " /p c:\test\example.pdf")

Posts navigation

Page 1
  • Search

  • Recent Posts

    • Online testing platform for Medical Association of Vojvodina
    • Miltin
    • Online testing platform for General Practice members
    • Taxly – online service for personal tax return forms(Inactive)
    • Country-By-Country report export tool for Power BI
  • Skills

    ASP.NETASP.NET CoreASP.NET MVCMicrosoft AzureNodeJSPHPPower BIPower BI API visualsReactJSTypescriptVueJSWordPress
  • Links

    • PortfolioBI
    • Netiva
    • Taxly
    • Holycode
    • Opšta medicina
    • Avyva
    • TeleTrader portal
  • Archives

    2021 (1)
    • Online testing platform for Medical Association of Vojvodina
    2020 (4)
    • Miltin
    • Online testing platform for General Practice members
    • Taxly – online service for personal tax return forms(Inactive)
    • Country-By-Country report export tool for Power BI
    2019 (4)
    • Journal General Practice of the Serbian Medical Society
    • TijanaPavlovic.com
    • Avyva.com/Savyva.com
    • Webstation
    2018 (4)
    • Compliance Manager
    • Post.CH Dundas BI forms and web service
    • TopCut Belgrade
    • HelloBank financial portal
    2016 (2)
    • HTML5 Chart
    • Tinancial/Baha rank(Inactive)
    2015 (4)
    • CardioMed Technologies Consultants
    • Serbian Archives of Medicine(Inactive)
    • Media Jobs(inactive)
    • Teletrader Publisher Chart Tool
    2014 (5)
    • Maxima apartments(inactive)
    • AvicennaPrimal special hospital(inactive)
    • Ooh La La Shoes
    • Forum Serbien Deutschland
    • General Practice of Serbian Medical Society redesinged website
    2013 (3)
    • Veselinović lawyers office(inactive)
    • Baby Signs Serbia(inactive)
    • Serbian Institute of Occupational Health
    2012 (11)
    • MusculusLux(Inactive)
    • Karanovic/Nikolic blog(Inactive)
    • Gynecology-Obstetrics Section of Serbian Medical Society(Inactive)
    • TikiCoolBlog
    • Neurology Section of Serbian Medical Society(Inactive)
    • Create smooth page scrolling button using javascript
    • My favorite WordPress plugins
    • How to measure text width(in pixels) of the input box value or select box text
    • How to block typing special characters into the search box
    • Remove custom filters in page with multiple query_posts
    • Karanovic/Nikolic intranet application
    2011 (7)
    • Validate email address using regular expression
    • New TeleTrader portal
    • Cardiac Section of Serbian Medical Society(Inactive)
    • Fundsprofessionell web portal
    • Karanovic/Nikolic website(inactive)
    • Sparkasse Kärnten fund portal
    • Karanovic/Nikolic linkedout application
    2010 (1)
    • Read page content from url
    2009 (4)
    • Running proccess in background
    • GTP DocGuide
    • Section of Clinical Pharmacology of The Serbian Medical Society(inactive)
    • Serbian Society of Otorhinolaryngology – Serbian Medical Society(inactive)
    2008 (2)
    • direktanlage.at financial portal(Inactive)
    • GTP-Infocollector(DocAssitant) application
    2007 (2)
    • Serbian Medical Society Website(Inactive)
    • GTP Helpdesk
    2004 (2)
    • RDG Raiffeisen Datennetz GmbH(Inactive)
    • APA FinanceMonitor
Proudly powered by WordPress Theme: Parament by Automattic.
top ↑
bottom ↓