Click here to Skip to main content
16,017,907 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionSpecific editing of a CString Pin
jasn Smith4-Jun-07 2:50
jasn Smith4-Jun-07 2:50 
AnswerRe: Specific editing of a CString Pin
_AnsHUMAN_ 4-Jun-07 3:10
_AnsHUMAN_ 4-Jun-07 3:10 
AnswerRe: Specific editing of a CString Pin
David Crow4-Jun-07 3:29
David Crow4-Jun-07 3:29 
QuestionFont Size Displays [modified] Pin
_AnsHUMAN_ 4-Jun-07 2:48
_AnsHUMAN_ 4-Jun-07 2:48 
AnswerRe: Font Size Displays Pin
Arman S.4-Jun-07 3:15
Arman S.4-Jun-07 3:15 
GeneralRe: Font Size Displays [modified] Pin
_AnsHUMAN_ 4-Jun-07 3:24
_AnsHUMAN_ 4-Jun-07 3:24 
AnswerRe: Font Size Displays Pin
Mark Salsbery4-Jun-07 4:47
Mark Salsbery4-Jun-07 4:47 
Questionsubclassing an activex control in mfc [modified] Pin
dkmr4-Jun-07 2:27
dkmr4-Jun-07 2:27 
Hello,

Here's the problem:

I have an ActiveX control and I want to change - more exactly cancel - the way it handles some basic input window events in a MFC application. (It doesn't export the events of course)

I've tried the "classic" SetWindowLong way for Win32 API subclassing but it doesn't seem to work and I didn't really expected (or maybe I'm not using it right.. I don't know..)

I have the ActiveX Control placed in a dialog. The class instance variable for the Control is a member variable of the dialog class.

In OnInitDialog I have the next lines of code:

CWnd * wnd_ctrlax = GetDlgItem(IDC_PLUGIN1);<br />
HWND handle_ctrlax = wnd_ctrlax->GetSafeHwnd();<br />
old_wnd_proc = (WNDPROC)SetWindowLong(handle_ctrlax, GWL_WNDPROC, (LONG)Subclassing);


old_wnd_proc and Subclassing are both declared global. (Maybe here I'm doing something wrong...)

The new WndProc looks something like this:

LRESULT APIENTRY Subclassing (HWND hWnd, <br />
                              WORD Message, <br />
                              WORD wParam, <br />
                              LONG lParam)<br />
{<br />
<br />
     if (Message == WM_LBUTTONDBLCLK)<br />
     {<br />
     // AfxMessageBox(_T("Done!!!"));<br />
     return 0;<br />
     }<br />
<br />
     if (Message == WM_LBUTTONDOWN)<br />
     {<br />
     //AfxMessageBox(_T("Done!!!"));<br />
     return 0;<br />
     }<br />
<br />
     return CallWindowProc(old_wnd_proc, hWnd, Message, wParam, lParam);<br />
}


I've put breakpoints in the new WndProc handles for the mouse click messages. Of course they never get trigerred.. but the WndProc is entered = a breakpoint on the return CallWindowProc line is triggered continuously.

It just doesn't catch my mouse input in the control = the old functionality remains the same.

If somebody had the some problem or knows an answer for subclassing an ActiveX control and can give me a hint I'll really apreciate it.



-- modified at 8:37 Monday 4th June, 2007
AnswerRe: subclassing an activex control in mfc Pin
Naveen4-Jun-07 15:54
Naveen4-Jun-07 15:54 
Questionhow to make an indicator Pin
bigphish4-Jun-07 2:14
bigphish4-Jun-07 2:14 
AnswerRe: how to make an indicator Pin
David Crow4-Jun-07 3:32
David Crow4-Jun-07 3:32 
GeneralRe: how to make an indicator Pin
vivekphlp4-Jun-07 23:38
vivekphlp4-Jun-07 23:38 
GeneralRe: how to make an indicator Pin
David Crow5-Jun-07 2:37
David Crow5-Jun-07 2:37 
GeneralRe: how to make an indicator Pin
vivekphlp5-Jun-07 18:31
vivekphlp5-Jun-07 18:31 
QuestionAdding a new image (img tag) to the document in Internet Explorer Pin
ajitatif angajetor4-Jun-07 1:30
ajitatif angajetor4-Jun-07 1:30 
QuestionHow to align toolbars? Pin
Anurag Gandhi4-Jun-07 1:13
professionalAnurag Gandhi4-Jun-07 1:13 
GeneralRe: How to align toolbars? Pin
Rajkumar R4-Jun-07 1:24
Rajkumar R4-Jun-07 1:24 
GeneralRe: How to align toolbars? Pin
Anurag Gandhi4-Jun-07 1:38
professionalAnurag Gandhi4-Jun-07 1:38 
AnswerRe: How to align toolbars? [modified] Pin
Rajkumar R4-Jun-07 3:21
Rajkumar R4-Jun-07 3:21 
GeneralRe: How to align toolbars? Pin
Anurag Gandhi4-Jun-07 5:24
professionalAnurag Gandhi4-Jun-07 5:24 
QuestionVector of Pointers Pin
Kevin Brydon4-Jun-07 0:35
Kevin Brydon4-Jun-07 0:35 
AnswerRe: Vector of Pointers Pin
Maximilien4-Jun-07 0:56
Maximilien4-Jun-07 0:56 
AnswerRe: Vector of Pointers Pin
CPallini4-Jun-07 0:57
mveCPallini4-Jun-07 0:57 
GeneralRe: Vector of Pointers Pin
Rajkumar R4-Jun-07 1:19
Rajkumar R4-Jun-07 1:19 
GeneralRe: Vector of Pointers Pin
Kevin Brydon4-Jun-07 1:43
Kevin Brydon4-Jun-07 1:43 

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.