Using Win32 functions in Visual FoxPro Image Gallery
Painting and Drawing
..msdn
DrawAnimatedRects
DrawCaption
DrawEdge
DrawFrameControl
GdiFlush
GdiGetBatchLimit
GdiSetBatchLimit
GetBkMode
GetBoundsRect
GetWindowDC
GetWindowRgnBox
LockWindowUpdate
PaintDesktop
SetBkColor
SetBkMode
SetWindowRgn
WindowFromDC
Code examples:
Disabling drawing in the VFP form
How to position the GETPRINTER() dialog
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: 28  
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-2010 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.0.85), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Google
Advertise here!