Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Pocket PC: Folder Viewer
Pocket PC: retrieving data from the Contacts Database
Using the FindMediaType function
Displaying standard progress dialog box when copying files
How to find which fonts Windows uses for drawing captions, menus and message boxes
How to print FoxPro form -- II
Retrieving IP statistics for the computer
Using shared memory to exchange data between two FoxPro applications
Validating the heap of the calling process
How to register custom Event Log source
OS version and revision
Printf-style formatted text output in VFP
Using Beep and Sleep functions to make the old tin buzz sing (WinNT only?)
Enumerating Volumes and Volume Mounting Points (NTFS)
How to display advanced Task Dialog (Vista)
Reading STARTUPINFO structure for the current VFP session
CryptoAPI: retrieving list of providers
Drawing a window caption using the DrawCaption routine
Finding out if the current user is the Guest account
Reading and setting system access privileges for the current process
Enumerating the subkeys of a user-specific key
Obtaining a handle to the desktop associated with the calling thread
Using GetSysColor
Writing entries to custom Event Log
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: 72  
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 (23.20.196.179)
19.73 min.
Function group: 'String'
1.14 hrs.Example: 'Mapping and disconnecting network drives'
 Function: 'UpdateResource'
Function group: 'Resource'
2.78 hrs.Example: 'Retrieving Printer Device Context using PrintDlg function'
2.79 hrs.Example: 'Pocket PC: System Registry Viewer'
3.09 hrs.Function: 'send'
Function group: 'Windows Sockets 2 (Winsock)'
 Example: 'Who owns the Windows Clipboard'
3.82 hrs.
 Function: 'GetVersionEx'
7.94 hrs.Function: 'GetDlgItem'
Google
Advertise here!