CXTPPreviewCtrl does not "scroll" to the top |
Post Reply |
Author | |
docontrol
Groupie Joined: 07 December 2009 Location: Denmark Status: Offline Points: 35 |
Post Options
Thanks(0)
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.
|
|
docontrol
Groupie Joined: 07 December 2009 Location: Denmark Status: Offline Points: 35 |
Post Options
Thanks(0)
|
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?
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |