Kbase 17677: How to Call WIN32 API Function: LockWindowUpdate
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to Call WIN32 API Function: LockWindowUpdate
DISCLAIMER:
===========
The code example in this knowledgebase is for informational purposes
only. If you have specific questions about which API calls would be
best suited to your design goals, please consult your Microsoft
documentation.
INTRODUCTION:
=============
The following sample code shows how to call the Win32 API function
called LockWindowUpdate. This function temporarily disables updates
within the specified window. Only one window can be locked at one
time. While a window is locked, Windows discards any drawing done
in a device context associated with the window. Windows does
accumulate a bounding rectangle of any drawing that is done. Once the
window is unlocked, Windows invalidates the accumulated rectangle,
which will eventually cause a WM_PAINT message to be sent to the
window. To unlock the window, specify a value of NULL (zero) for the
window handle.
This code has been tested on Windows NT 4.0 Workstation only.
DEFINE VARIABLE intRC AS INTEGER NO-UNDO.
PROCEDURE LockWindowUpdate EXTERNAL "USER32.DLL":
DEFINE INPUT PARAMETER intWindowHwnd AS LONG NO-UNDO.
DEFINE RETURN PARAMETER intResult AS LONG NO-UNDO.
END PROCEDURE.
/* Assume Window Has Been Defined And Created At This Point */
RUN LockWindowUpdate (INPUT {&WINDOW-NAME}:HWND, OUTPUT intRC).
IF intRC = 0 THEN
DO:
MESSAGE "Lock of Window Failed" VIEW-AS ALERT-BOX.
RETURN.
END.
/* Lots Of Widget Manipulation Happens At This Point */
RUN LockWindowUpdate (INPUT 0, OUTPUT intRC).
IF intRC = 0 THEN
DO:
MESSAGE "Unlock of Window Failed" VIEW-AS ALERT-BOX.
RETURN.
END.
Progress Software Technical Support Note # 17677