Click to See Complete Forum and Search --> : Determine custom frame drawing windows ?


replyreply
June 12th, 2009, 03:39 PM
hi
My problem is in WM_NCPAINT message, i want to determine if the window uses custom title bar (owner drawn), so i started spy++ and processed it Message Proc, now according to WM_NCPAINT documentation ( http://msdn.microsoft.com/en-us/library/dd145212(VS.85).aspx ) that if an application processes this message (which means painted the frames) it mush returns zero, but the problem is the return of WM_NCPAINT is always zero (since that even if the user didn't return zero, the message proc will return NULL)
so is there's solution for this or another way to determine owner drawn windows ?

dc_2000
June 23rd, 2009, 07:58 PM
Well, that would be very tricky. I'm guessing that the only sure way would be to intercept DefWindowProc function call and see if it was called with the window handle to your window and the WM_NCPAINT message. I never tried it but you can read about it here:
http://www.codeproject.com/KB/system/hooksys.aspx

Maybe you should look at some other way to do it differently. What is the purpose to know that?