PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Elias Montoya on March 14, 2008, 08:02:18 PM

Title: FF_Control_GetFont Problem
Post by: Elias Montoya on March 14, 2008, 08:02:18 PM

I am using this:

hFont     = FF_Control_GetFont(HWND_CUSTOMPROPERTIES_LABEL2)

The label is valid and has a font, however, hFont receives a null value (0), ideas?
Title: Re: FF_Control_GetFont Problem
Post by: Elias Montoya on March 14, 2008, 08:42:58 PM
 I found the problem in the generated source code...

'------------------------------------------------------------------
FUNCTION FF_Control_GetFont (BYVAL hWndControl AS DWORD) AS LONG
   
    ' Do a check to ensure that this is actually a window handle
    IF IsWindow(hWndControl) THEN 
       
       ' Get the current font
         SendMessage hWndControl, %WM_GETFONT, 0, 0
       
    END IF
       
END FUNCTION   


Should Be...

'------------------------------------------------------------------
FUNCTION FF_Control_GetFont (BYVAL hWndControl AS DWORD) AS LONG
   
    ' Do a check to ensure that this is actually a window handle
    IF IsWindow(hWndControl) THEN 
       
       ' Get the current font
        FUNCTION = SendMessage(hWndControl, %WM_GETFONT, 0, 0)

    END IF
       
END FUNCTION
 
Title: Re: FF_Control_GetFont Problem
Post by: TechSupport on March 15, 2008, 10:31:06 AM
Hi Elias,

Right you are! I can't believe I never noticed that error over the last couple of years. I guess that I don't use the GetFont function. :)