|
You have tried using the CWnd::OnEraseBkgnd(...) function to paint the background yourself? Doing it in the CWnd::OnPaint(...) function may not be the best place because I think that it will only update any region that is marked as invalidated, so parts of the dialog may not get painted correctly.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
I have tried "CWnd::OnEraseBkgnd(...)". And only paint the area that I need to redraw. Now it shows well, do not have any glimmer.
I am very thankful for your kindness.
|
|
|
|
|
I want to use capDlgVideoSource function to adjust the video picture.
First,I use capCreateCaptureWindow to create a HWND to assosited with the capture,and trans the right HWND to capCreateCaptureWindow.If capturing is not active,it works well(show the adjust dialog and return TRUE),but if is active,it would fail(could not show the adjust dialog and return FALSE).
Why?
And how should I using the function to adjust the video?
GOOD LUCK
|
|
|
|
|
Not all VFW drivers will show the dialogs when the video is active, especially the source dialog.
"Newer" WDM drivers seem to have better live dialog support. I've only accessed these
through DirectShow.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I go this error:
"Unhandled exception at 0x7c964ed1 in 123.exe: 0xC0000142: DLL Initialization Failed."
Do you know how to get more information for this error?
Thanks,
|
|
|
|
|
hi all,
I wonder if it is possible to give window message different priority, or in other word, one message can interrupt the message queue and is processed before other messages although it arrives in the message queue later.
if that's not possible, what's your solution to handle the situations when a window have to process a long message queue, could be > 10 or even 20 messages waiting to be processed.
|
|
|
|
|
GameProfessor wrote: I wonder if it is possible to give window message different priority, or in other word, one message can interrupt the message queue and is processed before other messages although it arrives in the message queue
Not unless you invent it yourself with a different message queue that you handle yourself.
Windows messages can be considered to have three priority levels. Posted messages have the highest priority. This means that they have a higher priority than input messages which are the next priority level. WM_PAINT and WM_TIMER have the lowest priority, in fact they are "pseudo" messages that not even make it to the message queue. The messages are simulated by setting a flag instead and they are processed when the message queue is empty. This also means that even if a timer has expired multiple times before being handled, the message handler for the WM_TIMER message will only be called once.
GameProfessor wrote: if that's not possible, what's your solution to handle the situations when a window have to process a long message queue, could be > 10 or even 20 messages waiting to be processed.
Depends on the situation, you have to elaborate more on the problem you're trying to solve.
I suspect I would use a worker thread reading a queue with application specific contents and not use the windows message queue. The thread would wait for a semaphore that is released when a new object is placed in the queue and process the new object. But this could be a bad solution, it depends on what you're trying to do.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hello,
I have created a menu in my Application class and one of my child windows have that menu when the child window is created.
How do I create object Ids for the menu options so that I can write function handlers for the menu option through class wizard by selectiong those object Ids.
Or Is it that I cannot go through the class wizard route if I have created my menu through CMenu class.
Thanks
Prithaa
|
|
|
|
|
prithaa wrote: I have created a menu in my Application class
Do u have the menu in the resource or you dynamically created it?
nave
|
|
|
|
|
Hello,
Thanks for your reply
I created the menu using CMenu class.
CMenu M;
M.CreateMenu();
M.AppendMenu(MF_POPUP ,IDR_STRING142,(LPCTSTR)"Demand");
M.AppendMenu(MF_STRING ,IDS_STRING143,(LPCTSTR)"Supply");
M.AppendMenu(MF_STRING ,IDS_STRING144,(LPCTSTR)"Cost");
And I added these IDS_STRING142 in the string Table.
Now I want Object Ids to write sunction handlers for the above menu options
Prithaa
|
|
|
|
|
When a menu is clicked, a WM_COMMAND message is send to the parent window of that menu. So handle the WM_COMMAND message ( overide the OnCommand if your using MFC dialog ) in the parent window.
BOOL CMyDlg::OnCommand(WPARAM wParam, LPARAM lParam) <br />
{<br />
if( HIWORD(wParam) == 0 )<br />
{<br />
if ( LOWORD(wParam) == IDR_STRING142 )<br />
{<br />
}<br />
else if ( LOWORD(wParam) == IDS_STRING143 )<br />
{<br />
}<br />
....<br />
}<br />
return CDialog::OnCommand(wParam, lParam);<br />
}
nave
|
|
|
|
|
Hello,
Thanks Naveen.
This should work I'll try. I just forgot about WM_COMMAND messages.I could not think out of MFC's and got lost in the class wizard ,I suppose
Anyway thanks Bye
Thanks
|
|
|
|
|
prithaa wrote: Thanks Naveen.
And with my previous post I made my post count 1000
nave
|
|
|
|
|
Hello,
Oh that's great.
And I was a part of it.
You seem to be an active member of codeproject.
All the best for all your pojects.
Thanks ,WM_COMMAND worked.I am going ahead with your advice.
Bye
|
|
|
|
|
Is there anyway to detect virus in a usb device using mfc?
|
|
|
|
|
I think if virus detection would be that easy then we wouldn't have to pay companies for writing anti virus software
|
|
|
|
|
GetVirusInfo() must help you. If you want the name of the virus too, use GetVirusInfoEx()
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
Is it possible for me to override GetVirusInfo();;)
|
|
|
|
|
brahmma wrote: GetVirusInfo() must help you. If you want the name of the virus too, use GetVirusInfoEx()
Do we also have access to SetVirusInfo() and SetVirusInfoEx() ? It doesn't make any sense to get your virus information if you have not set it correctly to begin with.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: Do we also have access to SetVirusInfo() and SetVirusInfoEx()?
Yes, but it's a PITA now with all the UAC business...
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi everybody,
if a key is stroken, the message is catched into the current view.
PreTranslateMessage sends the message to the class-parents (View->CFormView->...)
If the message isn't "used" it should return FALSE and at the end the Parent of
the current view gets the message, send it's to his parent-classes and so on...
If i hit for example the R-key the message travels down to the class-parents and returns
TRUE in the function IsDialogMessage. So the parent-views doesn't get this message.
My structure is Frame -> View1 -> TabWnd -> View2 ... if i hit the R-Key in View2 the message
should travel till View1 where i catch it and return TRUE
Big thanks in advance
|
|
|
|
|
baerten wrote: if i hit the R-Key in View2 the message
should travel till View1 where i catch it and return TRUE
Handle the WM_GETDLGCODE message in the view2 and return 0 when the message is WM_KEYDOWN and key is "R".
nave
|
|
|
|
|
Yes thats a possibility, but if i have the View1 with all the keystrokes (10 for example)
And 15 possible View2's (View2 is loaded in circumstance of the keystroke )
I need to add all 10 keystrokes into all 15 Views ...
And a generally WM_KEYDOWN return TRUE is also not the solution, because the parent-class of
all my views handles for example the ESCAPE Key...
Mmh, but nevertheless Thanks for your help
|
|
|
|
|
Why coudnt you overide the PreTranslateMessage() in the app class and handle the keystrokes there itself?
nave
|
|
|
|
|
Thats doesn't work
Because the message must travel to the bottom of hierarchy, for example to put the
Key into the textbox. If i send the KeyDown directly to my own Basic-View, the textboxes
will never be filled
Thanks anyway
|
|
|
|