Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

child window stuff.....

PAGPAG Member Posts: 168
[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

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : [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 :)
    :
    [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]
  • chick80chick80 Member Posts: 349
    The best way to do that is to subclass the edit box.

    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


  • Andre YoungAndre Young USAMember Posts: 0

    _ \ http://forcoder.org \ free ebooks and video tutorials about / Objective-C MATLAB Go Perl JavaScript Delphi C# Visual Basic .NET Assembly Swift Java Scratch Visual Basic C++ C Python PHP Ruby PL/SQL R Scheme Transact-SQL Dart Alice ABAP COBOL ML Apex Erlang SAS VBScript Scala Prolog Lua Kotlin Ada D Logo Julia Clojure Rust LabVIEW Bash Hack Awk Crystal FoxPro Lisp Fortran F# / _______

Sign In or Register to comment.