Sicuro che il problema stia nella SendMessage? Posta il resto del codice che usi per individuare l'HWND che ti interessa.