Announcement

Collapse
No announcement yet.

Respond To Scrollbars...?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Respond To Scrollbars...?

    Hi everybody!
    I've searched about every way I can think of on here for a how-to on responding to the scrollbars on a console. Does anyone have a working example of using SetWinEventHook in a console application? Or, for that matter, another suggestion on how to know if your console has been scrolled short of polling CONSOLE GET VIEW? I've searched the forums and found Windows GUI examples, but no consoles.
    Thanks,
    Y

  • #2
    AFAIK you can draw your screen "oversize" and the scrollbars will "automagically" cause your screen to scroll within the console window bounds; i.e., the most common use for scrollbars is handled for you.

    So I guess the question is, what are you trying to accomplish for which you believe some kind of notification event vis-a-vis scrollbar activities is what you need?

    But looking at the doc for SetWinEventHook with the EVENT_CONSOLE_UPDATE_SCROLL event, it does not look all that daunting to handle. I think the CONSHNDL function will give you the required handle to a window you need.

    Then again, the hook function needs to reside in a DLL, which you can't create with PB/CC, so that's another consideration.
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Hi Michael, and thanks for the reply. I'm trying to make a column that contains names on the left side of the screen scroll over with the console. That way, when you're looking at data on the far right side of the table that you've scrolled over to, you'll still be able to see the name the data you're looking at applies to. Excel will do this and I could do this in a Windows GUI with a grid, but I don't want to have the user install anything. It's a program that's gonna be run off our company LAN. I think this'd be a neat way to accomplish this if anybody's used that function with a console.
      Thanks,
      Y

      Comment


      • #4
        That way, when you're looking at data on the far right side of the table that you've scrolled over to, you'll still be able to see the name the data you're looking at applies to
        With a console program? Woo, that would be pretty cool. Also likely pretty hairy to code.

        Frankly I think I'd "Go GUI" for that. There's no reason you can't code up a window or dialog with PB/CC.

        No, you can't use DDT statements, but SDK is not that hard anyway and besides you can 'approriate' from source code forum, read on...

        Here's a starter for you.... almost what you need.
        Use Listview control as a console. September 13 2003.

        Remove the first column from the listview control, keeping only the text column. Put a list box or another one-column listview just left of the text listview and then you just scroll them in sync. I know there is code here to 'synchronize two listview controls' so I'd probably go with the listview. Besides listbox and listview will probably look different anyway.

        The listview control will give you all the scroll notifications you could possibly want.

        MCM
        Michael Mattias
        Tal Systems Inc. (retired)
        Racine WI USA
        [email protected]
        http://www.talsystems.com

        Comment

        Working...
        X