|
What do you mean by LButtonDown? I just want do something on button down and something else on button up.
Rostfrei
|
|
|
|
|
|
Which means you need to supply handlers for the WM_LBUTTONDOWN and WM_LBUTTONUP messages.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I managed to supply the handlers. I have the Dialog based application. If I press the mouse anywhere on the dialog I can detect it and can read the coordinates. The problem is when I click on the button. Click is not detected and I guess its intercepted by button. I want to detect the button down and check if mouse down happened in the area where button is. I don't have any method registered with the button. All I want to use it for now is button press/release shadow effect. What can I do? I don't want to draw custom button pictures and place them on the button region.
Regards,
Rostfrei
|
|
|
|
|
One way is to derive your own class from CButton and put the message handlers in it. If that does not work, perhaps message reflection will.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I already tried that but it is not possible to declare message map in there
<br />
class CCustomButton : public CButton<br />
{<br />
private:<br />
DECLARE_MESSAGE_MAP ()<br />
};<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CCustomButton, CDialog)<br />
<br />
END_MESSAGE_MAP()<br />
because I get error
<br />
mainAppDlg.cpp(106): error C2248: 'CDialog::GetThisMessageMap' : cannot access protected member declared in class 'CDialog'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(2864) : see declaration of 'CDialog::GetThisMessageMap'<br />
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxwin.h(2767) : see declaration of 'CDialog'<br />
What is message reflection?
Regards,
Rostfrei
|
|
|
|
|
Rostfrei wrote: I already tried that but it is not possible to declare message map in there
Sure it is. MFC would not be worth a whole lot otherwise.
Rostfrei wrote: class CCustomButton : public CButton
...
BEGIN_MESSAGE_MAP(CCustomButton, CDialog)
Notice the discrepancy?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I'm sorry I just don't get it. What is different?
Rostfrei
|
|
|
|
|
a button inherits from CButton , not CDialog
|
|
|
|
|
Hi,
Detecting a "Missing Character Glyph" without looking at a window
I am developing a dialog similar to Windows Word - Insert - Symbol Table Dialog.
For this all the charaters have to be displayed for the selected font (from all the existing fonts) and subsets which support the current font.
I am able to display the characters but some are appearing blank. These are the characters which are not supported by the the current font.
Can anyone tell me how to detect missing glyphs?
Till now I have tried with WideCharToMultiByte and GetCharacterPlacement.
But nothing seems to work.
I thought of using uniscribe function ScriptStringAnalyse.
Is this the correct function I should use?
Also I dont have Usp10.h and Usp10.lib on my system. Though I do have Usp10.dll
I thought of downloading same but looks like it comes as SDK package.
I just need this .h and .lib file.
Can anybody send me these two files?
Thanks a ton,
Arti Gujare
Arti Gujare
|
|
|
|
|
I know the SDK can be quite a pain to download, I managed to put it off for months and months, but 400mb laters, I already feel the benefits.
I would really advise you download it and burn it to CD. Scrounging files here and there will just end up causing more conflicts than a drunk french man in an english bar.
|
|
|
|
|
hi
i have problem converting from char * to unsigned short * when compiling in UNICODE ,i have _UNICODE defined
code is as follows:
CString sBuf;
sBuf.Format(_T("RCPT TO:<%s>\r\n"), m_sEmailAddress);
//where m_sEmailAddress is CString object
LPTSTR pszRCPT = T2A((LPTSTR) (LPCTSTR) sBuf); //error is at this line
any links would do good
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
-- modified at 12:24 Wednesday 5th April, 2006
|
|
|
|
|
|
QuickDeveloper wrote: LPTSTR pszRCPT = T2A((LPTSTR) (LPCTSTR) sBuf); //error is at this line
which ?
|
|
|
|
|
v2.0 wrote: which ?
the error is while typecasting sBuf to LPTSTR....
is there any other way to type cast??
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
QuickDeveloper wrote: the error is while typecasting sBuf to LPTSTR....
i didn't ask WHERE, but WHICH
man, if you don't tell us the error message, how do you want us to help you ?
we are not geniuses
|
|
|
|
|
v2.0 wrote: if you don't tell us the error message,
the error message is the title of the post
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Use this sBuf.GetBuffer(sBuf.GetLength())
Regards,
FarPointer
|
|
|
|
|
T2A converts to ANSI. In a Unicode build, LPTSTR will be a wide character, so setting a variable of type LPTSTR to the result of the T2A macro makes no sense. If you want pszRCPT to be ANSI (as implied by the code), declare it as LPSTR (note the missing 'T')
LPSTR - ANSI character string
LPWSTR - wide character string
LPTSTR - ANSI or wide character string depending on if _UNICODE is defined or not
|
|
|
|
|
Thank you very much..the problem is solved
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
T2A returns an ANSI string, but you're assigning to a LPTSTR (a Unicode string).
You also shouldn't be removing the const without a good reason, which I don't see in the snippet.
LPCSTR pszRCPT = T2CA(LPCTSTR(sBuf));
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Type checking ruins everyone's lives.
__asm
{
mov eax, [sBuf]
mov [pszRCPT], eax
}
|
|
|
|
|
Why can't I put a menu on an MDI child?!?! Who did this!?! Life is no longer worth living!
|
|
|
|
|
Hi,
How to change the security permission of a folder and a file.
Regards,
FarPointer
|
|
|
|
|
Search for Access Control Entry (ACE) and Access Control List (ACL).
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|