- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i started my program in quickwin and i tought it was a very practical interface. Now im having much troubles like this. I want to close a child window, but i see the X button to close is disabled, so how can i close this window?
thanks!!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kooka wrote:
i can close it by the close(unit), funtion, but i'd like to know how to enable the X to close.
I'm having the same issue in my program that I just started, and I'm really new to quickwin. Would you happen to have been able to find a way to enable the X on the child window?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assuming you can find the child window's handle, you can then call the WinAPI function SetWindowLong() which will enable you to change the window's style attributes. You can thus modify the child window to have a visible title bar with system controls including a cancel button. SetWindowLong() is directly accessible from IVF by including IFWIN and IFWINTY; see the discussion at MSDN for details on the various argument values for GWL_STYLE.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Paul the
@Adrian This will be possible to do but if you area newbie to the system it will not be that 'easy' to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
(Re)setting a window's attributes with SetWindowLong() will supercede the attributes set (by Quickwin?) when the window was created, that's the entire point of my suggestion. The cancel function is handled at the opsys level and will definitely close the window, whether or not the window's proc function (hidden within Quickwin) has specific code for that message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess something like:
[fortran]subroutine test_SetWindowLong_quickwin
USE IFQWIN, only : GETHWNDQQ
use ifwin, only : SetWindowLong, long, handle, WS_SYSMENU, WS_CAPTION, GWL_STYLE, WS_MAXIMIZEBOX, WS_MINIMIZEBOX
implicit none
integer(long) :: iret,iflg
integer(handle) :: hWnd
integer(4) :: iunt
iunt=1
hWnd=GETHWNDQQ(iunt) !get the handle for quickwin child window iunt
! iflg = iany([WS_SYSMENU,WS_CAPTION]) !new window attributes - test1
iflg = iany([WS_SYSMENU,WS_CAPTION,WS_MINIMIZEBOX,WS_MAXIMIZEBOX]) !-test2
iret = SetWindowLong(hWnd, GWL_STYLE, iflg)
end subroutine test_SetWindowLong_quickwin[/fortran]
In both cases (comment test1 or test2) the call to setwindowlong kills the child window but without repainting the area occupied by it. Would you suggest some different options? In the case of the test2 under debug there are also some exceptions regarding unprocessed messages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's the trouble with Quickwin (comment from a non-user): without access to the proc function you have no way of implementing operations which would otherwise be simple and straightforward. So if the child becomes kill-able via its cancel button but the parent window does not automatically repaint when the child vanishes (since, after all, how would it know?), your code could send a WM_REPAINT message to the app's parent (or, more elegantly, invalidate the rect previously occupied by the child).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Paul: Yup but the repaint isn't the problem it is that fact that the window gets killed by the attempt to modify it....
@Intel: The question of the
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A number of years ago Jugoslav provided the answer: as I remember it, it is a quirk of Windows that the x button is disabled unless the child window contains an IDCANCEL button plus a callback. I have on a number of occasions inserted into child windows an invisible IDCANCEL button (+ callback) in order to activate the x button.
Bear of little brain

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page