Tech Support > Operating Systems > Windows 95 > General question reguarding Windows programming standard protocols
General question reguarding Windows programming standard protocols
Posted by John L. on October 3rd, 2005


I've written an application which displays a window(created via the
CreateWindow method), which is filled with some text(essentially via the
TextOut method). There is a vertical scroll bar, and data beyond the current
view. I then enter into a message query loop, which successfully responds to
right-clicks by the user in a CALLBACK proc indicated by the WIndows class
created via RegisterClass. Finally, I successfully process a WM_QUIT message
when closing the window.
I am having two problems:
1) When I resize the window, the new canvas is blank, rather than
containing the original data. Does Windows expect my program to regenerate
the display by reissueing the TextOuts in response to the resizing message?
2) In a simular vein, I can not determine what is required of my
program to support scrolling the vertical scroll bar. Interactive attempts to
move it result in the "thumb" returning to the top of the scrolling area, and
no scrolling of the data is performed.
Clearly, my program is capable of capturing the WM_ messages, but the
programatic expectations that Windows places on an application are not
available to me.
Any help with either or both problems would be appreciated.


John L

Posted by Jeff Richards on October 4th, 2005


You don't indicate what message you are using to trigger the TextOut
function. If you use WM_PAINT then the text will be redrawn as required
(which will be for many other event besides resize).

http://msdn.microsoft.com/library/de...n_scroll32.asp
has full details about using a scroll bar to scroll text in a window,
including a 16/32 bit problem which might be related to your handling of the
thumb.
--
Jeff Richards
MS MVP (Windows - Shell/User)
"John L." <JohnL@discussions.microsoft.com> wrote in message
news:599DF45A-45DE-4914-A144-D1C60E115AA8@microsoft.com...


Posted by Tim Slattery on October 4th, 2005


"John L." <JohnL@discussions.microsoft.com> wrote:

Absolutely. You should have a WM_PAINT handler that's called - among
other times - when your app is restored, maximized, or resized in any
way.

A better place for these questions would be the microsoft.public.vc.*
hierarchy (assuming you're using C++, other languages are supported in
other hierarchies). Programming experts hang out there, not here.

--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov


Similar Posts