PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Jean-pierre Leroy on April 22, 2010, 12:45:29 PM

Title: FF_StatusBar_SetText() function with a simple StatusBar having only one part
Post by: Jean-pierre Leroy on April 22, 2010, 12:45:29 PM
Hi,

I tried for to use the FF_StatusBar_SetText() function with a simple StatusBar having only one part i.ie. no panel is defined defined in the Statusbar Editor.

For this case, as mentioned in the description of the function, I use the value 255 for the parameter iPart, but the text is not displayed.

Quote
Sets the text in the specified part of a status window.

Parameters:
   hStatus   - The handle of the Status Bar control.
   iPart       - Zero-based index of the part to set. If this value is 255,
                   the status window is assumed to be a simple window having
                   only one part.
   sText      - String that specifies the text to set.
   uType     - Type of drawing operation. This parameter can be one of the
               following:

I don't know what's wrong ?
Here is the code I use to update the Status Bar:


Function FORM1_WM_CREATE ( _
                         hWndForm As Dword, _      ' handle of Form
                         ByVal UserData As Long _  ' optional user defined Long value
                         ) As Long                       
    FF_StatusBar_SetText(HWND_FORM1_STATUSBAR, 255, "Status Bar Sample Text")                               
End Function


Thanks for your help,
Jean-Pierre



Title: Re: FF_StatusBar_SetText() function with a simple StatusBar having only one part
Post by: Rolf Brandt on April 22, 2010, 02:59:55 PM
Hello Jean-Pierre,

instead of 255 use 0. That works.
Title: Re: FF_StatusBar_SetText() function with a simple StatusBar having only one part
Post by: Jean-pierre Leroy on April 23, 2010, 08:10:03 AM
Hi Rolf,

Thank you for your help; yes it works perfectly with 0 instead of 255.

I'm nevertheless still curious to know why this value of 255 was mentioned in the description? in which cases do we have to use this value?

Thanks,
Jean-Pierre
Title: Re: FF_StatusBar_SetText() function with a simple StatusBar having only one part
Post by: Rolf Brandt on April 23, 2010, 08:59:47 AM
I was wondering too, but that is exactly what the Win32 API help says too.
Title: Re: FF_StatusBar_SetText() function with a simple StatusBar having only one part
Post by: Roger Garstang on April 23, 2010, 01:17:49 PM
Hmm, yes the Win32 documentation is confusing. SB_SIMPLEID=255 which looks like it should mean simple with only one panel, but being zero based you can't specify FF and 00 for the low word. Maybe M$ realized that and SB_SIMPLEID is just wasting space now and never removed.  Paul's FF Function code does just perform an OR though where a Hi/Lo Word would have been ideal (Although with all the types they are greater than 00FF so should work), maybe 255 is causing some type of overflow with PB thinking it is working with a long instead of dword when passed in?

Similary issue:
http://www.powerbasic.com/support/pbforums/showthread.php?t=22348