473,395 Members | 1,456 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,395 software developers and data experts.

popup windows killer

I'm working with twain and would like to work around a probem i have where
some twain drivers that pop up windows to display errors. this is somewhat
problematic as my twain app is running as a service without a user to click
OK.
I think what I'm looking for is a system wide hook to check for a known
window titles, then when a window is opening and then send a message to that
window. Seems like this will involve some heavy interop that that doesn't
bother me nearly as much as these pop up error messages. Anybody have an
idea of what messages I'm looking to process?

Or if you have a better/alternate solution I'd love to hear it.

thanks tons,
gabe

Jun 1 '06 #1
4 1354
=?Utf-8?B?Z2FiZQ==?= <ga**@discussions.microsoft.com> wrote in
news:DA**********************************@microsof t.com:
I'm working with twain and would like to work around a probem i have
where some twain drivers that pop up windows to display errors. this
is somewhat problematic as my twain app is running as a service
without a user to click OK.
I think what I'm looking for is a system wide hook to check for a
known window titles, then when a window is opening and then send a
message to that window. Seems like this will involve some heavy
interop that that doesn't bother me nearly as much as these pop up
error messages. Anybody have an idea of what messages I'm looking to
process?

Or if you have a better/alternate solution I'd love to hear it.

thanks tons,
gabe


I've done quite a bit of this type of development. You should use API
calls for this. Unless someone has a better solution, you would poll the
window list and see if your window is open, then enumerate the child
windows on the dialog and send a BM_CLICK message to it using the api
POSTMESSAGE or SENDMESSAGE. DO a search for GetWordWindow on Google for
an example of how to get a window handle from it's name or a substring.

There are a lot of ways to do this. I would be interested to know if
there is a sink or callback that can be used instead of polling the
window list... Any guru's out there?
--
*~!NumbLock!~*
Jun 1 '06 #2
gabe wrote:
I'm working with twain and would like to work around a probem i have where
some twain drivers that pop up windows to display errors. this is somewhat
problematic as my twain app is running as a service without a user to click
OK.
I think what I'm looking for is a system wide hook to check for a known
window titles, then when a window is opening and then send a message to that
window. Seems like this will involve some heavy interop that that doesn't
bother me nearly as much as these pop up error messages. Anybody have an
idea of what messages I'm looking to process?

Or if you have a better/alternate solution I'd love to hear it.

thanks tons,
gabe


Not used this via VB.NET as yet, but you could use a tool called BoxEater. Whilst the webpage and
doco talk about Gupta's SQLWindows, yes some of us poor buggers still use it from time to time, the
source is included in the zip and is straight C++.

We use this extensively and have found it to be one of those things we just couldn't live without.

Anyway, check it out. I think it might be exactly what your looking for.

http://cschubert.net/html/boxeater.html
Jun 2 '06 #3
Thanks for the reply, and yeah, that’s the conclusion I came to as well. I
finished it last night. There are 3 twain functions (win32 calls to
twain_32.dll) that *sometimes* produce a vendor specific dialog box - like if
the device isn't plugged in. (It’s sad that you can't reliably control twain
devices with _just_ the twain API but that’s another rant).
I'm using EnumWindows/EnumWindowsCallback with GetWindowText and
GetClassName to generate a snapshot before my twain call, then I poll until
the twain call completes (about a quarter of a sec). When/if I find a new
dialog I use FindWindow/SendMessage to close the dialog.
The downside is that is doesn't seem to be the case that all dialogs are
created equal. Some of the vendors (*cough*EPSON*cough*) have yes/no dialogs
that default to opening their diagnostic package while others just use an ok.
Meaning that BM_CLICK isn't going to work for everyone and I'm going to have
to check by window title what command to send... what a drag.
This seems to be working well, but I'll second that call for anyone who
knows of a sink or callback that can be used instead of polling.
While you're here, maybe you can save me another post. The lpWindowName
parameter in FindWindow gives me the ability to search for what would be the
Caption if these were .Net messageboxes. How would I get what would be the
Messagebox.Text? Is it possible if we assume that the lpClassName is #32770?
If anyone can think of a better way to kill the dialog than to use spy++
to document each and every dialog that I want to suppress I'd love to hear
it. WM_ClOSE doesn't close them all, and depending on the dialog BM_CLICK
does the opposite of what I want.

Thank you again,
gabe

Jun 2 '06 #4
box eater looks and sound like the trick... but the included source doesn't
seem to compile with either vs6 or vs2005 and to be honest my c++ kungfu is
weak. this may provide the solution, but it'll take some time.

thank-you
gabe
Jun 2 '06 #5

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

Similar topics

4
by: owen | last post by:
For some reason pop up windows are no longer working on my pc. And no, I dont have any popup killer installed. The problem is across all websites I look at on my browser. Is there any...
9
by: Bill M. | last post by:
How do pop-up blocker programs work? Do they intercept http transactions and strip-out window.open() commands? Is there a single methodology? Thanks
2
by: Maik | last post by:
I Need a popup-killer script
5
by: Bob Bedford | last post by:
From my page, I've to create a page wich shows some images. I'd like to show those images without the IE or Netscap toolbar. I've two ways: 1- window.open, wich let me do everything (remove bar,...
9
by: ALPO | last post by:
Any good advice or examples of popup data entry windows for ASP.NET?
6
by: Kelvin Nguyen | last post by:
Hi everyone I'm making page which will provide date for the user. I would like to use calendar provided by .NET. It should look like this ----------------- (icon) I would like to know...
20
by: ruca | last post by:
Hi, DESCRIPTION: I'm developing an application that when I need to insert a date, I use 3 textbox's and one image button. This image button open's a small popup window with a calendar,...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.