|
You're a lucky guy sitting at Italy. You must be drinking the best espresso coffees.
CPallini wrote: What is espresso americano?
I'm not a coffee expert (I drink lots of tea). To me, it is just another black coffee. But I always like italiano (in black coffee) or cappuccino better for reasons unknown. I've also liked frappe + chocolate sauce topped up with freshly whipped cream (when it comes to cold coffee).
I think we're *this* close to hijack this thread and convert it to a food thread completely.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
big thanks for your answer.
Yes it has really a reason This way i hide a vertical at the left side of the Grid.
So the grid is smaller and fit's better to the layout.
Ok, as i understand i can't get the initial value because during the draw it's "deleted"
but if this grid is drawn at new, "the view" need to know how to draw the grid, which means
at (-10,0,200,100) and not at (0,0,...)
|
|
|
|
|
I get it now. I was just wondering why did you go out of your way to draw your grid out of the window area. Rajkumar's answer is pretty straight forward. CPallini's solution should work too.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I think you need:
pGrid->GetWindowRect(&rect);
pView->ScreenToClient(&rect);
But I didn't make a test.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
AFAIK, you have to remove the call to ScreenToClient, otherwise you'll end up with the same resutl as calling GetClientRect.
|
|
|
|
|
I don't think so, because ScreenToClient is called by the pointer to CView .
On the other hand, pGrid->GetWindowRect will not produce the expected result for sure (of course there is a small probability for a coincidence...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Yes that's right, I completely missed the point (next time I'll read the question more slowly)
|
|
|
|
|
The fast & furious Cédric!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Client rectangle is relative to the upper left corner of the window. so the coordinates of the upper-left corner are (0,0).
baerten wrote: But how i can retrieve where my grid is really positionated on the view?
I want to get the value of (-10,0,200,100), like i used it in the Grid->Create(...);
You may need to map the rectangle from grid to your view window, see [MapWindowPoints^]
|
|
|
|
|
Big thanks for MapWindowPoints
I will test it
|
|
|
|
|
I think CPallini's solution should also work for your case.
|
|
|
|
|
I was just going to suggest that to him.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
yes offcourse, but MapWindowPoints is straight forward. instead of WindowA->Screen->WindowB, it is WindowA->WindowB.
|
|
|
|
|
Umm... yes, but I wanted to clarify the OP CPallini's answer is right too, as there was a conversation on its correctness between him and Cedric.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Rajesh R Subramanian wrote: as there was a conversation on its correctness between him and Cedric
Turns out he is smarted than me
|
|
|
|
|
Both of you are smart without a doubt.
Except for when may be CPallini gets on drugs.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
If I'm not wrong, the client area is the portion of a Windows excluding toolbars, menus, and status bars which always starts with (0,0) coordinates.
And about GetWindowRect, MSDN says "The GetClientRect function retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0)."
- Malli...!
|
|
|
|
|
How can I hook all the messages passed to the Toolbar?
For example,I want to hook the message TB_COMMANDTOINDEX and the message WM_LBUTTONDOWN passed to the Toolbar.But when I use the function SetWindowsHookEx(...),I get a problem!I don't know how to set the first parameter of the function.Do I need to make two different hooks? or can solve the problem in one?
Thanks for your help!
|
|
|
|
|
Why don't you try to hook windows procedure itself ('WH_CALLWNDPROC' as the first parameter) or 'WH_GETMESSAGE'. And can you specify what error do you get?
- Malli...!
|
|
|
|
|
Firstly I'm very glad to receive your reply.
I don't get any exception at all however the application doesn't run as my expect.Actually,I have been trying to do what as you tell me.When the first parameter is 'WH_CALLWNDPROC' I can hook the WM_MOUSEACTIVATE correctlly and when 'WH_GETMESSAGE ' I can hook the WM_LBUTTONDOWN and WM_LBUTTONUP.
My question is that can I get the WH_GETMESSAGE,WM_LBUTTONUP and WM_LBUTTONUP or any other message at the same time in which way I only specify 'XXXX' as the first parameter rather than use two different hooks?
You know that I'm a chinese and my English is poor.So please forgive my stupidity.
Thanks for your help!
|
|
|
|
|
before going into Hooks, if the window is in your application what about subclassing it.
|
|
|
|
|
I want to open CorelDraw Files in my project. How i can open that *.CDR files.Which files are supported to open that files. plz Send me details.
Thank you,
|
|
|
|
|
if you don't know the internal format of such files, it's the first thing to search for.
unfortunately, I doubt you'll find any answer on this, because it's a proprietary format...
|
|
|
|
|
kishorpathare wrote: How i can open that *.CDR files.
Can you use ShellExecute() ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
icreate an activex with Visual c++6(mfc) and called its property in a vc sample.
i add one new property to AxtiveX but when i run my sample and call my old properties , i get "invalid number of parameters" error message.
i didnt any change in old property and just add new property with class wizard but get this error.
please help me
my new property :
DISP_PROPERTY_EX(CMyCtrl, "AutoChecking", GetAutoChecking, SetAutoChecking, VT_BOOL)
//=============================================
afx_msg void SetAutoChecking(BOOL bNewValue);
afx_msg BOOL GetAutoChecking();
//=============================================
void CMyCtrl::SetAutoChecking(BOOL bNewValue)
{
bAutoCheck = bNewValue;
SetModifiedFlag();
}
//=============================================
BOOL CMyCtrl::GetAutoChecking()
{
// TODO: Add your property handler here
return bAutoCheck;
}
//=============================================
dispidAutoChecking = 17L,
|
|
|
|