interprocess messages

Dimitrie O. Paun dpaun at rogers.com
Fri Sep 27 14:01:26 CDT 2002


Hi folks,

As I was browsing aimlessly (not quite, but for the purpose of the
story, it'll do :)) through windows/win.c, I run into this:


/*******************************************************************
 *              GetWindowTextW (USER32.@)
 */
INT WINAPI GetWindowTextW( HWND hwnd, LPWSTR lpString, INT nMaxCount )
{
    if (WIN_IsCurrentProcess( hwnd ))
        return (INT)SendMessageW( hwnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString );

    /* when window belongs to other process, don't send a message */
    if (nMaxCount <= 0) return 0;
    get_server_window_text( hwnd, lpString, nMaxCount );
    return strlenW(lpString);
}

My question is: shouldn't we alwas call WM_GETTEXT here, and do the
switch between current process/other process in the lower levels?

What if the application sends the WM_GETTEXT message, and bypasses
the GetWindowTextW? Then it wouldn't work, right? Just curious how
all these are gonna play out...

-- 
Dimi.




More information about the wine-devel mailing list