|
I would use:
void CTestTreeDlg::OnTreeRclick( NMHDR* pNMHDR, LRESULT* pResult )
{
CPoint point(GetMessagePos());
m_tree.ScreenToClient(&point);
<br>
HTREEITEM hi=m_tree.HitTest(point);
<br>
if (hi)
{
}
} where m_tree is the CTreeCtrl member associated with your control.
Maybe not the best method but it works.
"though nothing
will keep us together
we can beat them
for ever and ever"
rechi
|
|
|
|
|
yep, I've read about using HitTest .
It seems like the lesser evil ...
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
How to find a template in a Bmp file? Maybe the template in the Bmp file is rotate or scaled.Who can tell me the algorithm? Thanks!
|
|
|
|
|
I made a MFC ActiveX. I want to open the activeX in a toolWindow with the createToolWindow method.
When The toolWindows is created, I have Hatched border at the right and bottom of my activeX.
How can i do to suppress it ? (It seems that all MFC ActiveX i downloaded do the same thing....)
|
|
|
|
|
Hi,
I'm using WH_MOUSE and WH_KEYBOARD hooks to sense user movement just like a screensaver. The screensaver prevents the hook messages from reaching the program. Therefore I disable the screensaver when I enable hooking.
Now I've realized that if the user locks the computer manually - by pressing CTRL+ALT+DEL and afterwards the "Lock Computer" button, then the hook messages never reach the program.
Is there a way to let the hook messages pass beyond the logon screen and reach my running program?
Thanks in advance...
|
|
|
|
|
inject your code into the process that is showing the user screen and enable hooks from it
gabby
|
|
|
|
|
Hi there,
I want a dialog-based MFC application, that receives URLs from Internet Explorer via Drag'n'Drop.
My Dialog consists of Listboxes, Edit-fields, buttons and so on. I want my Internet-Explorer to show a html-page. When I drag this page to my dialog, I want to process this URL to display the parts of the URL in different controls.
I tried a simple FileManager-Drop Operation, but Internet Explorer does not provide URLs via this Mechanism. All the OLE-examples show, how to drag items from a listbox into another listbox.
How can I receive a Drop from Internet-Explorer?
e-DJ
|
|
|
|
|
Hello,
Now I have been testing a aplication program which is implimented
by Win32(VC++) and Pro*C.
What I am comfused is that the count of the application's handles
which is displayed on TaskManager is incremented only, never decremented.
The application should be used for 24 hours everyday,
so I think this is a serious problem.
I have been triying to check my code,
especially where kernel objects is created and the handle should be closed,
but I haven't found what is wrong.
I guess that I can get some hints if I can know which module has handles
in the application process.
Cay anybody Know about it?
or what I should do anything else generally?
regards.
Takanobu Maekawa
|
|
|
|
|
|
Thank you!!
That is just what I need!.
I have found some handles which are associated with registry key operations.
thanks very much again.
Takanobu Maekawa
|
|
|
|
|
hi
I write a program, and I want my program cannot not be kill by TaskManager, same easycafe. But I don't know the way to do this.
When i choose client.exe (exe file of easycafe) and click End Process, the process still run.
|
|
|
|
|
You could write the program as a service so that it'd run under the SYSTEM account and then you couldn't kill it without admin privillages.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Hi. I want to call, from an application made with Visual C++, Excel or Matlab so that one of both could represent a mathematical function. How can I do that?. Someone can help me?
|
|
|
|
|
|
I want to make some form.
It's properties are : alway on top, transparency and NOT CLICKED.
ur...what I means is: the window look like a translucent glass.
well, another word, a concept like the 'layer' of the Photoshop.
(sorry, my english level is very~~ low... )
Does this form is possible? and how?
:: the major point is 'never clicked'
thanks!
|
|
|
|
|
Hi There,
Does anybody know if there is a way that you can prevent a
CSplitterWnd from resizing? For example if user's mouse is on
the CSplitterWnd border, the icon should not change and the user
should not be able to make the window smaller or bigger.
Second question, if you have a couple of nested CSplitterWnd's,
how can you show and hide a specific CSplitterWnd?
I would appreciate it very much if any one could help me
on these questions.
Thanks
Gerhard
|
|
|
|
|
hello guys,
I need in one of my dialogs a combobox with the directory tree of the PC.
You know, like the one you see in the open-file dialog of VC Studio ( the "Look in" combo)..
Is there an easy method to accomplish this?
or will I need to querry for the directorys myself and set icons etc....
Any advice welcome,
thx
Davy
|
|
|
|
|
Do you mean something like the CB_DIR message?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Hi,
I would like to know if I can I add a CButton to a CScrollView?
If so, how can I do it or is there some sample.
Regards,
Magnus
|
|
|
|
|
Doubtful, but you can add one to a CFormView , which is derived from CScrollView .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Great!
A CFormView was just what I needed!
Thanks,
Magnus
|
|
|
|
|
hi all,
i am getting this error
error LNK2001: unresolved external symbol "public: __thiscall CMyCrypto::~CMyCrypto(void)" (??1CMyCrypto@@QAE@XZ)
<br />
<br />
class CMyCrypto {<br />
...<br />
CMyCrypto(LPTSTR lpPassword, ALG_ID algorithm);<br />
~CMyCrypto();<br />
<br />
BOOL Encrypt(LPBYTE pData, LPDWORD pdwDataSize, <br />
DWORD dwBufferSize, BOOL bFinal);<br />
BOOL Decrypt(LPBYTE pData, LPDWORD dwDataSize,<br />
BOOL bFinal);<br />
<br />
...
why is this error?
thank you
mani kanth
|
|
|
|
|
~CMyCrypto(); This line declares, not does not define, the destructor of CMyCrypto . If this class is yours (i.e. you have written it) than you'll have to supply the destructor. Possibly a do-nothing destructor will do:
class CMyCrypto {
...
~CMyCrypto()
{
}
Hope this helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I want to display the % completed on top of my progress bar.
I was looking around on here and found what seems to be the perfect solution:
http://www.codeproject.com/miscctrl/text_progressctrl.asp
HOWEVER:
That was last updated in VC++ 6.
I'm using VC++ 7 (aka VC++ .NET), and it won't compile it.
There's something wrong with the message map handlers (in that thier typing is incorrect somehow) but I can't figure out for the life of me how to fix it.
I have a fair ammount of C/C++ experience but only 2 weeks of Visual C++ and MFC experience (!) so I'm not entirely sure on all the Microsoft defined types etc.
The other thing that's throwing me is that these are (possibly) scope errors, and so far as I can see the function definitions and declarations are in scope.
Here's an example of what I'm getting:
<br />
c:\Documents and Settings\xxxxxx\Desktop\progress temp\TextProgressCtrl.cpp(158) : error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CTextProgressCtrl::* )(WPARAM,LPTSTR)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'<br />
None of the functions with this name in scope match the target type<br />
That is generated from the following member function/function call.
PLEASE NOTE THAT THE FUNCTION IS DECLARED PRIVATE! But this shouldn't matter because the message map is in the .cpp which is within scope of private for that class, right?
Message map (in .cpp)
ON_MESSAGE(WM_GETTEXT, OnGetText)
Definition (in .cpp)
LRESULT CTextProgressCtrl::OnGetText(WPARAM cchTextMax, LPTSTR szText)<br />
{<br />
if (!_tcsncpy(szText, m_strText, cchTextMax))<br />
return 0;<br />
else <br />
return min(cchTextMax, (UINT) m_strText.GetLength());<br />
}<br />
Declaration (in .h)
afx_msg LRESULT OnGetText(WPARAM cchTextMax, LPTSTR szText);<br />
Any help very much appreciated.
|
|
|
|
|
I think the problem is due to stricter type checking in .NET version of MFC: the message handlers must have the right signature, which is not the case for CTextProgressCtrl::OnSetText and CTextProgressCtrl::OnGetText . I've made the following changes and things seem to work:
...
afx_msg LRESULT OnSetText(WPARAM, LPARAM);
afx_msg LRESULT OnGetText(WPARAM, LPARAM);
...
LRESULT CTextProgressCtrl::OnSetText(WPARAM, LPARAM lParam)
{
LPCTSTR szText=(LPCTSTR)lParam;
LRESULT result = Default();
if ( (!szText && m_strText.GetLength()) ||
(szText && (m_strText != szText)) )
{
m_strText = szText;
Invalidate();
}
return result;
}
LRESULT CTextProgressCtrl::OnGetText(WPARAM cchTextMax, LPARAM lParam)
{
LPTSTR szText=(LPTSTR)lParam;
if (!_tcsncpy(szText, m_strText, cchTextMax))
return 0;
else
return min(cchTextMax, (UINT) m_strText.GetLength());
} Hope this helps.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|