What am I doing wrong (API stuff) SOLUTION (almost)
Here is the code. In order to make this work, I needed to access the child
window within NOTEPAD. This child window is called (or is of the class?)
'Edit'. I get it's handle by calling FindWindowEx. Sending the message is
no problem.
The next step now is to figure out how to access the menus of NOTEPAD.EXE.
For example, I want to send an <ALT-F> to open the file menu. This is what
I have not been able to figure out.
Msg := 'f';
ProgramPath := StrAlloc(256);
StrPCopy(ProgramPath, '\windows\notepad.exe');
ShellExecute(0,nil,ProgramPath,nil,nil,SW_SHOWNORMAL);
MyHandle := FindWindow('Notepad',nil);
MyHandle := FindWindowEx(MyHandle,0,'Edit',nil);
SetForegroundWindow(MyHandle);
Result:=PostMessage(MyHandle,WM_CHAR,Word(Msg),0);
--
Joseph I. Ceasar (Yossi)
CLS Computer Solutions