Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Adding and deleting Scheduled Tasks using NetScheduleJob API functions
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Custom GDI+ class
Converting Unicode data from the Clipboard to a character string using a given code page
Custom FTP Class for Visual FoxPro application
Custom HttpRequest class (WinINet)
Splash Screen for the VFP application
Displaying bitmap using the AlphaBlend function
Displaying animated images on FoxPro form with BitBlt and StretchBlt functions
Establishing connection using the SQLDriverConnect
How to put a vertical text scrolling on the form (a movie cast)
How to make a VFP form fading out when released (GDI+ version)
How to make a VFP form fading out when released (GDI version)
Using FlashWindowEx to flash the taskbar button of the VFP application
Winsock: sending email messages (SMTP, port 25)
How to create non-blocking Winsock server
Creating a mailslot
Using WM_COPYDATA for interprocess communication (VFP9)
Peer-to-peer LAN messenger built with Mailslot API functions
How to print a bitmap file
Sending a standard message with one or more attached files using default email client
Class for sound recording
GDI+: copying to the Clipboard (a) image of active FoxPro window/form, (b) image file
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
  •  
    LOCAL oForm
    oForm = CREATEOBJECT("Tform")
    oForm.Visible=.T.
    READ EVENTS
     
    DEFINE CLASS Tform As Form
        Caption="Left-click inside the form and drag"
        Autocenter=.T.
     
    PROCEDURE Init
        THIS.declare
     
    PROCEDURE Destroy
        CLEAR EVENTS
     
    PROCEDURE MouseDown
    LPARAMETERS nButton, nShift, nXCoord, nYCoord
    #DEFINE WM_NULL 0
    #DEFINE WM_SYSCOMMAND 0x0112
    #DEFINE WM_LBUTTONUP 0x0202
    #DEFINE MOUSE_MOVE 0xf012
     
        IF nButton = 1
            LOCAL hWindow
            hWindow = THIS.HWnd && GetFocus()
     
            = ReleaseCapture()
     
            = SendMessage(hWindow, WM_SYSCOMMAND,;
                MOUSE_MOVE, WM_NULL)
     
            = SendMessage(hWindow, WM_LBUTTONUP, 0, 0)
        ENDIF
     
    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
     
    ENDDEFINE
     

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    860 bytes  
    Created: 2001-11-22 20:10:49  
    Modified: 2011-01-12 14:10:25  
    Visits in 7 days: 83  
    Listed functions:
    GetFocus
    ReleaseCapture
    SendMessage
    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  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright © 2001-2013 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.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (107.20.129.212)
    9.58 hrs.Example: 'Custom GDI+ class'
     Example: 'Adding and deleting Scheduled Tasks using NetScheduleJob API functions'
    Google
    Advertise here!