#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
DEFINE DIALOG oDlg
ACTIVATE DIALOG oDlg;
ON CLICK DRAGDLG( oDlg );
CENTER
RETURN NIL
STATIC FUNCTION DRAGDLG( oDlg )
LOCAL aCoo := GETWNDRECT( oDlg:hWnd )
LOCAL aOrg := GETCURSORPOS()
LOCAL aPos
WHILE GETKEYSTATE( VK_LBUTTON )
aPos = GETCURSORPOS()
MOVEWINDOW( oDlg:hWnd, aCoo[ 1 ] + aPos[ 1 ] - aOrg[ 1 ], aCoo[ 2 ] + aPos[ 2 ] - aOrg[ 2 ], , , .T. )
SYSREFRESH()
ENDDO
RETURN NIL
ukoenig wrote:Cristobal,
do You think there is any solution
to respect this setting and adjust the returnvalues of < GetCursorPos() > ?
regards
Uwe
#define LOGPIXELSX 88
#define LOGPIXELSY 90
Function GetLogPixels()
local hDCM := oMWnd:GetDC()
? GetDeviceCaps( hDCM, LOGPIXELSX ), GetDeviceCaps( hDCM, LOGPIXELSY )
oMWnd:ReleaseDC()
Return nil
#define LOGPIXELSX 88
#define LOGPIXELSY 90
#define ASPECTX 40
#define ASPECTY 42
#define ASPECTXY 44
//----------------------------------------------------------------------------//
Function GetLogPixels()
local hDCM := oMWnd:GetDC()
? GetDeviceCaps( hDCM, LOGPIXELSX ), GetDeviceCaps( hDCM, LOGPIXELSY ), ;
GetDeviceCaps( hDCM, ASPECTX ), GetDeviceCaps( hDCM, ASPECTY )
? GetScaleFactorForDevice( 0 )
oMWnd:ReleaseDC()
Return nil
//----------------------------------------------------------------------------//
DLL32 FUNCTION GetScaleFactorForDevice( deviceType AS DWORD ) AS LONG PASCAL LIB "Shcore.dll"
//----------------------------------------------------------------------------//
//----------------------------------------------------------------------------//
Function AdjustPos( aPoint )
Local nZoom := GetScaleFactorForDevice( 0 )
Local nPorc := nZoom / 96
aPoint[ 1 ] := Round( aPoint[ 1 ] / nPorc, 0 )
aPoint[ 2 ] := Round( aPoint[ 2 ] / nPorc, 0 )
Return aPoint
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 39 guests