Using Win32 functions in Visual FoxPro Image Gallery
Message and Message Queue
Code examples:
Accessing Adobe Reader 7.0 main menu from VFP application
Browsing Windows Known Folders (Special Folders)
Controlling master audio volume by sending WM_APPCOMMAND messages
Creating irregularly shaped FoxPro form using transparency color key
Detecting changes in connections to removable drives (VFP9)
Displaying hypertext links with the SysLink control (VFP9, Comctl32.dll)
Displaying the associated icons and descriptions for files and folders
Enumerating devices installed on the local machine
Extended MessageBox Class
How to change the name and the size of the font in the MessageBox dialog
How to control Adobe Reader 9.0 (SDI mode) from VFP application
How to disable the Windows Clipboard (VFP9)
How to drag a Form not using its Titlebar or Caption
How to draw custom Window Caption on FoxPro form
How to start the screen saver and how to find whether the screen saver is active
How to view icons stored in executable files (Icon Viewer) - II
How to view system icons for the classes installed on the local machine
Moving shortcut to a specified position on the Windows Desktop
Obtaining names and positions for shortcuts located on the Windows Desktop
Round FoxPro form
System Image List Viewer
Using Common Controls: the Header Control
Using Month Calendar Control (VFP9, Comctl32.dll)
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Using WM_COPYDATA for interprocess communication (VFP9)
Windows Shell Icons displayed and exported to ICO files (Vista)
How to drag a Form not using its Titlebar or Caption

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Before you begin:
Drag the form with a mouse holding at any point in the client area of the form, not just the title of the form. The form can be dragged using its client area even if the Movable property set to False.

See also:
  • Round FoxPro form
  • Tracking mouse movement to detect when to start dragging
  • Dragging files from Explorer window and dropping them on FoxPro control
  • LOCAL oForm
    oForm = CREATEOBJECT("Tform")
    DEFINE CLASS Tform As Form
        Caption="Left-click inside the form and drag"
    PROCEDURE Destroy
    PROCEDURE MouseDown
    LPARAMETERS nButton, nShift, nXCoord, nYCoord
        IF nButton = 1
            LOCAL hWindow
            hWindow = THIS.HWnd && GetFocus()
            = ReleaseCapture()
            = SendMessage(hWindow, WM_SYSCOMMAND,;
                MOUSE_MOVE, WM_NULL)
            = SendMessage(hWindow, WM_LBUTTONUP, 0, 0)
    PROCEDURE declare
        DECLARE INTEGER ReleaseCapture IN user32
        DECLARE INTEGER GetFocus IN user32
        DECLARE INTEGER SendMessage IN user32;
            INTEGER hWindow, INTEGER Msg,;
            INTEGER wParam, INTEGER lParam

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    860 bytes  
    Created: 2001-11-22 20:10:49  
    Modified: 2013-09-04 19:45:41  
    Visits in 7 days: 71  
    Listed functions:
    Printer friendly API declarations
    My comment:
    Read MSDN article How to Move a Form that Has No Titlebar or Caption.

    * * *
    This behaviour can also be implemented by intercepting and processing WM_NCHITTEST windows messages sent to the form. If the cursor is inside the client area, return HTCAPTION (2) instead of HTCLIENT (1).

    Note that for top-level forms (ShowWindow=2), the first parameter in WM_NCHITTEST handling BINDEVENT call should not be ThisForm.HWnd, but the window handle of the inner window.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.

    Copyright 2001-2018 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (
    18 sec.Function: 'FindExecutable'
    Function group: 'Shell Functions'
    34 sec.Function: 'URLDownloadToCacheFile'
    Function group: 'URL Monikers'
    51 sec.Function: 'SHFileOperation'
    Function group: 'Shell Functions'
    1.13 min.Function: 'ntohl'
    Function group: 'Windows Sockets 2 (Winsock)'
    1.45 min.Example: 'Displaying system dialog that selects a folder'
    1.73 min.Function: 'CeGetFileSize'
    Function group: 'Remote Application Programming (RAPI)'
    1.98 min.
    2.3 min.Function: 'DragQueryPoint'
    Function group: 'Shell Functions'
    2.58 min.Function: 'OpenEventLog'
    2.85 min.Function: 'Beep'
    Advertise here!