1. onEvent, lparam structure parsing.

Greetings!

I have a question about recieving information from a WM_NOTIFY message. I am
creating a wrapper around a control and it sends lots of information via the
WM_NOTIFY message. All of it's information via the WM_NOTIFY message
contains the real stuff on lParam. On lParam is has a structure, and inside
the structure is another structure that contains the actual message. The C
structures look like:

struct NotifyHeader {
    // hwndFrom is really an environment specifc window handle or pointer
    // but most clients of Scintilla.h do not have this type visible.
    //WindowID hwndFrom;
    void *hwndFrom;
    unsigned int idFrom;
    unsigned int code;
};

struct SCNotification {
    struct NotifyHeader nmhdr;
    int position;   // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART,
SCN_DWELLEND
    int ch;     // SCN_CHARADDED, SCN_KEY
    int modifiers;  // SCN_KEY
    int modificationType;   // SCN_MODIFIED
    const char *text;   // SCN_MODIFIED
    int length;     // SCN_MODIFIED
    int linesAdded; // SCN_MODIFIED
    int message;    // SCN_MACRORECORD
    uptr_t wParam;  // SCN_MACRORECORD
    sptr_t lParam;  // SCN_MACRORECORD
    int line;       // SCN_MODIFIED
    int foldLevelNow;   // SCN_MODIFIED
    int foldLevelPrev;  // SCN_MODIFIED
    int margin;     // SCN_MARGINCLICK
    int listType;   // SCN_USERLISTSELECTION
    int x;          // SCN_DWELLSTART, SCN_DWELLEND
    int y;      // SCN_DWELLSTART, SCN_DWELLEND
};

Can anyone help me or tell me where I can get information about parsing and
retrieving this information in my Euphoria program? I am using win32lib.

Thanks!

Jeremy Cowgar

new topic     » topic index » view message » categorize

2. Re: onEvent, lparam structure parsing.

----- Original Message -----
From: <jcowgar at bhsys.com>
Subject: onEvent, lparam structure parsing.


>
> Greetings!
>
> I have a question about recieving information from a WM_NOTIFY message. I
am
> creating a wrapper around a control and it sends lots of information via
the
> WM_NOTIFY message. All of it's information via the WM_NOTIFY message
> contains the real stuff on lParam. On lParam is has a structure, and
inside
> the structure is another structure that contains the actual message. The C
> structures look like:
>
> struct NotifyHeader {
>     // hwndFrom is really an environment specifc window handle or pointer
>     // but most clients of Scintilla.h do not have this type visible.
>     file://WindowID hwndFrom;
>     void *hwndFrom;
>     unsigned int idFrom;
>     unsigned int code;
> };
>

constant NMHDR_hwndFrom = 0,
             NMHDR_idFrom = 4,
             NMHDR_code = 8,
             SIZEOF_NMHDR = 12


...in WinProc(atom hwnd, atom iMsg, atom wParam, atom lParam)

    elsif iMsg = WM_NOTIFY then
          id = peek4s(lParam + NMHDR_hwndFrom)

id would = the control that is sending the notification to the parent...

as for the stuff you have below, you'll need to grab a copy of the SDK and
start reading. Making this work with win32lib is going be a trick!

> struct SCNotification {
>     struct NotifyHeader nmhdr;
>     int position;   // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART,
> SCN_DWELLEND
>     int ch;     // SCN_CHARADDED, SCN_KEY
>     int modifiers;  // SCN_KEY

<snip....>

> Thanks!

Welcome

Euman
euman at bellsouth.net


>
> Jeremy Cowgar

new topic     » goto parent     » topic index » view message » categorize

3. Re: onEvent, lparam structure parsing.

Using the features of win32lib, you could define the 'structure' like
this...

-- struct SCNotification
constant
     SCnmhdr_hwndFrom = allot(Long),
     SCnmhdr_idFrom = allot(UInt),
     SCnmhdr_code = allot(UInt),
     SCposition = allot(Long),
     SCch = allot(Long),
     SCmodifiers = allot(Long),
     SCmodificationType = allot(Long),
     SCtext = allot(Lpsz),
     SClength = allot(Long),
     SClinesAdded = allot(Long),
     SCmessage = allot(Long),
     SCwParam = allot(UInt),
     SClParam = allot(UInt),
     SCline = allot(Long),
     SCfoldLevelNow = allot(Long),
     SCfoldLevelPrev = allot(Long),
     SCmargin = allot(Long),
     SClistType = allot(Long),
     SCx = allot(Long),
     SCy = allot(Long),
     SIZEOF_SCNotification = alloted_size()

Once you get the address of this structure, presumably from the WM_NOTIFY
message, you can access its elements like this ...

     atom lPosition, lLength
     lPosition = fetch(addr, SCposition)
     lLength = fetch(addr, SClength)

and so on...
-----------
Derek


----- Original Message -----
From: <jcowgar at bhsys.com>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, November 11, 2001 6:36 PM
Subject: onEvent, lparam structure parsing.


>
> Greetings!
>
> I have a question about recieving information from a WM_NOTIFY message. I
am
> creating a wrapper around a control and it sends lots of information via
the
> WM_NOTIFY message. All of it's information via the WM_NOTIFY message
> contains the real stuff on lParam. On lParam is has a structure, and
inside
> the structure is another structure that contains the actual message. The C
> structures look like:
>
> struct NotifyHeader {
>     // hwndFrom is really an environment specifc window handle or pointer
>     // but most clients of Scintilla.h do not have this type visible.
>     //WindowID hwndFrom;
>     void *hwndFrom;
>     unsigned int idFrom;
>     unsigned int code;
> };
>
> struct SCNotification {
>     struct NotifyHeader nmhdr;
>     int position;   // SCN_STYLENEEDED, SCN_MODIFIED, SCN_DWELLSTART,
> SCN_DWELLEND
>     int ch;     // SCN_CHARADDED, SCN_KEY
>     int modifiers;  // SCN_KEY
>     int modificationType;   // SCN_MODIFIED
>     const char *text;   // SCN_MODIFIED
>     int length;     // SCN_MODIFIED
>     int linesAdded; // SCN_MODIFIED
>     int message;    // SCN_MACRORECORD
>     uptr_t wParam;  // SCN_MACRORECORD
>     sptr_t lParam;  // SCN_MACRORECORD
>     int line;       // SCN_MODIFIED
>     int foldLevelNow;   // SCN_MODIFIED
>     int foldLevelPrev;  // SCN_MODIFIED
>     int margin;     // SCN_MARGINCLICK
>     int listType;   // SCN_USERLISTSELECTION
>     int x;          // SCN_DWELLSTART, SCN_DWELLEND
>     int y;      // SCN_DWELLSTART, SCN_DWELLEND
> };
>
> Can anyone help me or tell me where I can get information about parsing
and
> retrieving this information in my Euphoria program? I am using win32lib.
>
> Thanks!
>
> Jeremy Cowgar
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu