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
Enumerating data formats currently available on the clipboard
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Converting Unicode data from the Clipboard to a character string using a given code page
Winsock: sending email messages (SMTP, port 25)
How to download a file from the FTP server using FtpGetFile
Detecting changes in connections to removable drives (VFP9)
How to play AVI file on the _screen
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
Custom FTP Class for Visual FoxPro application
Custom HttpRequest class (WinHTTP)
Mapping and disconnecting network drives
How to display the Properties dialog box for a file (ShellExecuteEx)
Deleting files into the Recycle Bin
Creating the Open dialog box to specify the drive, directory, and name of a file to open
How to activate Windows Calculator
Splash Screen for the VFP application
Using EnumPrinters function to enumerate locally installed printers
Custom HttpRequest class (WinINet)
Using Font and Text functions
Establishing connection using the SQLDriverConnect
How to convert a bitmap file to monochrome format (1 bpp)
Disabling drawing in the VFP form

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
 
DO decl
 
PUBLIC objForm
objForm = CreateObject("TForm")
objForm.Visible = .T.
 
DEFINE CLASS TForm As FORM
    Caption = "Disabling drawing in the form"
    Width=400
    Height=250
    AutoCenter = .T.
 
    ADD OBJECT cmdLock As CommandButton WITH;
    Left=10, Top=15, Width=80, Height=24,;
    Caption="Lock"
 
    ADD OBJECT cmdMsg As CommandButton WITH;
    Left=92, Top=15, Width=80, Height=24,;
    Caption="Test"
 
PROCEDURE  LockForm
    LOCAL hWindow
 
    * obtaining a window handle for the form
    hWindow = GetFocus()
 
    * disabling the form moving
    * since when the form is moved the VFP unlock
    * its window automatically
    ThisForm.Movable = .F.
 
    * locking the window
    = LockWindowUpdate(hWindow)
 
PROCEDURE  cmdLock.Click
    ThisForm.LockForm
 
PROCEDURE  cmdMsg.Click
    = MessageB ("Test Message")
ENDDEFINE
 
PROCEDURE  decl
    DECLARE INTEGER GetFocus IN user32
    DECLARE INTEGER LockWindowUpdate IN user32 INTEGER hWndLock
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
938 bytes  
Created: 2002-01-18 00:56:49  
Modified: 2002-01-18 01:09:02  
Visits in 7 days: 99  
Listed functions:
GetFocus
LockWindowUpdate
Printer friendly API declarations
My comment:
When the drawing is disabled, whatever you do with controls on this form, you still have its image unchanged. You can still close this form by clicking on the Close button, which image will not change during the click.

This behaviour could possibly be useful for windowing controls (controls with window handles, as OLE controls) to disable their visual update for the time of performing some operations on them, like adding rows etc. Though this is only my assumption, needs to be tested.

And one more interesting thing to test: trying to draw within a locked 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)
7.12 hrs.Example: 'Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window'
 Function: 'SQLConnect'
Function group: 'ODBC API'
8.62 hrs.Example: 'Joining local computer to a domain (XP/2000)'
10.26 hrs.Function: 'JetOpenTable'
11.31 hrs.Example: 'StrDup returns a pointer to the duplicate of a source VFP string'
 Example: 'How to create transparent areas inside a form -- punching holes in the form'
12.09 hrs.Example: 'How to generate GUID values'
15.9 hrs.Function: 'GdipDrawImageRectRectI'
Function group: 'GDI+ Graphics'
 Function: 'LsaFreeMemory'
Function group: 'Security'
16.25 hrs.Example: 'How to make a VFP form fading out when released (GDI+ version)'
Google
Advertise here!