Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ScrollWindowEx

Posted on 1997-07-24
6
Medium Priority
?
1,183 Views
Last Modified: 2010-07-27
Whats the EXACT syntax for using this win api call?
0
Comment
Question by:sz3905
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:erajoj
ID: 1339736
The EXACT syntax is this:

  function ScrollWindowEx(
    hWnd      : HWND;    // handle of window to scroll
    dx,                  // amount of horizontal scrolling
    dy        : Integer; // amount of vertical scrolling
    prcScroll,           // address of scroll rectangle
    prcClip   : PRect;   // address of clip rectangle
    hrgnUpdate: HRGN;    // handle of update region
    prcUpdate : PRect;   // address of update rectangle
    flags     : UINT     // scrolling flags
  ): BOOL; stdcall;

Read the help for further info on the parameters.

And this is an example of how simple it is to use it:

  ScrollWindowEx(
    Handle,      // Handle of window to scroll
    10,              // Amount of horizontal scrolling
    10,              // Amount of vertical scrolling
    nil,      // Scroll whole window
    nil,        // No clipping necessary
    0,              // Don't need it
    nil,        // Don't need it
    SW_ERASE    // Erase background to clBtnFace in this case
   );

Hope this is what you asked for.

/// John

0
 

Author Comment

by:sz3905
ID: 1339737
John I'm sorry, I was looking for an exact useable syntax. More like a simple working example of a scrolling rectangle, but with the complete prect structure vars and declarations. The sample you gave is like the books(which never have a working sample).    thx for a reply/steve
0
 
LVL 4

Expert Comment

by:erajoj
ID: 1339738
Have you tried it?
My example works fine.
I never send examples unless I have tested them.
What didn't work or what do you miss?

/// John

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sz3905
ID: 1339739
I'm sure your sample works, your suggestion "Read the help for further info on the parameters" is where I'm having the problem.
The help doesn't give a working "procedure" sample that addresses the exact syntax for coding "prcScroll, prcClip, prcUpdate, hrgnUpdate" and I dont want to use "nil". If this is still unclear please state whats not clear.
John, thanks for being so quick in you response./steve

0
 
LVL 4

Accepted Solution

by:
erajoj earned 480 total points
ID: 1339740
This will probably look crappy since Experts-Exchange uses
proportional fonts :-( but I think you'll get the idea:

procedure TfrmMain.Button4Click(Sender: TObject);
var
  ScrollRect, ClipRect, UpdateRect: TRect;
  RGN: HRGN;
begin
  ScrollRect := Rect(50, 50, 150, 150);
  ClipRect   := Rect(50, 50, 150, 150);

   //  __________
   // |          |
   // |          |
   // |          |
   // |          |
   // |          |
   // |          |
   // |__________|
   // ^
   // ClipRect & ScrollRect

  ScrollWindowEx(
    Handle,                // Handle of window to scroll
    10,                    // Amount of horizontal scrolling
    10,                    // Amount of vertical scrolling
    @ScrollRect,          // Scroll whole window
    @ClipRect,        // No clipping necessary
    RGN,                  // Region returned
    @UpdateRect,      // Region boundaries
    SW_SCROLLCHILDREN      // This will move the children affected!
   );

   //  __________
   // |##########|
   // |## _______|
   // |##|       |  ## = RGN;
   // |##|       |
   // |##|       |
   // |##|       |
   // |__|_______|
   // ^  ^
   // |  ScrollRect
   // ClipRect & UpdateRect (in this case)


  ScrollRect := Rect(50, 50, 150, 150);
  ClipRect   := Rect(50, 50, 150, 150);

   //  __________
   // |          |
   // |          |
   // |          |
   // |          |
   // |          |
   // |          |
   // |__________|
   // ^
   // ClipRect & ScrollRect

  ScrollWindowEx(
    Handle,                // Handle of window to scroll
    10,                    // Amount of horizontal scrolling
    0,                    // Amount of vertical scrolling
    @ScrollRect,          // Scroll whole window
    @ClipRect,        // No clipping necessary
    RGN,                  // Region returned
    @UpdateRect,      // Region boundaries
    SW_SCROLLCHILDREN      // This will move the children affected!
   );

   //  __________
   // |##|       |
   // |##|       |
   // |##|       |  ## = UpdateRect + RGN;
   // |##|       |
   // |##|       |
   // |##|       |
   // |__|_______|
   // ^  ^
   // |  ScrollRect
   // ClipRect

end;

Now then, or am I a really stupid person, not understanding
what you need to know?

/// John

0
 

Author Comment

by:sz3905
ID: 1339741
you said "Now then, or am I a really stupid person, not understanding what you need to know? "
---------------------------------
No John, you answered perfectly!
thx/steve
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question