Jump to content

How to read a ptr to a string (returned by WM_Settingchange


Recommended Posts

Hello all,

in my program I would like to respond to the WM_Settingchange, so I use

GUIRegisterMsg($WM_SETTINGCHANGE , "WM_SETTINGCHANGE")

The lParam parameter is a pointer to a string (see http://msdn.microsoft.com/en-gb/library/windows/desktop/ms725497(v=vs.85).aspx). How can I read this string from memory?

I've tried already with DLLStruct, but this doesn't seem to work well (I also don't know the length of the string). In another topic I found a reference to using __SQLite_szStringRead from SQLite.au3 but this doesn't work either. Any help is welcome.

Func WM_SETTINGCHANGE($hWnd, $iMsg, $wParam, $lParam)
#forceref $hWnd, $iMsg,$wParam
;$myString = __SQLite_szStringRead($lParam)
;$lParamString = DllStructCreate("char[128]", $lParam)
;$myString = DllStructGetData ($lParamString,1)
ConsoleWrite($myString & @cr)
EndFunc

Brgds

Dieter

Link to comment
Share on other sites

So, what exactly is the problem, if there is any anymore?

First you check if lParam is not 0, then you use e.g. _WinApi_StringLen on that pointer to size the struct made at lParam address and then just read the content. How hard is that?

Edited by trancexx

♡♡♡

.

eMyvnE

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...