Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWh_Getmessage hook Pin
percyvimal12-Jan-04 19:26
percyvimal12-Jan-04 19:26 
GeneralFace Facial Detection Pin
Goh Hui Beng12-Jan-04 19:21
Goh Hui Beng12-Jan-04 19:21 
GeneralRe: Face Facial Detection Pin
l a u r e n12-Jan-04 21:19
l a u r e n12-Jan-04 21:19 
GeneralScrollbar problems between 2K and 95/98 Pin
ithacanz12-Jan-04 18:30
ithacanz12-Jan-04 18:30 
GeneralRe: Scrollbar problems between 2K and 95/98 Pin
ohadp12-Jan-04 18:57
ohadp12-Jan-04 18:57 
GeneralRe: Scrollbar problems between 2K and 95/98 Pin
ithacanz14-Jan-04 10:19
ithacanz14-Jan-04 10:19 
GeneralRe: Scrollbar problems between 2K and 95/98 Pin
ohadp14-Jan-04 20:14
ohadp14-Jan-04 20:14 
GeneralRe: Scrollbar problems between 2K and 95/98 Pin
ithacanz15-Jan-04 9:57
ithacanz15-Jan-04 9:57 
Oops, my bad. You are correct; I had it around the wrong way in my message (I knew what I wrote... Smile | :) ). 2K is definitely non-client area, and on further investigation I'm unsure about 95/98. But I have tracked down the problem point - SetScrollInfo() Added a GetScrollInfo() to the end of original code fragment, dumped both out to a file like so:
<br />
SetScrollInfo( SB_VERT, &SI, TRUE ) ;<br />
	<br />
FILE *f;<br />
f = fopen( "scrollinfo.txt", "a" );<br />
fprintf( f, "m_ScrollableArea.Height() :\t%d\n", m_ScrollableArea.Height() );<br />
fprintf( f, "m_ScrollableArea.Width() :\t%d\n", m_ScrollableArea.Width() );<br />
fprintf( f, "SCROLLINFO for SetScrollInfo()\n");<br />
fprintf( f, "nMin:\t\t%d\n", SI.nMin );<br />
fprintf( f, "nMax:\t\t%d\n", SI.nMax );<br />
fprintf( f, "nPage:\t\t%d\n", SI.nPage );<br />
fprintf( f, "nPos:\t\t%d\n", SI.nPos );<br />
fprintf( f, "nTrackPos:\t%d\n", SI.nTrackPos );<br />
<br />
memset( &SI, 0, sizeof( SCROLLINFO ) );<br />
SI.cbSize = sizeof( SCROLLINFO );<br />
SI.fMask = SIF_ALL;<br />
GetScrollInfo( SB_VERT, &SI );<br />
<br />
fprintf( f, "SCROLLINFO for GetScrollInfo()\n");<br />
fprintf( f, "nMin:\t\t%d\n", SI.nMin );<br />
fprintf( f, "nMax:\t\t%d\n", SI.nMax );<br />
fprintf( f, "nPage:\t\t%d\n", SI.nPage );<br />
fprintf( f, "nPos:\t\t%d\n", SI.nPos );<br />
fprintf( f, "nTrackPos:\t%d\n\n\n", SI.nTrackPos );<br />
fclose( f );<br />

...and we run the application, load one file then load it a second time, and we get this:

m_ScrollableArea.Height() : 944
m_ScrollableArea.Width() : 560
SCROLLINFO for SetScrollInfo() Data for the call into the API
nMin: 0
nMax: 952
nPage: 0
nPos: 0
nTrackPos: 0
SCROLLINFO for GetScrollInfo() Returned SCROLLINFO struct - 0??!
nMin: 0
nMax: 0
nPage: 0
nPos: 0
nTrackPos: 0

m_ScrollableArea.Height() : 944 Open the file a second time
m_ScrollableArea.Width() : 560
SCROLLINFO for SetScrollInfo() Calc the same SCROLLINFO struct...
nMin: 0
nMax: 952
nPage: 0
nPos: 0
nTrackPos: 0
SCROLLINFO for GetScrollInfo() ... but this time it "takes"
nMin: 0
nMax: 952
nPage: 537
nPos: 0
nTrackPos: 0

Basically, when the struct "takes" it works perfectly; when it doesn't, you get no scrollbars. But experimenting, I can't find what makes it work and what doesn't... I've traced the creation/destruction for the window and all it's children and everything is destroyed on close of the first and recreated on opening the second, contents of the SCROLLINFO is the same each time, but sometimes it works and sometimes it doesn't Confused | :confused:

Sorry for the length of this post, but I wanted to give you all that I know. To be honest, right now I'm completely lost, stumbling around in the dark with my hands in front of me, hoping to blunder into the solution Smile | :) If you have any further suggestions, they're more than welcome.


--Shane
You can sometimes count every orange on a tree, but never all the treees in a single orange.

GeneralTextControl as in MSPaint Pin
swarnamanoo12-Jan-04 18:19
swarnamanoo12-Jan-04 18:19 
General(psapi.h) RemoteAdmin sample Code Pin
~Pete12-Jan-04 16:45
~Pete12-Jan-04 16:45 
GeneralRe: (psapi.h) RemoteAdmin sample Code Pin
Selvam R12-Jan-04 18:35
professionalSelvam R12-Jan-04 18:35 
GeneralRe: (psapi.h) RemoteAdmin sample Code Pin
Anonymous13-Jan-04 14:23
Anonymous13-Jan-04 14:23 
Generalstring var help Pin
trask89912-Jan-04 16:01
trask89912-Jan-04 16:01 
GeneralRe: string var help Pin
trask89912-Jan-04 16:04
trask89912-Jan-04 16:04 
GeneralRe: string var help Pin
bryce12-Jan-04 16:24
bryce12-Jan-04 16:24 
GeneralRe: string var help Pin
Jijo.Raj12-Jan-04 17:53
Jijo.Raj12-Jan-04 17:53 
GeneralRe: string var help Pin
ZoogieZork12-Jan-04 17:31
ZoogieZork12-Jan-04 17:31 
GeneralRe: string var help Pin
trask89913-Jan-04 9:14
trask89913-Jan-04 9:14 
GeneralCDWordArray and sort Pin
pranavamhari12-Jan-04 16:00
pranavamhari12-Jan-04 16:00 
GeneralRe: CDWordArray and sort Pin
bryce12-Jan-04 17:52
bryce12-Jan-04 17:52 
GeneralRe: CDWordArray and sort Pin
pranavamhari12-Jan-04 20:20
pranavamhari12-Jan-04 20:20 
GeneralRe: CDWordArray and sort Pin
l a u r e n12-Jan-04 21:23
l a u r e n12-Jan-04 21:23 
GeneralRe: CDWordArray and sort Pin
jhwurmbach12-Jan-04 22:19
jhwurmbach12-Jan-04 22:19 
GeneralRe: CDWordArray and sort Pin
bryce13-Jan-04 0:31
bryce13-Jan-04 0:31 
QuestionPostThreadMessage(...)??? Pin
zhaopzhi12-Jan-04 15:48
zhaopzhi12-Jan-04 15:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.