|
I have this app that opens a bitmap image and displays it in the dialog. However, when I move it off screen then back on, the portion that was offscreen but is now on screen is not refreshed. I think I have to handle some kind of message like WM_PAINT somewhere but I don't know quite where to do this exactly. I'm thinking of overriding CCmdTarget::OnCmdMsg and doing it in there somehow. Rather than making an uninformed guess at the best way at doing this and wasting time writing code I don't need, I'd like to ask up front as to what's the best way to do this. I'd like to redraw when the window is placed in it's final location (after left mouse button is released) but I would like to redraw it more intelligently after I get this part figured out. Any help would be greatly appreciated and thanks to all the people that have helped me in the past with this app.
|
|
|
|
|
You should do all your drawing in your WM_PAINT handler. Your window will recieve WM_PAINT messages from the system whenever it needs redrawing, for whatever reason.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
|
hey use the WM_PAINT directly!!!!!.....dont waste ur time writing a fuction such as OnPaint() by urself when there is an already well handled one.....it will do all the repaintz that are required automatically!!!!!
hope thiz helpz.....
just select ur class wizard and set the class name as the class name of the dialog,then in the messages box,look for WM_PAINT,double click it and it adds to the member function box as "OnPaint()".....click on the OK button.....
then in ur dialog cpp go to the added function(OnPaint()).....
then write the code that is needed to diplay the bitmap on the screen using BitBlt().....
if u have to load an image in to ur screen u must be using the dc memory.....
herez a n example code.....
void CXYZDlg::OnPaint()
{
dc.BitBlt(offsetx,offsety,m_size.cx,m_size.cy,m_dcMem, 2, 0,SRCCOPY);
}
look into BitBlt for more info.....
maybe thiz article could aso help u out!!!!!......
http://www.codeproject.com/bitmap/bmpscroll.asp[^]
the time taken to writing ur own paint finction is a waste of time and unnessar effort when the OnPaint() od the MFC handles thiz cery neatly!!!!!
:-Dcheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
You no need to handle any other messages for this. Just write your code that displays the image inside the OnPaint or WM_PAINT.
|
|
|
|
|
Is there anyone who knows Trojans???please help me and give me some knowledge abort Trojans~~thank u~~
Jack
|
|
|
|
|
Personally I think they are like having a shower in a raincoat.
Or do you mean you want to know how to write destructive software ? In that case, grow up and go home.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Trojans:
1) Universify of Southern California (USC) students (or at least the school mascot)
2) The people of Troy that were tricked into dragging in that very big wooden horse into their walled city.
Steve
|
|
|
|
|
Oh, I thought they were condoms.... *grin*
He's written to tell me that he wants to capture the screen, including the contents of video files that are playing. Still trying to work out what that has to do with trojans.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
|
Jack.Fu wrote:
Is there anyone who knows Trojans???
Yes, Google[^] does.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I've been using VS6 with the MSDN installed for some time and until recently hadn't used the FAVORITES tab in the MSDN help. What I began to notice was that the FAVORITES list entries keep disappearing. Once I had gotten into it I had quite a few entries and after several days I closed VS (which closed the help of course). Next day, poof!
Is there a way to get the MSDN library help to retain it's favorites entries?
thanks gang
Glenn
Unix Systems Programmer
|
|
|
|
|
quantum69 wrote:
Is there a way to get the MSDN library help to retain it's favorites entries?
Normally it does keep them. I've had them disappear a time or two over the years but simply wrote it off as the moon being out of phase. It may be overkill but after adding one, exit MSDN right away.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
thanks, I'll give that a try
Glenn
Unix Systems Programmer
|
|
|
|
|
Hi all
I have searched for a way to read a specified sector from a drive
and found nothing can someone know how can I read a sector
or know about a mosule I can use.
Tanks
Regards
Y.R.
|
|
|
|
|
|
Thank you for your replay but I have seen this previously
and I want somthing for general (for hard drives too).
Sincerely yours
Y.R.
|
|
|
|
|
Please help me with this. I am using VirtualQueryEx() function to get information about regions of pages committed and save this information in a file. Here is part of my code
<br />
PROCESS_INFORMATION pi; <br />
STARTUPINFO si; <br />
HANDLE hProcess; <br />
BYTE buf[20000];<br />
DWORD NumberOfBytesRead = 0;<br />
DWORD bufsize = sizeof buf;<br />
DWORD baseaddr = 0;<br />
DWORD lpAddr = 0;<br />
PMEMORY_BASIC_INFORMATION lpBuffer = 0;<br />
DWORD dwLength = 200000;<br />
DWORD flNewProtect =0;<br />
PDWORD lpflOldProtect = 0;<br />
DWORD dwSize =0;<br />
LPCVOID lpBaseAddress = 0;<br />
DWORD nSize = 0;<br />
<br />
VirtualQueryEx(<br />
hProcess,
&lpAddr,
buf,
sizeof (MEMORY_BASIC_INFORMATION));
<br />
VirtualProtectEx(<br />
hProcess,
lpAddr,
dwSize,
flNewProtect,
lpflOldProtect );
<br />
ZeroMemory(buf, sizeof(buf));<br />
if( ReadProcessMemory( hProcess, lpBaseAddress, buf, bufsize, &NumberOfBytesRead ) == FALSE )<br />
{<br />
printf("\nProcess ID %d ",pi.dwProcessId);<br />
printf (" memory read failed (errcode: %d)", GetLastError());<br />
}<br />
else<br />
{<br />
printf("\nProcess ID %d ",pi.dwProcessId);<br />
printf("memory read: \n",buf);<br />
GetLastError());<br />
}<br />
How do i return this function call, i.e. to return information about pages commited and occupied pages
oam
|
|
|
|
|
Hello, everybody.
I'm a game developer working on a very limited budget. I'm very interested in making some editing tools for myself and others. But before I go and spend a lot of time trying to reinvent the wheel I thought I'd ask here and see if anyone has what I want already and is willing to share it with me.
I'm looking for a 3dsmax style SDI application in MFC. The left pane should show an OpenGL view and the right pane should have tabs at the top and dialog boxes beneath the tabs. the dialog box displayed should change when the tab selection changes.
I know how to do almost all of these things but I don't know how to do the part with the tabs/dialog boxes. If you know where I can find source code that does most (or all) of what I want OR you feel you can explain it to me I would be very thankful.
PS, I'm currently working with MSVC 6
Dan "Aggrav8d" Royer
Lead Programmer, Marginally Clever Games
http://www.marginallyclever.com/
|
|
|
|
|
hello:
I am very interested in your project.I have use MSVC 6 for five years, and develope many product with it. one of these products is a Integrate Development Enviroment for a software platform. so I want to cooperate with you. OK?
your friend:bobi
|
|
|
|
|
Hello all,
I am having a massive brain fart today.. What I thought would be simple is turning out to be a huge head-ache..
I have a CPropertySheet in wizard mode with 3 simple pages.. Depending on what option is selected on page one, I want to either show page 2 of the wizard or skip it and go to page 3... How can this be done?
Thanks,
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi!
Sure it is !
The place where to look at is the documentation of "OnWizardNext":
This member function is called by the framework when the user clicks on the Next button in a wizard.
virtual LRESULT OnWizardNext();
Return Value
0 to automatically advance to the next page; –1 to prevent the page from changing. To jump to a page other than the next one, return the identifier of the dialog to be displayed.
Hope this helps...
Greetings, Ralph
|
|
|
|
|
Perfect!!
Thank you, I knew it couldn't be that hard
Thanks again!
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
In VC6, you could change the text and background color of the Output window. In VS2003 (Tools | Options | Environment | Fonts & Colors | Show settings for Text Output Tool Windows), the item foreground and background color comboboxes are disabled and set to "Automatic".
Any way the colors can be changed?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I already ask about how to use colors to change the text of the console application. But I can't use it with C/C++ console application. The answer that you gave me is for the console application(.net). How can I change text colors in the other console application?
|
|
|
|