stefanodam78
Programmer
Hi,
I need to resize a borderless form , I used the bindevent command on WM_NCHITTEST . But the resize does not work properly, it always run the resize bottomright even if I drag one of the edges ...
I return the correct value of WM_NCHITTEST but always starts the same resize ...
BorderStyle property is 3 otherwise does not resize (vfp problem)
I remove the border by changing the style of the form (WS_THICKFRAME off)
Example
shape1 identifies the virtual edge
x1 and y1 identify the coordinates of the form than the screen
proc NCHitTestCallback
LPARAMETERS Hwnd , uMsg , wParam , lParam
LOCAL nXCoord , nYCoord , NRET
* Low -order word : cursor x - coordinates
nXCoord = BITAND ( m.lParam , 0x0000FFFF ) - this.x1
* High -order word : cursor y- coordinates
nYCoord = BITRSHIFT ( BITAND ( m.lParam , 0xFFFF0000 ) , 16) - this.y1
* Bottom edge
IF !( m.nXCoord < this.shape1.Left OR m.nXCoord > this.shape1.Left + this.shape1.Width OR;
m.nYCoord < this.shape1.top OR m.nYCoord > this.shape1.top + this.shape1.height )
RETURN 15
endif
RETURN CallWindowProc ( THIS.hOrigProc , m.Hwnd , m.uMsg , m.wParam , m.lParam )
Dest regards
(sorry for my english )
I need to resize a borderless form , I used the bindevent command on WM_NCHITTEST . But the resize does not work properly, it always run the resize bottomright even if I drag one of the edges ...
I return the correct value of WM_NCHITTEST but always starts the same resize ...
BorderStyle property is 3 otherwise does not resize (vfp problem)
I remove the border by changing the style of the form (WS_THICKFRAME off)
Example
shape1 identifies the virtual edge
x1 and y1 identify the coordinates of the form than the screen
proc NCHitTestCallback
LPARAMETERS Hwnd , uMsg , wParam , lParam
LOCAL nXCoord , nYCoord , NRET
* Low -order word : cursor x - coordinates
nXCoord = BITAND ( m.lParam , 0x0000FFFF ) - this.x1
* High -order word : cursor y- coordinates
nYCoord = BITRSHIFT ( BITAND ( m.lParam , 0xFFFF0000 ) , 16) - this.y1
* Bottom edge
IF !( m.nXCoord < this.shape1.Left OR m.nXCoord > this.shape1.Left + this.shape1.Width OR;
m.nYCoord < this.shape1.top OR m.nYCoord > this.shape1.top + this.shape1.height )
RETURN 15
endif
RETURN CallWindowProc ( THIS.hOrigProc , m.Hwnd , m.uMsg , m.wParam , m.lParam )
Dest regards
(sorry for my english )