Sohan
Read/write variables passed in wParam/lParam September 27, 2008 04:40AM |
Piet van Zanten
Re: Read/write variables passed in wParam/lParam September 27, 2008 09:57AM |
BLS
Re: Read/write variables passed in wParam/lParam September 27, 2008 03:19PM |
// You need this structure RECT is structure left is int //Type C : LONG top is int //Type C : LONG right is int //Type C : LONG bottom is int //Type C : LONG END // Your Eventhandler procedure should be similar to this one : PROCEDURE OnMoving(msg, wParam, lParam) //Let's modify the left, and top values of the rectangle structure lParam is pointing to. r is RECT r:left = originalLeftValue r:top = originalTopValue // note that lParam is a pointer to a RECT structure Transfer(lParam, &r, Dimension(r)) RESULT true// In case that you need the data lParam is pointing to :
Transfer(&r, lParam, Dimension(r))// Transfer Syntax : Transfer(destination, source, size)
Sohan
Re: Read/write variables passed in wParam/lParam September 27, 2008 07:30PM |
BLS
Re: Read/write variables passed in wParam/lParam September 27, 2008 07:52PM |
Quote
Sohan
Thanks Piet, Bjoern, it works like a charm!
I thought that I was supposed to use a dynamic structure and make it refer to the lParam address. I tried things like:
r is RECT dynamic = lParam
r is RECT dynamic = &lParam
It never occurred to me that I could use an instantiated structure and *copy* its data to the external address.
Thanks again,
/sohan
lParam += 4 // lParam is pointing to r:_left .. + 4 means lParam is NOW pointing to r:_top // int size is 4 byte so -> increase lParam with 4 __top is int = originalTopValue Transfer(lParam, &__top, 4)As always ... just an ad hoc hack... not tested
Sohan
Re: Read/write variables passed in wParam/lParam September 28, 2008 12:54AM |