Hi,
I have some code that at a certain points wants to kill it's own object.
A simple delete can't do the work here because the code will return to the object which by then has been destroyed. This way will automaticly generate an EAccessViolation.
I figured out how I could do this properly with windows messages. I have a button which deletes the object also, so I thought I could message a click to that button so the object will be deleted after my code returns. I tried it with SendMessage, but I don't now what exactly to send. Is the HWND the handle of the form the button is on or the button handle? I know I should send an WM_LBUTTONUP.
Anybody that knows how to send this message?
I have some code that at a certain points wants to kill it's own object.
A simple delete can't do the work here because the code will return to the object which by then has been destroyed. This way will automaticly generate an EAccessViolation.
I figured out how I could do this properly with windows messages. I have a button which deletes the object also, so I thought I could message a click to that button so the object will be deleted after my code returns. I tried it with SendMessage, but I don't now what exactly to send. Is the HWND the handle of the form the button is on or the button handle? I know I should send an WM_LBUTTONUP.
Anybody that knows how to send this message?