Click here to Skip to main content
15,899,314 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MAPI in NT Service - PLEASE HELP?? Pin
8-Jun-01 6:22
suss8-Jun-01 6:22 
GeneralDrawing a CListCtrl to a MemDC Pin
Alex Deem18-Feb-01 6:26
Alex Deem18-Feb-01 6:26 
GeneralRe: Drawing a CListCtrl to a MemDC Pin
Michael Dunn18-Feb-01 8:09
sitebuilderMichael Dunn18-Feb-01 8:09 
GeneralI need good Algourithm ... Pin
Hadi Rezaee18-Feb-01 6:23
Hadi Rezaee18-Feb-01 6:23 
GeneralRe: I need good Algourithm ... Pin
l a u r e n18-Feb-01 7:10
l a u r e n18-Feb-01 7:10 
GeneralRe: I need good Algourithm ... Pin
18-Feb-01 10:18
suss18-Feb-01 10:18 
GeneralRe: I need good Algourithm ... Pin
Christian Graus18-Feb-01 10:21
protectorChristian Graus18-Feb-01 10:21 
GeneralRe: I need good Algourithm ... Pin
Julien18-Feb-01 11:59
Julien18-Feb-01 11:59 
Hey Hadi,

Create a class that inherits from CButton and implement the OnClick event.
In the OnClick you should notify your parent that you have been clicked.
A simple way to do this would be to have your new class have the members:
HWND m_hwndWindowToNotify;
int m_iMessageToSend;
int m_iMyId;
Which you set when you create them all from the parent.
(I assume you have a variable length array)
So you set each CNewButton's hwndWindowToNotify to the parent.
The iMessageToSend to something like WM_USER+100 (which you don'y re-use!)
An m_iMyId as the number of the button (for ease on implementation).

CNewButton::OnClick()
{
::SendMessage(m_hwndWindowToNotify, m_iMessageToSend, m_iMyId, 0);
}

CParentDlg::OnCustom_SpecialButtonClick(LPARAM l, WPARARM w)
{
int iButtonIndex = (int)l;
// Do stuff for iButtonIndex button click
}

*** Don't forget to add ***
ON_MESSAGE(WM_USER+100, OnCustom_SpecialButtonClick)
to your parents message map (BEGIN_MESSAGE_MAP...)


Let us know how you go.

Jules
GeneralRe: I need good Algourithm ... Pin
Tim Deveaux19-Feb-01 10:24
Tim Deveaux19-Feb-01 10:24 
GeneralBackUp Files in VC++ Pin
Gleb18-Feb-01 0:00
Gleb18-Feb-01 0:00 
GeneralRe: BackUp Files in VC++ Pin
Christian Graus18-Feb-01 10:24
protectorChristian Graus18-Feb-01 10:24 
Generalsingleton class Pin
17-Feb-01 19:08
suss17-Feb-01 19:08 
GeneralRe: singleton class Pin
Michael Dunn17-Feb-01 19:48
sitebuilderMichael Dunn17-Feb-01 19:48 
GeneralSelf destructing exe Pin
17-Feb-01 18:18
suss17-Feb-01 18:18 
GeneralRe: Self destructing exe Pin
l a u r e n18-Feb-01 4:53
l a u r e n18-Feb-01 4:53 
GeneralRe: Self destructing exe Pin
19-Feb-01 9:03
suss19-Feb-01 9:03 
GeneralRe: clown chips Pin
l a u r e n19-Feb-01 11:04
l a u r e n19-Feb-01 11:04 
GeneralRe: Self destructing exe Pin
Jason De Arte19-Feb-01 8:23
Jason De Arte19-Feb-01 8:23 
GeneralRe: Self destructing exe Pin
19-Feb-01 9:08
suss19-Feb-01 9:08 
GeneralSelf destructing exe Pin
17-Feb-01 18:15
suss17-Feb-01 18:15 
GeneralHRESULT and SetLastError Pin
PJ Arends17-Feb-01 16:09
professionalPJ Arends17-Feb-01 16:09 
GeneralRe: HRESULT and SetLastError Pin
Ancient Dragon17-Feb-01 17:26
Ancient Dragon17-Feb-01 17:26 
GeneralRe: HRESULT and SetLastError Pin
Tim Deveaux18-Feb-01 4:12
Tim Deveaux18-Feb-01 4:12 
GeneralRe: HRESULT and SetLastError Pin
PJ Arends19-Feb-01 6:41
professionalPJ Arends19-Feb-01 6:41 
GeneralRe: HRESULT and SetLastError Pin
Tim Deveaux19-Feb-01 13:10
Tim Deveaux19-Feb-01 13:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.