Hi, I'm currently using the following code to find and close a window:
However, I need to know if the window was there, or if the closing was done on something that didn't exist so I can use this information later. I suppose it would also be better to check it existed before trying to close it, but that's not vital as this works for now.
I've checked the return value of FindWindow when the window wasn't there and it still gets a number returned, so how would I check if it really was there?
Code:
Handle := FindWindow(nil,'Window name here');
ShowWindow(Handle,SW_CLOSE);
However, I need to know if the window was there, or if the closing was done on something that didn't exist so I can use this information later. I suppose it would also be better to check it existed before trying to close it, but that's not vital as this works for now.
I've checked the return value of FindWindow when the window wasn't there and it still gets a number returned, so how would I check if it really was there?