January 26, 2023, 09:18:38 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Detecting memory changes

Started by sapero, October 02, 2007, 03:59:03 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sapero

October 02, 2007, 03:59:03 AM Last Edit: October 02, 2007, 05:16:29 AM by sapero
This example shows how to detect (and deny) memory changes. This technique is usefull when you need to detect
MyProperties->Visible = false;
And automatically call ShowWindow().

The detection is based on structured exception handling, here MyProperties->Visible is placed in memory with read only access, so any write attempt will generate exception, where the handler code first allows the write, then calls OnMemoryChange where you can do some actions, or restore the changed value.

EDIT: added practical example, in OnControl a single "properties->Minimize = true;" minimizes the window.

ExMember001