Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / September 2007



Tip: Looking for answers? Try searching our database.

Supress Windows Error Message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mathias Riechert - 20 Sep 2007 13:10 GMT
I am to write a command line program  that uses another command line program
to convert „*.prt“ files to „*.pdf“ files.    (mplot)
This tool causes a windows exception window (messagebox) to pop up if a file
is corrupt (File Link is missing or such things).
Language: Visual Basic 2005 Enterprise
Platform Windows Server 2003
So I embedded the Command line Tool call in a shell and included a wait time
of 120 seconds.
After this, the programm continues running.

ProcID = Shell(strbefehl, AppWinStyle.NormalFocus, True, einstWarteZeit *
1000)
This is working as designated.

The Problem is the messagebox of windows showing the error.
(the files not working are logged automatically so that the user can repair
the files manually)

Because of the circumstance that the program is supposed to run every day,
there would be many error messages on the server when cheking it a month
later.

To change this, I tried different things:
At first I tried killing the ProcessID of the Shell. This caused the
computer to restart and therefore is no possible way to handle the problem.

Then I tried to focus the Title of the ErrorMessageBox and used
SENKDEY(“{ENTER}”) to close the messagebox. This worked reliably, except on a
server where I am not logged on. (because the program will be a scheduled
task without a user logged on)
On the server it stopped at the SENDKEY command and no further code was
executed. (even if wait property is set to false)
So that is no possible way, too.

The next thing I tried was listing all the threads of the process returned
by the shell to get the index which identifies the Error Message.
Then using Process.GetProcessById(ProcID).Threads.Remove(index) would be
possible.
But here is the problem that the Process.GetProcessById(ProcID).Threads
function only returns an object of the type System.Diagnostics.ProcessThreads.
I could not find any property to compare it if it is the thread being
searched for.

Can u tell me a way to suppress the error message or handle with it?
It is not possible to use another tool because the conversion of this old
format is not supported with other tools.
Bob Butler - 20 Sep 2007 14:49 GMT
>I am to write a command line program  that uses another command line
>program
[quoted text clipped - 3 lines]
> is corrupt (File Link is missing or such things).
> Language: Visual Basic 2005 Enterprise

Signature

You need to ask in a newsgroup with "dotnet" in the name.  This group is for
VB 6.0 and earlier and does not include VB.Net or VB 200x.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.