|
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,
|
|
|
|
|
Have you read about version[^] in MIDL , as suggested in reply to your previous post ?
|
|
|
|
|
LPSERVER_INFO_101 pServerInfo = NULL,pBuffer = NULL;
DWORD dwEntry = 0,dwEntriesRead,dwTotalEntries;
NET_API_STATUS nStatus;
CString str;
nStatus = NetServerEnum(NULL,
101,
(LPBYTE *) &pBuffer,
MAX_PREFERRED_LENGTH,
&dwEntriesRead,
&dwTotalEntries,
SV_TYPE_ALL,
NULL,
0);
int i=0;
if(nStatus == ERROR_SUCCESS)
{
pServerInfo = pBuffer;
while (dwEntriesRead--)
{
m_listctrl.InsertItem(dwEntry++,(LPCTSTR) pServerInfo->sv101_name);
m_listctrl.SetItemText(i++,0,(LPCTSTR) pServerInfo->sv101_name);
pServerInfo++;
}
}
i want all hosnames in my LAN but
this code puts only first char of hostname in list control. plz let me knw if i am missing anything.
thanks.
|
|
|
|
|
If you're NOT making a UNICODE build then you need to convert the wide-char string pServerInfo->sv101_name to a char one (for instance using WideCharToMultiByte [^] function).
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
|
|
|
|
|
i did put the code in my question can u plz do the changes wht ur saying in tat code.
thanks.
|
|
|
|
|
At least try to understand what he said before asking him to write an entire program for you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks for advise.
Always welcome.
|
|
|
|