Hola!
Fíjate lo que dice la MSDN sobre esta API:
GetWindowText
The GetWindowText function copies the text of the specified window's title bar (if it has one) into a buffer. If the specified window is a control, the text of the control is copied. However, GetWindowText cannot retrieve the text of a control in another application.
int GetWindowText(
HWND hWnd, // handle to window or control with text
LPTSTR lpString, // address of buffer for text
int nMaxCount // maximum number of characters to copy
);
Parameters
hWnd: Handle to the window or control containing the text.
lpString: Pointer to the buffer that will receive the text.
nMaxCount: Specifies the maximum number of characters to copy to the buffer, including the NULL character. If the text exceeds this limit, it is truncated.
Si miras tu código, verás que el tercer parámetro debería ser la cantidad de caracteres que quieres copiar como máximo, y tu le estás poniendo 0...
Osea, le estás diciendo que quieres leer 0 caracteres del edit.
Aumentando ese parametro, solucionas la cosa...
Saludos!