- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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!!
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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?
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
@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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
(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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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).
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
@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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
