DieterMoeyersoon Posted December 12, 2012 Share Posted December 12, 2012 Hello all,in my program I would like to respond to the WM_Settingchange, so I useGUIRegisterMsg($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) EndFuncBrgdsDieter Link to comment Share on other sites More sharing options...
Andreik Posted December 12, 2012 Share Posted December 12, 2012 Have you read this note?Note that some applications send this message with lParam set to NULL.So it's not necessarily to have a pointer to a string. When the words fail... music speaks. Link to comment Share on other sites More sharing options...
DieterMoeyersoon Posted December 13, 2012 Author Share Posted December 13, 2012 Hi Andreik, yes I've seen that but I know for sure in certain cases (eg Group Policy updates) it should be a pointer to a string (eg "Policy")... Link to comment Share on other sites More sharing options...
trancexx Posted December 13, 2012 Share Posted December 13, 2012 (edited) 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 December 13, 2012 by trancexx ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
DieterMoeyersoon Posted December 13, 2012 Author Share Posted December 13, 2012 Hi trancexx, this was indeed the function I was looking for. Thanks for your help! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now