Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ProcessWindowStyle having no effect!

Status
Not open for further replies.

Navitas

Programmer
Jul 20, 2004
24
0
0
GB
Hi,

Please can someone explain what is going wrong???!!!!

Here is the code from a sub that launches a program using the file extension:

Private Sub displayDoc(ByVal args As String)

Dim startargs As New System.Diagnostics.ProcessStartInfo(args)
startargs.WindowStyle = ProcessWindowStyle.Minimized
Dim doc As New System.Diagnostics.Process
doc.Start(startargs)


End Sub

Assume args has a value of c:\data\records.xls

Now while the above proccess does work - excel starts and loads the appropriate file - the ProcessWindowStyle has no effect. As you can see I want it to open minimised on the taskbar. If I msgbox the ProcessWindowStyle, it states that it is minimised - which is funny cos it's sitting right in the middle of the screen!!

If I pass in the executible as a filename - ie excel.exe and the file to open as an arguement, the ProcessWindowStyle works perfectly!

Is there any way round this - or is it just the way it is?

I have to do it this way - as I cannot be sure of the application the end user will have installed on their machine. I may be excel, or it may be star office etc hence the reason for opening by file association.

Thanks for any help in advance

Darren
 
Anybody????[sadeyes]

Or does this not make any sense to anyone??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top