Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
公告
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.

How to handle WM_CLOSE signal or event?

mostlyAtNight
初学者
2,395 次查看
Hello All,

I'm having some issues with a QuickWin application I'm working with.

When the window is closed using the x in the top right corner, the window closes, but the process remains active consuming CPU cycles.

I have tried using SIGNALQQ to capture the signal generated by closing the window but none of the following signals are matched:

SIG$INT
SIG$ABORT
SIG$ILL
SIG$SEGV
SIG$TERM

Is there a way of catching a signal generated when the window is closed so I can close the application down properly?

Any help would be much appreciated.

Kind regards,

Pete
0 项奖励
1 解答
Paul_Curtis
重要分销商 I
2,395 次查看
Quoting - mostlyAtNight
I'm reasonably sure the message generated by clicking the x in the top right hand corner will be a WM_CLOSE message - any idea how to trap that in FORTRAN?

Yes, write your own proc for your Windows program and don't use quickwin.

在原帖中查看解决方案

0 项奖励
5 回复数
onkelhotte
新分销商 II
2,395 次查看
I have seen this behaviour from time to time at my projects myself. The process stays in memory and allocates more and more RAM.

But I cannot reproduce or explain it.

Markus
0 项奖励
anthonyrichards
新分销商 III
2,396 次查看
Quoting - onkelhotte
I have seen this behaviour from time to time at my projects myself. The process stays in memory and allocates more and more RAM.

But I cannot reproduce or explain it.

Markus

Look for the application SPYXX.EXE, which is usually installed along with Microsoft Visual Studio/Developer Studio and can be found in directory such as /program files/microsoft visual studio/common/tools/. This free application allows you to 'find' a window and start logging messages sent to it by the system, so you can follow what happens when you issue the WM_CLOSE message, or any other message.
0 项奖励
mostlyAtNight
初学者
2,396 次查看
Quoting - anthonyrichards

Look for the application SPYXX.EXE, which is usually installed along with Microsoft Visual Studio/Developer Studio and can be found in directory such as /program files/microsoft visual studio/common/tools/. This free application allows you to 'find' a window and start logging messages sent to it by the system, so you can follow what happens when you issue the WM_CLOSE message, or any other message.
Hi there,

Thanks for your response, I tried using this utility but each time I selected the main window of my program to try and recieve messages I keep getting the messge:

Spy++ has encountered a problem in the message hook. To prevent hanging the system, the hook has been disabled.....

I'm reasonably sure the message generated by clicking the x in the top right hand corner will be a WM_CLOSE message - any idea how to trap that in FORTRAN?

Regards,

Pete
0 项奖励
Paul_Curtis
重要分销商 I
2,396 次查看
Quoting - mostlyAtNight
I'm reasonably sure the message generated by clicking the x in the top right hand corner will be a WM_CLOSE message - any idea how to trap that in FORTRAN?

Yes, write your own proc for your Windows program and don't use quickwin.
0 项奖励
mostlyAtNight
初学者
2,396 次查看
Quoting - Paul Curtis

Yes, write your own proc for your Windows program and don't use quickwin.

Hi Paul,

Thanks for your advice, I think this will be the route we'll be taking.

Regards,

Pete
0 项奖励
回复