Can you help me to transfer that code to C#?
HWND Notepad = FindWindowEx( GetDesktopWindow( ), 0, "Notepad", 0 );
SendMessage( GetDlgItem( Notepad, MB_TYPEMASK ), WM_SETTEXT, 0, (LPARAM)"Hello Notepad, what's up?" );
Thank you in advance
UPDATE:
I want to send key presses to background window.
I don’t want to use SendKeys.Send because I want that window to be in background.
SendKeys requires that window is active.
As far as I know such a low level funcionality is not available in WinForms, hence you should call WinApi via pinvoke which will result in almost literal rewrite of this code to c#
Start here
GetDlgItem
GetDesktopWindow
FindWindowEx