|
Are you sure about this ?
I'm pretty sure that at-least from Windows-2000 and up, Scroll-Bars are in the Non-Client-Area, as in they are returned by GetWindowRect but not by GetClientRect.
If you want to disable Scroll-Bars, there are many ways that range from Handling OnNcCalcSize and not allowing windows to make space for it's scroll-bar, and up to using the Flat-Scroll Bar API FS_EnableScroll I believe dose the work...
|
|
|
|
|
Oops, my bad. You are correct; I had it around the wrong way in my message (I knew what I wrote... ). 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
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 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.
|
|
|
|
|
I want to make a textcontrol object as in MSPaint..It should act as an object and must be movable and resizable...Please help me out..
|
|
|
|
|
I am trying to compile the RemoteAdmin Example Code. I am getting an error that the file "psapi.h" can't be found.
I am using MSVC6.0 on XP.
Where do you find this file??
|
|
|
|
|
Hello,
http://www.codeguru.com/mfc/comments/50362.shtml
With Regards,
R.Selvam
|
|
|
|
|
<psapi.h> is a header file for the process status API (PSAPI) and is part of the Platform SDK which can be downloaded from Microsoft
Regards,
|
|
|
|
|
Hello, I am just using Visual c++ 6.0 for the first time. I am trying to use a string variable, I set up #include<string.h> and my variable is
string player1;
I am getting 3 errors, all of which around this error, 'string' : undeclared identifier. I have been searching microsoft.com, I can't find a solution, I hope someone will help me. Thank you.
|
|
|
|
|
PS I meant to put #include<string.h>
|
|
|
|
|
|
take care this point, while including the header for string class, use
#include <string>
don't use,
#include "string.h"
it wont work.
Regards,
Jijo.
________________________________
Yesterday is history,
Tomorrow is a mystery,
But today is a present.
|
|
|
|
|
string is in the std namespace, so you either need to qualify it as std::string or add using std::string; before you first use it. using namespace std; will import the entire std namespace.
- Mike
|
|
|
|
|
Thanks a lot, I was able to get it up and running.
|
|
|
|
|
hi,
I have a CDWordArray with many items. I need to sort it, in the quickest possible way.
Please tell me how to do it.
the code I use now is,
void CSortableDWordArray::Sort(DWORDCOMPAREFN pfnCompare)
{
DWORD * prgdw = GetData();
qsort(prgdw,GetSize(),sizeof(DWORD),(GENERICCOMPAREFN)pfnCompare);
}
It does not seem to be very fast.
regards
hari
Hari Krishnan
|
|
|
|
|
|
thanks,
About 10,000 to 20,000.
Another question, how about adding the items sorted while it is being added ? Which is faster.
Also, how can i use heapsort ?
regards
hari
Hari Krishnan
|
|
|
|
|
|
std::set from the STL does exactly this: hold a sorted collection of objects.
Depending on the access pattern you use with your collection, it may or may not be what you want.
Who is 'General Failure'? And why is he reading my harddisk?!?
|
|
|
|
|
|
sequence 1:
MessageBox(NULL,"a test","a test",MB_OK);
BOOL b = PostThreadMessage(threadID,WM_TEST,0,0);
sequence 2:
BOOL b = PostThreadMessage(threadID,WM_TEST,0,0);
MessageBox(NULL,"a test","a test",MB_OK);
----------
The "sequence 1" and the "sequence 2" are identical except for sequence.The return value "b" proved that they sent the message "WM_TEST" successfully.But "sequence 2" didn't made the thread identified by "threadID" receiving the message.
Why???
For this, I should how to do???
Thank you in advance!
Rap off for you,for me,for our human.
|
|
|
|
|
Where is the WM_TEST message supposed to go ? Which thread does threadID designate ? Are you certain that this ID is correct ?
The message boxes are, by default, application modal. This means that the message pump handling of the application will pause for during the showing of the message box. In sequence 1, the results of posting the message WM_TEXT are visible only after you close the message box. In sequence 2, they MIGHT BE visible already during the showing of the box.
I say, might be, as PostThreadMessage returns before the message itself is handled. In sequence 2, the message is posted to the thread's queue, but if this thread is the same as which is to show the message box, then it might be that the message will not be handled before the message box is closed.
So, if threadID points to the same thread as which is to pop up the message box, then the thread's queue will be suspended until the closing of the box. You should never pop up modal message boxed in these type of situations. Use SendMessage to post a message to the thread's main window and wait for the window procedure to handle it. In this case, the application would either first show the message box, then handle the message, or vice versa.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi all,
Can anybody give me an example of Unicode programing. So I can change from current language to another (ex: Japanese to English) immediately.
Thanks all,
|
|
|
|
|
How can you send an email to like a hotmail account like someone@hotmail.com or any other web email???
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
|
I would like to send the email from my program.
Actual Linux Penguins were harmed in the creation of this message.
|
|
|
|
|
ahh
well you might want to try some of the SMTP classes found here on codeproject
or investigate MAPI
unless of course you want to connect your program directly to Hotmail
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|