Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Hiding child window scroll bar

oscarh81
Beginner
631 Views
How can one hide the scroll bars of a child window created using QuickWin?
0 Kudos
3 Replies
Jugoslav_Dujic
Valued Contributor II
631 Views
Try (no guarantees, it was long time ago since I was working with it):
iStyle = GetWindowLong(GetHwndQQ(0), GWL_STYLE)
iStyle = iand(iStyle, not(WS_HSCROLL + WS_VSCROLL)
i = SetWindowLong(GetHwndQQ(0), GWL_STYLE, iStyle)
Jugoslav
0 Kudos
Intel_C_Intel
Employee
631 Views

Jugoslav,

I have a QuickWin application that opens several windows in which it displays bitmaps. I am trying to eliminate the scrollbarsinthese child window, since the bitmaps are known size and fully visible, and am having a tough time using the code sample you supplied.

Depending on where I insert this "style change" into the sequence of initialize, resize, paint, etc., I get unpredictable results. Sometimes the vertical scrollbar is hidden, sometimes it is there but disappears when the window is first given focus, sometimes it is always there. No matter what I do, I can't seem to rid myself of the horizontal scrollbar.

This may be a total red herring, but just in case it has some relevance... Having use statements for the DFLib and User32 modules in the same subroutine seems to gives an error concerning LoadImage, complaining that "There is no matching specific function for this generic function...". I haven't seen this before.

The environment is CVF 6.6C on Win2K SP2.

Any insight or suggestions?

Thanks, Cliff

0 Kudos
Jugoslav_Dujic
Valued Contributor II
631 Views
Just performed a quick test... removal of these styles is indeed of temporary effect, as any subsequent QuickWin's attempt to set scrollbar sizes nullifies it (i.e. routine like SetScrollInfo used internally by QuickWin restores these styles back).
This is a tricky area, and you can probably solve it only by subclassing & catching WM_SIZE... here's what happens: when you size the window by dragging its borders, Windows sends a WM_SIZE message to the child window. QuickWin receives that information and adjusts scrollbars according to actual window size and canvas size (set by SETWINDOWCONFIG). Thus, you want to a) call SetScrollInfo yourself with e.g. min=0, max=1, page=2 (page>range, which hides the scrollbar) and b) prevent WM_SIZE from reaching QuickWin (subclass & just return 0 on WM_SIZE).
[blatant ad]
Attached is a hybrid of QuickWin and XFT Full application where XFT completely overrides QuickWin's drawing/sizing mechanism. It achieves the same effect as subclassing, but then, it adds more power. You can compile it, however, only if you download& install XFT from my home page.
[/blatant ad]
Re your other problem: there are two versions of LoadImage (with totally different semantics) -- one in DFLIB and the other in USER32. Since you probably need the former, you have to "rename" the latter, either using
USE USER32, ONLY: (symbols you need)
or
USE USER32, IDontNeed => LoadImage
Jugoslav
0 Kudos
Reply