Print Page | Close Window

CXTPPreviewCtrl does not "scroll" to the top

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=24187
Printed Date: 27 April 2024 at 4:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPPreviewCtrl does not "scroll" to the top
Posted By: docontrol
Subject: CXTPPreviewCtrl does not "scroll" to the top
Date Posted: 10 August 2021 at 1:38pm
I have implemented the new CXTPPreviewCtrl control in a project and noticed afterward that previewing Microsoft Word documents (docx) does not always start at the top of the content. The behavior seems quite random, and previewing the same document might sometimes work. The scroll bars, however, indicate that the content location is at the top. Clicking in the preview window triggers a window refresh, after which the content looks okay.

The behavior is the same in the WinExplorer Sample, so you should be able to replicate it.

To be more accurate, I briefly (less than 1 second) see the preview content generate correctly, and then it changes the location in the content a few blocks down. It might simply be a sample code error.

The "real" Windows Explorer preview works fine on the same documents, so it is not a Microsoft issue.

To rule out issues related to Visual Studio, I also downloaded the Live example from codejock.com, which behaves the same way.



Replies:
Posted By: docontrol
Date Posted: 17 August 2021 at 3:26am
It turns out that the "real" Windows Explorer behaves roughly the same. Sometimes document previews load fine, and other times they skip the first paragraph of the document. Clicking on the preview or scrolling causes the preview to refresh and display correctly.

That leads me to another request. Since clicking on the preview seems to resolve the problem, isn't there some way to code a workaround? 

I have successfully used "UINT SendInput(UINT cInputs, LPINPUT pInputs, int cbSize)" to click on the preview, which works quite well. Of course, I would prefer a method that does not move the mouse cursor, but using SendMessage/PostMessage doesn't seem to work for me.

In my case, CXTPPreviewCtrl is placed in a docking pane, and dragging the pane also leads to a refresh of the preview content. I have also tried to do that programmatically, but so far, no success.

Any suggestions?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net