MSDN如是说:
The LockWindowUpdate function disables or enables drawing in the specified window. Only one window can be locked at a time. 

BOOL LockWindowUpdate(
  HWND hWndLock   // handle to window
);

Parameters
hWndLock 
[in] Specifies the window in which drawing will be disabled. If this parameter is NULL, drawing in the locked window is enabled. 
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero, indicating that an error occurred or another window was already locked. 


通俗的说,就是这个函数把参数---句柄--所关联的窗口锁住了,不再让他继续更新了。
GetDCEx
The GetDCEx function retrieves a handle to a display device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the DC. 

This function is an extension to the GetDC function, which gives an application more control over how and whether clipping occurs in the client area. 

HDC GetDCEx(
  HWND hWnd,      // handle to window
  HRGN hrgnClip,  // handle to clipping region
  DWORD flags     // creation options
);
这个参数比较大,不贴了,大家看MSDN吧
关键在于第三个参数:标志位的设置
前面我们已经知道了,LockWindowUpdate可以锁住某个窗口,如果我们锁住的话,那将不能在这个窗口中进行一切绘制操作(用GetDC,BeginPaint,CreateIC,CreateDC这些API创建的DC都被禁止),比如TextOut也将失效,因为第一个参数是hdc,如果是前面括号中的方式得到的DC,那就失去作用。
然而,GetDCEx却十分例外,如果我们把第三个参数设置成DCX_LOCKWINDOWUPDATE,那即使你把窗口锁住,用此API得到的DC,依然可以对此窗口进行绘制,十分特殊。
最后提醒一点:同一时刻,只能有一个窗口被锁住。
利用反证法比较容易证明此观点:
比如LockWindowUpdate(A);
LockWindowUpdate(B);
那我释放的时候只能用LockWindowUpdate(NULL);//看函数参数介绍,NULL表示释放
那请问此刻释放的是哪个窗口?你能说清楚吗?
因此肯定莫一时刻只能锁住一个窗口。
最后给出一个测试代码吧;防止大家对我本人不放心,毕竟还没转正吗
#include<iostream>
#include<windows.h>
using namespace std;
void main()
{
  TCHAR szAppName[]=TEXT("I love you!!!");
  HWND hwnd=FindWindow(NULL,TEXT("伊锐锐"));
  //HDC hdc=GetDC(hwnd);
  HDC hdc=GetDCEx(hwnd,NULL,DCX_LOCKWINDOWUPDATE);
  LockWindowUpdate(hwnd);
    SetBkMode(hdc,TRANSPARENT);
  TextOut(hdc,0,50,szAppName,lstrlen(szAppName));

  ReleaseDC(hwnd,hdc);
  LockWindowUpdate(hwnd);
}

代码通俗易懂,这里其实我用的就是往QQ聊天窗口中输入I LOVE YOU罢了,相信大家能能看懂。