473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Closing an alertbox

Hi,
Can anyone point me in the right direction for using C# to close an alertbox
for the admin user?

Background:
We have some servers (NT4) that are running some services that throw an
alertbox error every now and then. Now, once the alertbox 'OK' is clicked,
the services restart and continue on as normal. But UNTIL the alertbox is
clicked, the service pauses, waiting. For days on end, if someone doesn't
cotton on that one of the servers is down!
This alertbox only appears under the admin user, on the default terminal,
when we VNC or PCAnywhere to the server with the alertbox. The alertbox is
not visible when using Terminal Services - as it opens a new session or
something.
We have tried writing some VBScript to close the window, but it (sort of)
works when we leave the admin user logged into the server.

So it's a strange sort of a question:
1 - how can I create a c# service that monitors the default terminal for a
certain alertbox, and closes it automatically?

Thanks,
Lance
Nov 15 '05 #1
5 2225
An interesting problem!

I can't help you figure out a way to solve this in C#. But, I wonder if a
simple product like Macro Express might work for you.
http://www.macroexpress.com.

I've used this before as a "listener" that looks for certain windows to
popup or even to check that a web server is still serving pages. With Macro
Express you could run a macro on a schedule (NT Scheduler). The macro could
look for a dialog with a particular title and click the ok button, or switch
to the dialog and press enter. That should be enough to close the dialog,
and you could schedule the macro to run every minute if you needed to.

Not the most elegant solution. But, it might get you by until something
better comes along.
"Lance @hotmail.com>" <lancestuff27<nospam> wrote in message
news:10*************@corp.supernews.com...
Hi,
Can anyone point me in the right direction for using C# to close an alertbox for the admin user?

Background:
We have some servers (NT4) that are running some services that throw an
alertbox error every now and then. Now, once the alertbox 'OK' is clicked, the services restart and continue on as normal. But UNTIL the alertbox is
clicked, the service pauses, waiting. For days on end, if someone doesn't
cotton on that one of the servers is down!
This alertbox only appears under the admin user, on the default terminal,
when we VNC or PCAnywhere to the server with the alertbox. The alertbox is not visible when using Terminal Services - as it opens a new session or
something.
We have tried writing some VBScript to close the window, but it (sort of)
works when we leave the admin user logged into the server.

So it's a strange sort of a question:
1 - how can I create a c# service that monitors the default terminal for a
certain alertbox, and closes it automatically?

Thanks,
Lance

Nov 15 '05 #2
L#
On Wed, 4 Feb 2004 09:49:38 -0000, "Lance"
<lancestuff27<nospam>@hotmail.com> wrote:
Hi,
Can anyone point me in the right direction for using C# to close an alertbox
for the admin user?

Background:
We have some servers (NT4) that are running some services that throw an
alertbox error every now and then. Now, once the alertbox 'OK' is clicked,
the services restart and continue on as normal. But UNTIL the alertbox is
clicked, the service pauses, waiting. For days on end, if someone doesn't
cotton on that one of the servers is down!
This alertbox only appears under the admin user, on the default terminal,
when we VNC or PCAnywhere to the server with the alertbox. The alertbox is
not visible when using Terminal Services - as it opens a new session or
something.
We have tried writing some VBScript to close the window, but it (sort of)
works when we leave the admin user logged into the server.

So it's a strange sort of a question:
1 - how can I create a c# service that monitors the default terminal for a
certain alertbox, and closes it automatically?

Thanks,
Lance


Maybe you can use http://www.codeproject.com/csharp/popupkiller.asp to
find windows every x minutes, check the caption of them and if it's
the popup you're looking for, closing it...
--
Ludwig
mailto:ludwig_(nospamplease)stuyck@pandora(nospamp lease).be
Nov 15 '05 #3
"Lance @hotmail.com>" <lancestuff27<nospam> wrote in message
news:10*************@corp.supernews.com...
Hi,
Can anyone point me in the right direction for using C# to close an alertbox for the admin user?


If you are going to make your own OK-jockey app you will need the Win32
FindWindow function. If the caption is enough to identify the message box,
use just that. You should be pretty confident though since you don't want to
close anything else. If the caption is too generic to be a safe identifier,
use Spy to try and find the window's ClassName too. Look for the window
every 10 seconds or so. If you get back a handle, use that in a PostMessage
with a WM_CLOSE. That should do it.

A Win32 group would be more appropriate to ask this and you will likely get
more useful answers. Since this is very much a Windows issue there is no
point using C# for this, you would be better off using a tool closer to the
Windows API.

Martin.
Nov 15 '05 #4
Thanks for the replys guys. I'll try the prebuilt solutions first, and work
to the more complex ones if the simple ones don't work.

Lance

"Lance @hotmail.com>" <lancestuff27<nospam> wrote in message
news:10*************@corp.supernews.com...
Hi,
Can anyone point me in the right direction for using C# to close an alertbox for the admin user?

Background:
We have some servers (NT4) that are running some services that throw an
alertbox error every now and then. Now, once the alertbox 'OK' is clicked, the services restart and continue on as normal. But UNTIL the alertbox is
clicked, the service pauses, waiting. For days on end, if someone doesn't
cotton on that one of the servers is down!
This alertbox only appears under the admin user, on the default terminal,
when we VNC or PCAnywhere to the server with the alertbox. The alertbox is not visible when using Terminal Services - as it opens a new session or
something.
We have tried writing some VBScript to close the window, but it (sort of)
works when we leave the admin user logged into the server.

So it's a strange sort of a question:
1 - how can I create a c# service that monitors the default terminal for a
certain alertbox, and closes it automatically?

Thanks,
Lance

Nov 15 '05 #5
Thanks, but I tried to use macroexpress today for the job, and it has a
*slight* limitation: any dialog box currently open pauses all macros, until
the dialog box is dealt with. So using a macroscript to close this box
won't work. Too bad, so sad. :-(

But this macroexpress tool is a really cool piece of kit. I've been using
it for other things all day. It's great for crappy, repetitive tasks, and
fun to hack around with! :-)

Thanks!
"Ron Rohrssen" <rl******@fightspam.rockwellcollins.com> wrote in message
news:uD**************@TK2MSFTNGP09.phx.gbl...
An interesting problem!

I can't help you figure out a way to solve this in C#. But, I wonder if a
simple product like Macro Express might work for you.
http://www.macroexpress.com.

I've used this before as a "listener" that looks for certain windows to
popup or even to check that a web server is still serving pages. With Macro Express you could run a macro on a schedule (NT Scheduler). The macro could look for a dialog with a particular title and click the ok button, or switch to the dialog and press enter. That should be enough to close the dialog,
and you could schedule the macro to run every minute if you needed to.

Not the most elegant solution. But, it might get you by until something
better comes along.
"Lance @hotmail.com>" <lancestuff27<nospam> wrote in message
news:10*************@corp.supernews.com...
Hi,
Can anyone point me in the right direction for using C# to close an

alertbox
for the admin user?

Background:
We have some servers (NT4) that are running some services that throw an
alertbox error every now and then. Now, once the alertbox 'OK' is

clicked,
the services restart and continue on as normal. But UNTIL the alertbox is clicked, the service pauses, waiting. For days on end, if someone doesn't cotton on that one of the servers is down!
This alertbox only appears under the admin user, on the default terminal, when we VNC or PCAnywhere to the server with the alertbox. The alertbox

is
not visible when using Terminal Services - as it opens a new session or
something.
We have tried writing some VBScript to close the window, but it (sort of) works when we leave the admin user logged into the server.

So it's a strange sort of a question:
1 - how can I create a c# service that monitors the default terminal for a certain alertbox, and closes it automatically?

Thanks,
Lance


Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: beeo | last post by:
Hi What's wrong here? Although "box" is empty the alertbox wont popup! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html>
4
by: bbass | last post by:
thanks to all that replyied to my previous post with the following code in question: <a href="merc.htm" target="_new_merc" onfocusout=window.close class="left_link"> i understand that the...
6
by: Al the programmer | last post by:
I want to catch the Closing event for my form. I created a test windows app using the wizard. I then create the Closing event by clicking the lightning bolt on the properties pane. The code is...
1
by: **Developer** | last post by:
When I get a closing event in a MID Child form I don't know if the child form is closing or the main form is closing. Is there a way to tell? Thank
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
4
by: Academic | last post by:
Does it make sense to put this If e.Cancel Then Exit Sub at the beginning of form closing events so if the user cancels the app's exiting in one Closing routine he will not be asked again by...
8
by: rob21century | last post by:
Hi every one, newbie here, so i big hello from me now down to business I am a web developer but i don't use java script very often, but i have created a form validation from a group of different...
2
by: amolbehl | last post by:
Hi all, I have a simple question, can we close a 'confirmbox' or an 'alertbox' without the user intervention??
16
Gwyn Thomas
by: Gwyn Thomas | last post by:
Hi All, Firstly, I apologise if this question has appeared before but I can't find it anywhere. I have created a gridview with two command buttons. When I click the buttons I want either an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.