News:

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

setscrollinfo/scrollinfo/getscrollinfo

Started by shankle, February 25, 2005, 02:17:06 PM

Previous topic - Next topic

shankle

In WM_Size I set the parms for scrollinfo. Then use setscrollinfo.

When I get to WM_Paint and use getscrollinfo, the location of the scrollinfo has been moved
and garbage is in it.
I set cbsize and fmask before each one.

Went up on Microsoft and am using the same procedure that they have for scroll bar text.

IT'S GOT TO BE STUPID!!!!
Any suggestions would be appreciated.
JPS

The greatest crime in my country is our Congress

P1

Post your code for review, or at least a sample made from your code for analyzes.

Regards,  P1  :8)

P1

The example has two EndWhile labels.  Fix this and we will move on.

Regards,  P1  :8)

shankle

Here is the revised jpsscr.zip. Sorry about the extra EndWhile.

Regards,
JPS

[attachment deleted by admin]
The greatest crime in my country is our Congress

shankle

Thanks to those who helped.
DON'T spend any more time on this.

The program  involves two windows.
1st window - consists only of headings at the top of the screen.
2nd window- consists of data that can be scrolled that fills the screen below the headings.

The problem seemes to be in the way I defined the CREATEWINDOWEX api.

1st window - has to have NULL and WS_OVERLAPPEDWINDOW
2nd window - has to have WS_TOP_MOST and WS_EX_MDICHILD or WS_VSCROLL

There are other problems but they are just a matter of Assembler logic.

Windows will be the death of me.....
Thanks again,
JPS
The greatest crime in my country is our Congress

petezl

JPS,  Are you saying that the altered window styles cured your problem with the ScrollInfo structure?

Only, I recently started with a clean sheet of paper to explore (understand) the in's and out's of ScrollInfo and the associated messages.
I found that with XP I couldn't read or write to members of the structure directly. In the end I used temp variables like tempnPos, tempnPage etc for on the fly use and updated (syncronised) the ScrollInfo struct at the critical times.
So what I observed is that the only way to modify stuct members was to use the full SetScrollInfo command.
Peter.
Cats and women do as they please
Dogs and men should realise it.

six_L

for P1,
i'v seen your five star, I think you are a professional coder. but your answer can't figure out his problem.
mov   hOvlay,eax
;here, crash be happened
invoke ShowWindow, hOvlay, SW_SHOW
invoke UpdateWindow, hOvlay

I Think you should have a little earnest.

regards.
regards

shankle

Sorry for the delay in answering you Petezl. Was in hospital.
I think the way I had the CreateWindowEx defined confused the scrolling commands.
I was immediately able to go to the end of the file where before I could scroll only a
few pages.
Do to my limited knowledge of windows I am probably not handling the 2 windows properly.

Still working on the program but I think I am over the major hurdle.
Love the cat...
Regards,
JPS
The greatest crime in my country is our Congress

tenkey

You are using the same WndProc for both windows, but you are always using hOvlay in some of your WndProc code.

WM_PAINT is being sent to both windows, but you always update the Ovlay scroll bars, and you are incorrectly always updating hOvlay (BeginPaint-EndPaint). BeginPaint and EndPaint should always use the window receiving the message, the hWnd argument of WndProc.

WM_SIZE is also sent to both windows, so you should only be updating the information for the receiving window, again it is hWnd.

If you want two windows with different behaviors, you should create two window procs, and set the lpfnWindowProc field appropriately. Then, within the WndProc, use only the hWnd argument, not the global variables you have stored.

WM_SIZE is also sent when a window is being created, before hOvlay receives a value from CreateWindowEx. Another reason for using the hWnd argument and not the global hOvlay.
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

shankle

Thank you TENKEY.
Had no idea I was doing that much incorrectly. Will try your suggestions.
Don't see how I got anything to work being that wrong....
Thanks,
JPS
The greatest crime in my country is our Congress

petezl

JPS,
Sorry for the delay in getting back to you too.
I did compile and run your rogram but there were problems with the paint proc which has already been pointed out. I did a scroll skeleton and tried changing just about everything but still couldn't write or read directly from the ScollInfo struct without using the ful Get/SetScrollInfo api.

Peter.
Cats and women do as they please
Dogs and men should realise it.

shankle

Petzel,

I've made the changes that Tenkey suggested. Added another wndproc, got rid of hOvlay and
made it hWnd. That took care of the multiple windows problem.
Now I'm in the process of trying to covert Petzold's C code into Assembler, that processes
scrolling. Not being a C programmer I'm having a few difficulties. As a guide I am studying
Petzold's Sysmets3 scrolling program. My program will still not scroll correctly.

JPS     
The greatest crime in my country is our Congress

petezl

If you send me your email addr via PM I will send you what I have done (file size is too large to post in the forum)  The scroll stuff is entirely my version written from scratch so is not intended as a demonstration piece but is well commented. Might at least point you in the right direction...

Peter.
Cats and women do as they please
Dogs and men should realise it.