Alt+F4 closes parent too if parent is frame. Revelation (OpenInsight)
At 17 OCT 2001 09:07:01AM Oystein Reigem wrote:
Let's say a frame (or the child of a frame) starts another window. If one closes that second window with Alt+F4, also the frame gets closed.
The started window can be any window - frame, ordinary window, dialog, popup.
Other ways of closing the second window work fine.
Revelation - what's your opinion on this problem? What's the cause, can it be fixed, etc.
Don Bakke has experienced a similar problem with ESC and popups. I haven't been able to reproduce this other problem.
Don Bakke has a workaround that should work well in both cases, except it means a lot of work when there are many windows (e.g popups) in the app.
Other developers: How do you handle this problem?
- Oystein -
At 17 OCT 2001 09:21AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
[notag]I might be missing something but we use Ctrl-F4 to close children and Alt-F4 to close the lot. This is standard Windows behaviour?
[<A HREF="http://www.sprezzatura.com" onMouseOver="window.status='Click here to visit our web site?';return(true)">The Sprezzatura Group</A>]
[<I>World Leaders in all things RevSoft</I>]
[<img src="http://www.sprezzatura.com/zz.gif">]
[<script language="javascript">function openNewPage () {window.location.href=(document.TOCNavigator.pageToGoTo.options[document.TOCNavigator.pageToGoTo.selectedIndex].value);document.TOCNavigator.pageToGoTo.selectedIndex="0";}end hiding from non-JS browsers –></script>] [<FORM ACTION "" METHOD=GET NAME="TOCNavigator" <SELECT NAME="pageToGoTo" SIZE=1 onChange="openNewPage()"> <OPTION>Pull down this menu to choose whereabouts on the Sprezz site to go <OPTION VALUE="http://www.sprezzatura.com">Home Page <OPTION VALUE="http://www.sprezzatura.com/whatsnew.htm">What's New (Thanks Mr Clark) <OPTION VALUE="http://www.sprezzatura.com/senl.htm">SENL <OPTION VALUE="http://www.sprezzatura.com/patches.htm">Download S/LIST <OPTION VALUE="mailto:[email protected]">Send mail to support at Sprezzatura <OPTION VALUE="mailto:[email protected]">Send mail to sales at Sprezzatura </SELECT> </FORM>] [/notag] </QUOTE> —- === At 17 OCT 2001 03:03PM Oystein Reigem wrote: === <QUOTE>What I say is problematic is when a frame starts another window that is not a child of the frame. If that second window is closed with Alt+F4 the parent, i.e, the frame, is closed too. I agree with what you say about using Ctrl+F4 to close a child and Alt+F4 to close the frame and all its children. I'm a bit surprised I didn't see the problem earlier, and that it's not caused more of a stir among other developers. But I've done some experiments with very simple windows now, so I'm certain it's not something caused by complicated design and programming in my main app. - Oystein - </QUOTE> —- === At 18 OCT 2001 12:45PM The Sprezzatura Group wrote: === <QUOTE>You might like to review this thread, which details how to Send a Windows message to close a Window. Here is another "last-resort" keyboard-macro approach coded in 32-bit Visual Basic - we realize that this might not be much help - but at least you have the relevant API calls, FWIW, should you adopt this method. Firstly use FindWindow to identify the handle of the Window to close, <code> Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Dim Ret As String Ret=Untitled - Notepad" ' Find the window - put Window Title into the variable 'Ret' above Winwnd=FindWindow(vbNullString, Ret) If Winwnd=0 Then ' no window found Exit Sub End If </code> then show the Window maximized/normal, with focus set <code> Private Declare Function ShowWindow Lib "User32" _ (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Const SW_SHOWNORMAL=1 'Show the window/provide focus ShowWindow Winwnd, SW_SHOWNORMAL </code> then fake the appropriate keystrokes to close it - exactly what someone would do under Windows manually. <code> Private Declare Sub keybd_event Lib "User32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Const VK_LCONTROL=&HA2 Const VK_RCONTROL=&HA3 Const VK_F4=&H73 Private Sub PressCtrlF4() 'clear window with Ctrl-F4 Dim ctrlscan%, f4scan% 'Depress Ctrl - the Left one on this occasion keybd_event VK_LCONTROL, ctrlscan%, 0, 0 DoEvents 'Depress F4 keybd_event VK_F4, f4scan%, 0, 0 DoEvents 'release F4 keybd_event VK_F4, f4scan%, &H2, 0 DoEvents 'release the Control Key keybd_event VK_LCONTROL, ctrlscan%, &H2, 0 DoEvents End Sub </code> The Sprezzatura Group World Leaders in all things RevSoft
</QUOTE> —- === At 19 OCT 2001 03:27AM Oystein Reigem wrote: === <QUOTE>Sprezzatura, Are we talking about the same thing??? It seems you think I have problems with getting a window to close. It's the opposite. Too many windows get closed. What I have is an MDI window that starts a second window, e.g a dialog box. When the user hits Alt+F4, that second window closes OK, but unfortunately so does also its parent - the MDI window. Does the same happen with you? - Oystein - </QUOTE> —- === At 19 OCT 2001 08:54AM Don Miller - C3 Inc. wrote: === <QUOTE>Oystein .. Yup! I've had to resort to trapping the ALT-F4 combination in dialogs (essentially the CLOSE) event. I think the CLOSE event ripples up the event chain to the parent. As an aside, on one of my client's Citrix box, the PAGE event minimizes the window to the task bar (but does do the PAGE event). Go figger that one. Cheers.. Don Miller See-thru-Ink - kind of like write-only memory </QUOTE> —- === At 19 OCT 2001 10:34AM Oystein Reigem wrote: === <QUOTE>Don, I've had to resort to trapping the ALT-F4 combination in dialogs (essentially the CLOSE) event. What do you do when the dialog is a popup? Have you made your own version of the PopUp function? - Oystein - PS. I'm curious about how Sprezzatura solve this problem. Do you think it's a trade secret? </QUOTE> —- === At 19 OCT 2001 11:01AM Don Miller - C3 Inc. wrote: === <QUOTE>Oystein .. ]]What do you do when the dialog is a popup? Have you made your own version of the PopUp function? .. You've GOT to be kidding! Much to much grief and aggrevation to do that. Maybe Carl from Sprezz will do a piece on this in SENL or something. Cheers .. Don </QUOTE> —- === At 22 OCT 2001 06:54AM Oystein Reigem wrote: === <QUOTE>Don, I didn't mean to ask if you've programmed the popup functionality from scratch. Just if you've modified the PopUp source. Shouldn't be too difficult. Or is it? I support that idea of Carl writing an article. Go for it, Carl!
Revelation - Why the silence? - Oystein - </QUOTE> —- === At 22 OCT 2001 01:27PM Cap'n C - USS Sprezzatura NZZ-1701 wrote: === <QUOTE>The engine's canna take it laddie! Cap'n C USS Sprezzatura NZZ-1701 </QUOTE> View this thread on the Works forum...