DO decl
PUBLIC objForm
objForm = CreateObject("TForm")
objForm.Visible = .T.
DEFINECLASS TForm AsFORMCaption = "Disabling drawing in the form"Width=400Height=250AutoCenter = .T.
ADD OBJECT cmdLock AsCommandButtonWITH;
Left=10, Top=15, Width=80, Height=24,;
Caption="Lock"ADD OBJECT cmdMsg AsCommandButtonWITH;
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 automaticallyThisForm.Movable = .F.
* locking the window
= LockWindowUpdate(hWindow)PROCEDURE cmdLock.ClickThisForm.LockFormPROCEDURE cmdMsg.Click
= MessageB ("Test Message")ENDDEFINEPROCEDURE decl
DECLAREINTEGER GetFocus IN user32
DECLAREINTEGER LockWindowUpdate IN user32 INTEGER hWndLock
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.
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.