Jump to content

Need help with DLLStructCreate() for WM_NOTIFY lParam


lokster
 Share

Recommended Posts

I have a WM_NOTIFY message handler. The lParam returns a struct of type SCNotification. How to create this struct using DllStructCreate("_help-needed-here_",$lParam)?

I dont know how long will be the "const char *text;"

Here are the struct's according to the documentation:

struct NotifyHeader {   // This matches the Win32 NMHDR structure
    void *hwndFrom;
    uptr_t idFrom;
    unsigned int code;
};

struct SCNotification {
    struct NotifyHeader nmhdr;
    int position;
    int ch;
    int modifiers; 
    int modificationType;
    const char *text;
    int length;
    int linesAdded;
    int message;
    uptr_t wParam;
    sptr_t lParam;
    int line;
    int foldLevelNow;
    int foldLevelPrev;
    int margin;
    int listType;
    int x;
    int y;
};
Link to comment
Share on other sites

I have a WM_NOTIFY message handler. The lParam returns a struct of type SCNotification. How to create this struct using DllStructCreate("_help-needed-here_",$lParam)?

I dont know how long will be the "const char *text;"

Here are the struct's according to the documentation:

struct NotifyHeader {   // This matches the Win32 NMHDR structure
    void *hwndFrom;
    uptr_t idFrom;
    unsigned int code;
};

struct SCNotification {
    struct NotifyHeader nmhdr;
    int position;
    int ch;
    int modifiers; 
    int modificationType;
    const char *text;
    int length;
    int linesAdded;
    int message;
    uptr_t wParam;
    sptr_t lParam;
    int line;
    int foldLevelNow;
    int foldLevelPrev;
    int margin;
    int listType;
    int x;
    int y;
};
This should get you started:

Func WM_SCNOTIFICATION($hWnd, $iMsg, $iwParam, $ilParam)
  Local $tTag, $hFrom, $iID, $iCode, $iPos

  $tTag  = DllStructCreate("hwnd;int;int;int;int;int;int;ptr;int;int;int;int;int;int;int;int;int;int;int;int", $ilParam)
  $hFrom = DllStructGetData($tTag, 1)
  $iID   = DllStructGetData($tTag, 2)
  $iCode = DllStructGetData($tTag, 3)
  $iPos  = DllStructGetData($tTag, 4)
  ;
  ; etc., etc., etc.
  ;
EndFunc

I dont know how long will be the "const char *text;"

*text is a pointer to a null terminated string.
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...