PDA

View Full Version : assgin custom callback function to an edit field


OHPen
02-05-2008, 09:46 AM
hey guys,

again i have to bother you with another gui question. i have an edit field which resides on my window. i try to capture WM_LMOUSEBUTTONDOWN message in order to active the edit field by double clicking on it.

the problem is now that the event is not triggered if i click on the edit field, only if i click somewhere on the dialog where no component is placed.

therefore i thought about makeing my own windowproc for the edit field.

i searched msdn and the api which i found is SetWindowLong

http://msdn2.microsoft.com/en-us/library/ms633591.aspx

If i use GWL_WNDPROC is it possible to assign a pointer to my own windowproc ????

i have never done this before so before i refactor my code i want to know if it works.

thx in advance,

OHPen

Maximus
02-05-2008, 11:46 AM
...you forgot to google ...or to read the goold old Petzold guide to windows

this is exactly your problem btw
http://www.pluralsight.com/articlecontent/cpprep0797.htm

this you should also learn too about:
http://win32assembly.online.fr/tut22.html

OHPen
02-05-2008, 02:57 PM
@maximus: thx, but i would be interested in your google search tokens by using the problem discription

PS: Don't spend to much time on that

Maximus
02-05-2008, 03:02 PM
mmh... was the technical name of the stuff you requested, if i remember
subclassing windows control

evlncrn8
02-05-2008, 03:42 PM
yup SetWindowLong

Silver
02-07-2008, 02:17 PM
FWIW I had a similar problem and came to the conclusion it was easier to write my own edit control than to subclass and try to hack in the functionality I wanted (although my issue was to do with drawing in an edit control too).