SetWindowRgn problems
-
Hi, I have a audio player that is skinned. There are 4 seperate regions (different states in the player). I create these regions before hand on program start up. My problem is that when I try to set a region that has already been used before the SetWindowRgn function fails (I'm guessing because windows deleted it or something) I want to avoid creating the region on the fly because it takes a second or so to create the region from the bitmaps that I use for skinning. Is there anyway to stop windows from deleteting the region after you set the window region to a different one. Thanks
-
Hi, I have a audio player that is skinned. There are 4 seperate regions (different states in the player). I create these regions before hand on program start up. My problem is that when I try to set a region that has already been used before the SetWindowRgn function fails (I'm guessing because windows deleted it or something) I want to avoid creating the region on the fly because it takes a second or so to create the region from the bitmaps that I use for skinning. Is there anyway to stop windows from deleteting the region after you set the window region to a different one. Thanks
Ceri wrote: Is there anyway to stop windows from deleteting the region after you set the window region to a different one No. MSDN states: After a successful call to SetWindowRgn, the operating system owns the region specified by the region handle hRgn. The operating system does not make a copy of the region, so do not make any further function calls with this region handle, and do not close this region handle But you can use CRgn::CopyRgn() to make a local copy of your region, before you feed it to the API.
My opinions may have changed, but not the fact that I am right.
-
Hi, I have a audio player that is skinned. There are 4 seperate regions (different states in the player). I create these regions before hand on program start up. My problem is that when I try to set a region that has already been used before the SetWindowRgn function fails (I'm guessing because windows deleted it or something) I want to avoid creating the region on the fly because it takes a second or so to create the region from the bitmaps that I use for skinning. Is there anyway to stop windows from deleteting the region after you set the window region to a different one. Thanks
Ummm. Maybe you can copy the region (
CopyRgn
) before passing it on to the windows withSetWindowRgn
so that you have always a fresh copy to work with. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo -
Ceri wrote: Is there anyway to stop windows from deleteting the region after you set the window region to a different one No. MSDN states: After a successful call to SetWindowRgn, the operating system owns the region specified by the region handle hRgn. The operating system does not make a copy of the region, so do not make any further function calls with this region handle, and do not close this region handle But you can use CRgn::CopyRgn() to make a local copy of your region, before you feed it to the API.
My opinions may have changed, but not the fact that I am right.
-
Sorry, I have no idea. Just remember to tell here if you find out ;) Good luck with you project!
My opinions may have changed, but not the fact that I am right.