News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Status Bar of many parts

Started by Roger, November 19, 2008, 12:11:59 AM

Previous topic - Next topic

Roger

Hi All,

I have a status bar with several parts and I can set text in these. I also want to put help messages into one of them using Invoke MenuHelp and I have this working. However MenuHelp seems to assume that I have a simple one part status bar.  Does anyone know how I can tell MenuHelp which part to use.

Regards Roger

donkey

Hi Roger,

There is no way to specify which part you want to use, why would you want to use such a limited helper function anyway ? Even Raymond Chen dislikes the function...

http://blogs.msdn.com/oldnewthing/archive/2006/06/08/622194.aspx

Quote from: The old new thingThe MenuHelp function is one of the more confusing ones in the common controls library. Fortunately, you will almost certainly never had need to use it, and once you learn the history of the MenuHelp function, you won't want to use it anyway.
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Tedd

You don't. The intention is that you set the statusbar into 'simple' mode (with SB_SIMPLE) to display the help strings for the menus, and then deactivate simple mode afterward. It's a separate mode, so you don't lose your multipart settings - when you return to non-simple mode you get back the state you had before entering simple mode.
No snowflake in an avalanche feels responsible.

Roger

Hi All

Quote from: donkey on November 19, 2008, 12:39:50 AM
There is no way to specify which part you want to use,
Rather as I suspected

Quote
why would you want to use such a limited helper function anyway ?
Why Not? To be more precise: What is there that could have told me that I did not want to use it? I got it from the example code I started with (Alive and Kicking ~ W.J. Radburn), it is documented in the SDK and, until now, did what I wanted it to do.

Quote
Even Raymond Chen dislikes the function...

http://blogs.msdn.com/oldnewthing/archive/2006/06/08/622194.aspx

Quote from: The old new thingThe MenuHelp function is one of the more confusing ones in the common controls library. Fortunately, you will almost certainly never had need to use it, and once you learn the history of the MenuHelp function, you won't want to use it anyway.
He is wrong here, learning its history had no effect on my desire to use it on not use it. No more did his function HANDLE_WM_MENUSELECT because I cannot find out anything about it.

Regards Roger

xandaz

   Hi there. I was making a status bar and when i sent SB_SETPARTS things didn't go as i expected. What's the lParam array like? Is it something like:
WidthsArray  dd   200,10,-1 ?
or is RECT like coordinated?
   Thanks guys

Tedd


.data
sb_parts        dd 120,200,-1
SBAR_NUMPARTS equ ($-OFFSET sb_parts)/4


.code
;...in WM_CREATE...
        invoke CreateStatusWindow, WS_VISIBLE or WS_CHILD or SBARS_SIZEGRIP,NULL,hwnd,IDSBAR
        mov hSBar,eax
        invoke SendMessage, hSBar,SB_SETPARTS,SBAR_NUMPARTS,ADDR sb_parts


and remember to pass on WM_SIZE messages:
    invoke SendMessage, hSBar,WM_SIZE,wParam,lParam
No snowflake in an avalanche feels responsible.

xandaz

   What i did was more or less the same except for the wm_size message. I tried it but doesn't work anyway. Damn
   Ty anyway.

xandaz

    Well... problem solved. The thing is that the widths come in client coordinates and i was doing something like Widths dd 32,32,200,-1 where it shopuld be Widths 32,64,264,-1. Anyway, about the WM_SIZE msg. Why do i need it? Does the status bar add to the original size of the window? Please fell free to answer.
   Thanks Tedd.
    Best regards...:)

Tedd

When the size of your window changes, you get a WM_SIZE message. The statusbar fits itself nicely at the bottom of your window - but to do that it needs to know the size of your window. If the size of your window changes, it no longer knows the size of your window.. unless you tell it - which is why you forward the WM_SIZE message; as the parent, you receive the message, and it's up to you to pass it on or resize any of your children.
No snowflake in an avalanche feels responsible.

xandaz

   oks Tedd. I'll keep that in mind. Msny thanks :U