Click here to Skip to main content
15,917,456 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSplitter Windows Pin
Anthony988720-Feb-02 8:59
Anthony988720-Feb-02 8:59 
GeneralRe: Splitter Windows Pin
Steen Krogsgaard20-Feb-02 21:53
Steen Krogsgaard20-Feb-02 21:53 
GeneralDialog from MFC Extension Dll Pin
NikoTanghe20-Feb-02 8:07
NikoTanghe20-Feb-02 8:07 
GeneralRe: Dialog from MFC Extension Dll Pin
Joaquín M López Muñoz20-Feb-02 9:50
Joaquín M López Muñoz20-Feb-02 9:50 
GeneralDialogProc Pin
Brian van der Beek20-Feb-02 8:00
Brian van der Beek20-Feb-02 8:00 
GeneralRe: DialogProc Pin
Nish Nishant20-Feb-02 8:13
sitebuilderNish Nishant20-Feb-02 8:13 
GeneralRe: DialogProc Pin
Brian van der Beek20-Feb-02 8:48
Brian van der Beek20-Feb-02 8:48 
GeneralRe: DialogProc Pin
Paul M Watt20-Feb-02 9:17
mentorPaul M Watt20-Feb-02 9:17 
Store a pointer to your dialog class in the window data field of the actual dialog window.
Use the SetWindowLong function and set the GWL_USERDATA field.

Then in your static member function of the dialog class that you are using as your dialog proc function, call:
<br />
CYourDialog *pDlg = dynamic_cast<CYourDialog*>(GetWindowLong(hWnd, GWL_USERDATA));<br />
if (!pDlg)<br />
{<br />
    // this message is not for you.<br />
}<br />
<br />
    //Otherwise handle all of your code here.<br />
<br />


This trick will also work for regular windows. If you already have data stored in the USERDATA field, then you can simply convert this data to a structure and include the pointer to your object, or move the data into your class and still hold the this pointer in the USERDATA field.
GeneralButton Menu Pin
Anthony988720-Feb-02 7:12
Anthony988720-Feb-02 7:12 
GeneralRe: Button Menu Pin
Joaquín M López Muñoz20-Feb-02 7:19
Joaquín M López Muñoz20-Feb-02 7:19 
GeneralRe: Button Menu Pin
Ravi Bhavnani20-Feb-02 7:23
professionalRavi Bhavnani20-Feb-02 7:23 
QuestionHow to do a SetPixel with GDI+ Pin
20-Feb-02 7:04
suss20-Feb-02 7:04 
AnswerRe: How to do a SetPixel with GDI+ Pin
Mazdak20-Feb-02 7:30
Mazdak20-Feb-02 7:30 
AnswerRe: How to do a SetPixel with GDI+ Pin
Jon Gohr20-Feb-02 9:15
Jon Gohr20-Feb-02 9:15 
GeneralRe: How to do a SetPixel with GDI+ Pin
20-Feb-02 11:53
suss20-Feb-02 11:53 
QuestionHow to Hide Dialog window in a thread Pin
sanskypotov20-Feb-02 6:30
sanskypotov20-Feb-02 6:30 
AnswerRe: How to Hide Dialog window in a thread Pin
Joaquín M López Muñoz20-Feb-02 6:50
Joaquín M López Muñoz20-Feb-02 6:50 
QuestionDialog Bars? Pin
20-Feb-02 6:19
suss20-Feb-02 6:19 
AnswerRe: Dialog Bars? Pin
yellowine20-Feb-02 8:12
yellowine20-Feb-02 8:12 
GeneralQuick Queustion Pin
Steve Thresher20-Feb-02 6:13
Steve Thresher20-Feb-02 6:13 
GeneralRe: Quick Queustion Pin
Joaquín M López Muñoz20-Feb-02 7:03
Joaquín M López Muñoz20-Feb-02 7:03 
GeneralRendering Points and Lines in DirectX Pin
20-Feb-02 6:18
suss20-Feb-02 6:18 
GeneralReading lines in CAsyncSocket Pin
Jon Hulatt20-Feb-02 5:57
Jon Hulatt20-Feb-02 5:57 
GeneralRe: Reading lines in CAsyncSocket Pin
Joaquín M López Muñoz20-Feb-02 6:41
Joaquín M López Muñoz20-Feb-02 6:41 
GeneralRe: Reading lines in CAsyncSocket Pin
Tim Deveaux20-Feb-02 7:00
Tim Deveaux20-Feb-02 7:00 

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.