mfc >> OnContextMenu - thanks

by Jim McGill » Thu, 04 Dec 2003 00:59:38 GMT

Thanks both Bill and Ali. Either method should work.
Working on your own sometimes you just get blind. This
group is great for getting out of a rut.

Jim


Similar Threads

1. OnContextMenu - where do I hang it?

2. Display PopUp Menu OnContextMenu

How can I get a handle to the object that is being clicked?. I have multiple 
ListBoxes and need to use ItemFromPoint(). 

3. OnContextMenu forwarding, pWnd changes

4. OnContextMenu pWnd is the dialog, need the static control

In a class derived from CPropertyPage, I am writing an OnContextMenu
handler. When I right click on a button, the pWnd parameter to
OnContextMenu is the window of the button. However, when I right click
on a static control, pWnd is the window of the property page itself. I
need to get the window of the static control (actually I want the
control ID, but once I have the window I can get the control ID).

The only way I see to do this is to iterate through all the controls
on the property page, and get their window rectangle and do my own hit
testing. Isn't there a better way?

TIA,

Chris

5. How can create this thread? help me ,thank thank thank - CSharp/C#

6. Thanks. Tried again and it works. Thanks

Thanks

>-----Original Message-----
>Where did you declare it?
>
>You should have a line in your source code somewhere that 
looks like:
>
>short CMyCreatedCOM::m_factor = 0;
>
>I don't think you want:
>
>CMyCreatedCOM::CMyCreatedCOM()
>{
>    m_factor = 0;
>}
>
>since this resets the static member variable to zero 
every time a new
>instance is created.
>
>Brian
>
>
>.
>

7. Please help me with some pointer work -- thanks! - CSharp/C#

8. Need advice on Class. Thank You

On Tue, 07 Jul 2009 21:20:22 -0700, Peter Duniho  
< XXXX@XXXXX.COM > wrote:

> [...]
> As for the larger question, it seems to me you've got two things that  
> need to happen when you add an addition asset:
>
>      -- The Asset instance needs to be added _in sorted order_ to your  
> Assets collection
>      -- The Asset.Content property needs to be added to your Scripts  
> collection, only if the Asset.Type is "Script"

Sorry, I misread the code the first time.  The above isn't correct.  Your  
original code doesn't appear to care about the order of the Assets  
collection itself (though, without a complete example it's impossible to  
say for sure).

What you _do_ need to worry about is the order of your Scripts  
collection.  So, rather than your method implementing those two different  
points, what you really need is a method that simply adds the Asset  
instance to the Assets collection, and then if the Asset.Type is "Script",  
adds the value of Asset.Content to your Scripts collection in sorted order  
(according to the Asset.Priority value).

My other comments about the specifics of doing the sorting still apply,  
just to the different collection.

Pete