|
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.
|
|
|
|
|
|
Itz urgent?
For instance you need to replace the following line
narodachintoo@yahoo.com wrote: m_listctrl.InsertItem(dwEntry++,(LPCTSTR) pServerInfo->sv101_name);
with:
#ifndef _UNICODE
const int SIZE = 0x100;
char szName[SIZE];
int wlen = wcslen(pServerInfo->sv101_name);
WideCharToMultiByte(CP_ACP, 0, pServerInfo->sv101_name, wlen , szName, SIZE, NULL, NULL);
m_listctrl.InsertItem(dwEntry++,(LPCTSTR) szName);
#else
m_listctrl.InsertItem(dwEntry++,(LPCTSTR) pServerInfo->sv101_name);
#endif
BTW error handling left to the reader.
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
|
|
|
|
|
Thanks for ur immidiate replay m in middle of some appli and this is another issue so m not able to spend much time behind R&D so...
by the way ur code gives some errors.
wcslen' : cannot convert parameter 1 from 'char *' to 'const unsigned short *'
'WideCharToMultiByte' : cannot convert parameter 3 from 'char *' to 'const unsigned short *'
|
|
|
|
|
The error message is in bold contrast with SERVER_INFO_101 definition. Could you post, please full code?
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
|
|
|
|
|
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--)
{
#ifndef _UNICODE
const int SIZE = 0x100;
char szName[SIZE];
int wlen = wcslen(pServerInfo->sv101_name);
WideCharToMultiByte(CP_ACP, 0, pServerInfo->sv101_name, wlen , szName, SIZE, NULL, NULL);
m_listctrl.InsertItem(dwEntry++,(LPCTSTR) szName);
#else
m_listctrl.InsertItem(dwEntry++,(LPCTSTR) pServerInfo->sv101_name);
#endif
this is the full code and thanks for ur immidiate resopnses.
the same which m trying is working fine in c#.net now.
|
|
|
|
|
What is your platform (the operative system of your machine)?
Try (just a guess-based attempt, don't balem me if it doesn't work) to change the following lines
narodachintoo@yahoo.com wrote: nt wlen = wcslen(pServerInfo->sv101_name);
WideCharToMultiByte(CP_ACP, 0, pServerInfo->sv101_name, wlen , szName, SIZE, NULL, NULL);
with
int wlen = wcslen((LPWSTR)pServerInfo->sv101_name);
WideCharToMultiByte(CP_ACP, 0, (LPWSTR)(pServerInfo->sv101_name), wlen , szName, SIZE, NULL, NULL);
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
|
|
|
|
|
cooool
its working
thanks.
no blaming yaar u r helping me.
|
|
|
|
|
Hi EveryOne,
I am doing project on GSM modem to send and receive message.I want to use existing dll file for example(comdlg32.dll).Please tell me how shall i use that in my program.please tell me procedure.
it is urgent.Help me.
Regards,
savitri
|
|
|
|
|