Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Modal dialog box problem

michael_green
Beginner
1,307 Views
Hi,
In my program modal dialog boxes used to behave normally, that is, when a user clicked outside the modal box, a beep would sound and the box would flash. Now this no longer works - user clicks outside the box, nothing happens.
I've had a long look at an example program where it works just fine, but I can't see how it works here so I can't generalise. I guess I've done something stupid - please could someone enlighten me - how is it supposed to work?
With many thanks in advance,
Mike
0 Kudos
7 Replies
anthonyrichards
New Contributor III
1,307 Views
1. What have you changed?
2. what actually happens when you run the prog and click on another window?
0 Kudos
michael_green
Beginner
1,307 Views
Anthony,
I've changed far too much to be able to backtrack. This is a large program - 63 dialogs at last count, mostly modal, about half a dozen modeless. The change in behaviour may have occurred months ago but I just didn't notice it.
When I run the program, I click on a menu item, up comes a modal dialog box, everything works fine as far as the box is concerned. But if I click outside the box, nothing happens - the box stays there waiting for input, and nothing else in the program operates. Everything is exactly as it should be except for the fact that on clicking outside the box, I don't get a bell, and the box doesn't flash. This behaviour is the same for all the modal dialog boxes that I've tested.
Thanks very much for your time. Any insights at all would be greatly appreciated.
Mike
0 Kudos
anthonyrichards
New Contributor III
1,307 Views
For sound, check Start/control panel/ sounds speech and audio devices/change the sound scheme/ (WIndows XP, similar for others versions) and check if 'default beep' has a sound associated with it.
0 Kudos
david_jones
Beginner
1,307 Views
You should check what happens for other applications, but this can be variable.I find that that dialogue boxes flash for Adobe Reader but not for Word. In fact only the title bars flash on my system ... do your dialogues have title bars? As in the case of sound, there may be other system-settings being tweaked somewhere which affect this behaviour.
0 Kudos
michael_green
Beginner
1,307 Views
Hi Guys,
There's nothing wrong with my sound. other example programs work fine - both the sound and the dialog box flashing. And yes, my dialogs all have titles.
I'm thinking of taking an example program that works and gradually modifying it to incorporate the elements of my program. When I find out the cause of the problem I'll post the answer to this list.
Thanks for your suggestions,
Mike
0 Kudos
anthonyrichards
New Contributor III
1,307 Views
Blame the Serbian army..Jugoslav wouldhave gotthis one otherwise...
0 Kudos
michael_green
Beginner
1,307 Views
Greetings all,
I have found the solution to this problem at last and I post the answer here in case it's of use to anyone else.
This is a full blown windows application. I needed to change the mouse cursor many times during the execution of the program, so I included ...
case(WM_SETCURSOR)
in the main loop. This works fine for setting the cursor, but I should have read the fine print relating to WM_SETCURSOR because it captures the mouse click when the mouse is outside a modal dialog box, and therefore prevents ...
case DEFAULT
from activating ...
MainWndProc = DefWindowProc( hWnd, mesg, wParam, lParam )
and it's this that I needed to ring the bell and flash the title bar. The solution from here on was to include a call to DefWindowProc (conditionally) in the WM_SETCURSOR handler. It all works fine now.
Mike
0 Kudos
Reply