PostMessage Madness (OpenInsight 32-Bit)
At 12 OCT 2005 10:47:29AM Don Muskopf wrote:
I am trying to place a context menu at the bottom left corner of a pushbutton control (i.e. left justified at the bottom of the button). I use the following code to call a context menu from the pushbutton.
Ctrl=@Window:".BUTTON_SORT"
equ WM_RBUTTONDOWN$ To 516
Handle=Get_Property(Ctrl,"HANDLE")
ControlSize=Get_Property(Ctrl, "SIZE")
xPos=ControlSize ; x coordinate of the control
yPos=ControlSize
wControl=ControlSize
hControl=ControlSize
lParam=(hControl * 65535 ) + xPos
PostMessage(Handle,WM_RBUTTONDOWN$,0,lParam)
The context menu is placed at the correct vertical position where I want it (immediately below the button), but there seems to be no rhyme or reason as to how the x coordinate works in PostMessage.
If xPos=306, the context menu is placed at xCoordinate 588. If xPos=618, the context menu is placed at xCoordinate 1122. And so on Â…
Is there a method to this madness?
Thanks.
At 12 OCT 2005 12:30PM Richard Hunt wrote:
I have no problems with positioning right click menus on an Edittable. I do know that the HPARAM is calculated as follows…
HPARAM=FROM_THE_LEFT_BORDER_OF_CONTROL + (FROM_THE_TOP_BORDER_OF_CONTROL * 65536)
At 12 OCT 2005 01:36PM Don Muskopf wrote:
Hi Richard,
I thought I was already doing that with:
lParam=(hControl * 65535 ) + xPos
where hControl is the height of the control. Are there any issues with PostMessage and 7.1.1?