• Welcome to Jose's Read Only Forum 2023.
 

Increase header height

Started by James C. Fuller, April 21, 2013, 09:52:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

James C. Fuller

José,
  How do you increase the header height in this example.
http://www.jose.it-berater.org/smfforum/index.php?topic=4365.msg15152#msg15152
I tried changing the -> change me lines but the header background and size appears to be the same??

James


José Roca

When processing the WM_SIZE message...

MoveWindow ListView_GetHeader(hListView), 0, 0, LO(WORD, lParam), <wanted height>, %TRUE

James C. Fuller

Thank you sir.
Might I ask where you got your information?
I did a bit of searching for a c/c++ example awhile back and came up empty.

James

José Roca


John Spikowski

QuoteFrom nowhere. Just trying.

What sets you apart from the rest of the crowd.

Theo Gottwald

#5
Kekule found the Benzol-Ring formula.
John.

WHY KEKULE?

I can tell you.

Kekule had a dream. And in that dream he got in contact with higher consciouness.
In that dream he saw the Benzol-Ring.

Now - what would have happened IF YOU had that same dream?

NOTHING. Because you know nothing about Chemistry and all that stuff.
Or if Kekule would had dreamed about a new motor technology?
NOTHING because he just would not had recognized it.

The same applies to Jose.
He knows that stuff and therefore he gets additional knowledge "from heaven".

This is how it works. It works for me, too.
Just not in Programming but in other fields where i am ahead of mainstream.

You need to work hard, get the Knowledge, and relax.
The rest comes from itself.

You don't know where dreams come from.
Possibly the "Tree of wisdom" as it was shown in the film "AVATAR" has some REAL Pedant in this world.
And we will recognize and connect to it one day.

PS: Lastly i got the knowledge on how to remove all sorts of rheumatic deseases. If you have that problem you may ask me.

José Roca

#6
I have not that kind of dreams. It's just a matter of logic. If MoveWindow is routinely used to change the size and/or position of windows and controls, why not to change the size of the listview header, that is nothing but a control?

James C. Fuller

José,
  There is something amiss with the original code.
Make the window smaller so you have just the first two columns showing.
Use the listview horz scrollbar to scroll to the last column.
Now make the window bigger. the header does not size correctly

James

José Roca

#8
That is because the left position of the listview becomes negative. Calculate the displacement and adjust the parameters for MoveWIndow accordingly...

LOCAL pt AS POINT
ListView_GetItemPosition(hListView, 0, pt)
MoveWindow ListView_GetHeader(hListView), pt.x, 0, LO(WORD, lParam) + ABS(pt.x), <wanted height>, %TRUE

James C. Fuller

Thank you kind sir. Works fine now.

James


Paul Yuen

Hi Jose

How do you load an icon into CreateWindow() ?

I tried adding the following statements into your code but to no avail with error messages as
hwnd = pWindow.CreateWindow(%NULL, "Multiline Header ListView", %SS_ICON, 0, 0, 0, 0, -1, -1, CODEPTR(WindowProc))

pWindow.hIcon   = LoadIcon (%NULL, "Logo")



Error 598 in C:\PB CWindows\Multi Header line ListView\CW_LV_MultilineHeader.bas(71:023):  METHOD or PROPERTY name expected
  Line 71:       pWindow.hIcon   = LoadIcon (%NULL, "Logo") ;



José Roca

1) Do not use the %SS_ICON style. That style belongs to satic controls, not main windows.

2) You need to add a resource file to your application that contains the icon.

3) hIcon is not a method of the CWindow class

To load the icon from the embedded resource file, use:

pWindow.BigIcon = LoadIcon(pWindow.hInstance, "Logo")
pWindow.SmallIcon = LoadIcon(pWindow.hInstance, "Logo")

Paul Yuen

Many Thanks  Jose

it works .

Paul Yuen

Hi Jose

Sorry to bother you again
In Dialogs,  we can remove the minimize and maximize buttons as well as fixing the frame of the
dialog (so that users cannot resize the dialog).   How do we manipulate these styles with CreateWindow() ?

Thank you in advance.

Paul Yuen


This has been resolved by having set the styles

   hwnd = pWindow.CreateWindow(%NULL, "Multiline Header ListView", 0, 0, 0, 0,_
    %WS_VISIBLE OR %WS_CAPTION OR %WS_SYSMENU, %WS_EX_WINDOWEDGE, CODEPTR(WindowProc))