Guest Floater Posted April 22, 2011 Posted April 22, 2011 Hi I am trying to monitor text in notepad and wordpad as they are typed using 'SetWindowsHookEx'on $WH_KEYBOARD_LL. On $WM_KEYDOWN I use $hWnd = ControlGetHandle("", "", "") to get the handle for the current control. The following part of code $wparam = DllStructCreate("uint Start") $lparam = DllStructCreate("uint End") _SendMessage($hWnd, $EM_GETSEL, DllStructGetPtr($wparam), DllStructGetPtr($lparam), 0, "ptr", "ptr") works perfectly well on both notepad and wordpad. But when I try $tCharRange = DllStructCreate($tagCHARRANGE) _SendMessage($hWnd, $EM_EXGETSEL, 0, DllStructGetPtr($tCharRange)) wordpad crashes. Could someone suggest the reason and a workaround. Regards Floater
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