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

MessageBox and the Foreground Window?

I am trying to capture the Windows QueryCancelAutoPlay message that is sent
to the "foreground window" when an AutoRun enabled CD is inserted into a
drive.

Enabling and Disabling AutoRun
http://tinyurl.com/2m26

If my MainForm uses MessageBox.Show to prompt the end-user to insert a CD,
I'd like to know whether MainForm or my MessageBox is the "foreground
window". Any ideas?

Regards,

Carl
Nov 21 '05 #1
3 3432
"Carl Fenley" <clfenley-X-@-X-wcpci.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to capture the Windows QueryCancelAutoPlay message that is sent
to the "foreground window" when an AutoRun enabled CD is inserted into a
drive.

Enabling and Disabling AutoRun
http://tinyurl.com/2m26

If my MainForm uses MessageBox.Show to prompt the end-user to insert a CD,
I'd like to know whether MainForm or my MessageBox is the "foreground
window". Any ideas?

Regards,

Carl


I think I just found out the answer is that the MessageBox is the
"foreground window" rather than the Form that instantiated it. If anyone
disagrees with that, please respond in this thread.

Regards,

Carl
Nov 21 '05 #2
Do you have a code fragment that you could share that shows how to disable
AutoRun?
--
Dennis in Houston
"Carl Fenley" wrote:
"Carl Fenley" <clfenley-X-@-X-wcpci.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I am trying to capture the Windows QueryCancelAutoPlay message that is sent
to the "foreground window" when an AutoRun enabled CD is inserted into a
drive.

Enabling and Disabling AutoRun
http://tinyurl.com/2m26

If my MainForm uses MessageBox.Show to prompt the end-user to insert a CD,
I'd like to know whether MainForm or my MessageBox is the "foreground
window". Any ideas?

Regards,

Carl


I think I just found out the answer is that the MessageBox is the
"foreground window" rather than the Form that instantiated it. If anyone
disagrees with that, please respond in this thread.

Regards,

Carl

Nov 21 '05 #3
"Dennis" <De****@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
Do you have a code fragment that you could share that shows how to disable
AutoRun?
--


I derived my solution from Duncan Mackenzie's sample, which can be found
about half way down the following page:

http://www.duncanmackenzie.net/Samples/default.aspx

Download the ZIP file and run it. Instead of disabling Autorun, you will
see that it "intercepts" the QueryCancelAutoPlay message and handles it. Be
aware that Duncan has added some necessary code to the "Windows Form
Designer generated code" region.

Regards,

Carl
Nov 21 '05 #4

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

Similar topics

7
by: one2001boy | last post by:
Hello, I have an executable file lanuched from another application. is there a way to make thie executable file foreground if it is launched from other application? Thanks.
0
by: Tom | last post by:
Here is a very strange problem that I am stumped by. I have a rather large application written in VB.NET (of course) using Framework 1.1. As you know, with an MDI application you can have multiple...
4
by: fdmaxey | last post by:
I have a VB.Net windows application which must look as if it was embedded in a larger windows application. The 2nd application will not allow embedding of a VB.Net application - only ActiveX. ...
10
by: Ed Bitzer | last post by:
One option of the messagebox object indicates it can be placed over a selected window rather than just appearing centered on the desktop. The function is "Overloads Public Shared Function...
1
by: Terry Olsen | last post by:
In my chat application, I create a new window for each private chat. I use the FlashWindowEx API to flash the window if it's not the Foreground window. I determine the Foreground window using the...
4
by: Carsten Schmitt | last post by:
Hello, I want to draw a simple pixel (i.e. a red pixel in the center of the screen), which is always in the foreground - even when running a fullscreen application like a DirectX game. I need...
1
by: kia | last post by:
Is there any way with JavaScript(I mean programmatically) that we can open the window as a new foreground tab, every time a new tabbed window is opened? For example, like IE7, when user clicks a...
2
by: Stephan Steiner | last post by:
Hi I need to start a GUI application from a console app. Upon startup, the application can display one or two popups, which need clicking away. I have all this handled using FindWindow,...
17
by: M O J O | last post by:
Hi, How can I force a form to the foreground no matter what application is in front? Thanks! M O J O
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.