1

I have this XP app (win32 C++) that I am just now testing under Windows7 (vista actually, but it does the same thing in windows 7).

I'm surprised that virtually the only issue I'm encountering is the following:

None of the scroll bars in a complex modelless dialog are functioning correctly. The main problem is the scroll thumb is not responding - just stays locked in position if you try and move it. Have had no issues going all the way back to win98, win2000, and winxp. Only in windows 7/Vista just now

But there is no commonality in the scrollbars in this dialog to explain it: One is in a plain richtext control created through a resource file. Another is in a richtext created through CreateWindow. And yet a third scrollbar is in a custom window class. None of them are working correctly (although you can make them scroll by right clicking and selected "Scroll Here".)

So I'm presuming maybe most encountered this a few years ago when porting to Window7/Vista for the first time, but I'm not finding anything in google now.

Mark
  • 1,214
  • 10
  • 24
  • 1
    No, I've never seen this before. Are you doing any customization to the scrollbars? Can you repro this in a different project? – Cody Gray - on strike Dec 31 '11 at 09:53
  • 1
    Here is someone else who had the same problem, so I'm not the first: http://stackoverflow.com/questions/7171412/windows-7-edit-control-vertical-scroll-does-not-work However the solution provided there to make sure the control has a parent is not the problem with my code, as I am specifiying a parent (in two cases anyway, when using CreateWindow). – Mark Dec 31 '11 at 10:07
  • As far as customizing, I do call ShowScrollBar, EnableScrollBar, and SetScrollInfo subsequent to creation. But as I say, this all works without incident for all previous versions of Windows. Just Vista,Windows 7 its doing strange things. – Mark Dec 31 '11 at 10:12
  • FYI - I tried this on three different machines- two running Vista the other a notebook running Windows 7 - the exact same behavior on all three. – Mark Dec 31 '11 at 10:17
  • You've tried the same application on three different machines; that doesn't tell me very much. The more interesting question is whether you can create a new project that calls the same functions and reproduces the same behavior. If so, please update your question with the code and someone will check it out. – Cody Gray - on strike Jan 01 '12 at 05:45

1 Answers1

1

For modeless dialogs, you have to run IsDialogMessage in the main application GetMessage Loop, so messages for modeless dialogs are not subject to TranslateMessage and DispatchMessage. So I was doing that previously. However, Vista/Win7 doesn't like WM_MOUSEMOVE, and WM_LBUTTONDOWN and WM_LBUTTONUP to be bypassed like that for the dialog (i.e. they need to stay in the main App message loop). At least this was the problem in my case. I check for those message types now in the main message loop and that solved my problem. Can't explain it necessarily. Also couldn't explain why no one's encountered this previously (could be some idiosyncracy of my set up I guess). THanks for those who looked into this.

Mark
  • 1,214
  • 10
  • 24