[b][red]This message was edited by PAG at 2002-10-13 17:2:28[/red][/b][hr]
[b][red]This message was edited by PAG at 2002-10-13 17:1:45[/red][/b][hr]
Heya, im trying to create my own edit control for windows, i do this by creating a dll, and in the DllEntryPoint I register a class named CEdit. Then in another module I create my main window, and then loads the dll and creates a window of type WS_CHILD of my edit class. Everything goes as it should this far...
In my dll I also have a proc for my edit class...
The problem I have is that it seems that that proc never gets the messages I want it to have.
In the edit proc I wrote some simple message handles like this:
case WM_ACTIVATE:
MessageBox(NULL, "WM_ACTIVATE", "Message", MB_OK);
return 0;
case WM_SETFOCUS:
MessageBox(NULL, "WM_SETFOCUS", "Message", MB_OK);
return 0;
and so on(just to test if it gets those messages)...
But nothing happends, the only message it get is the WM_CREATE message which is sent by the CreateWindow function I call in my other module.
But why doesnt windows send those other messages I stated above?
If I where to create a normal window with the same code, it works perfectly.
So what am I doing wrong?
Why im creating my own edit box, is because noone is giving me a hint on how to make text input work like they do in most source code editors out there, i mean like, when you press return the caret jumps to next line and then moves to the beginning of the text on the previous line, eh smart example:>
some stupid text
.....note some spacing
.....pressed enter and text appeared here...
(as this forum doesnt support mutliple spaces after each other, I put dots, so seee the dots as spaces.)
see what im getting at?
So if you could help on this last problem I have, you dont have to help me on the first one, eh if your gonna help me at all that is...
Thanks for all help, greatly appreciated
Comments
: [b][red]This message was edited by PAG at 2002-10-13 17:1:45[/red][/b][hr]
: Heya, im trying to create my own edit control for windows, i do this by creating a dll, and in the DllEntryPoint I register a class named CEdit. Then in another module I create my main window, and then loads the dll and creates a window of type WS_CHILD of my edit class. Everything goes as it should this far...
: In my dll I also have a proc for my edit class...
: The problem I have is that it seems that that proc never gets the messages I want it to have.
:
: In the edit proc I wrote some simple message handles like this:
:
: case WM_ACTIVATE:
: MessageBox(NULL, "WM_ACTIVATE", "Message", MB_OK);
: return 0;
:
: case WM_SETFOCUS:
: MessageBox(NULL, "WM_SETFOCUS", "Message", MB_OK);
: return 0;
:
: and so on(just to test if it gets those messages)...
: But nothing happends, the only message it get is the WM_CREATE message which is sent by the CreateWindow function I call in my other module.
: But why doesnt windows send those other messages I stated above?
: If I where to create a normal window with the same code, it works perfectly.
: So what am I doing wrong?
:
: Why im creating my own edit box, is because noone is giving me a hint on how to make text input work like they do in most source code editors out there, i mean like, when you press return the caret jumps to next line and then moves to the beginning of the text on the previous line, eh smart example:>
:
: some stupid text
: .....note some spacing
: .....pressed enter and text appeared here...
:
: (as this forum doesnt support mutliple spaces after each other, I put dots, so seee the dots as spaces.)
: see what im getting at?
:
: So if you could help on this last problem I have, you dont have to help me on the first one, eh if your gonna help me at all that is...
:
: Thanks for all help, greatly appreciated
:
[blue]1. [b]WM_ACTIVATE[/b] is not for child windows - it is for popup windows.
2. Use flag ES_MULTILINE and ES_WANTRETURN and you get a control as in NOTEPAD.
3. Use subclassing to make it better.[/blue]
Read this, I think it can help you:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_subclas3.asp
nICO
[hr]
[italic]How beautiful, if sorrow had not made Sorrow more beautiful than Beauty itself.[/italic]
JOHN KEATS