G
Guest
Hi!
If more than one notepad is opened in desktop.. then its work for "top"
notepad only
Want to ... write a data in specfic .txt file. for example abc.txt, but if
"top.txt" is at top at desktop then, the data is written in top.txt.... not
in abc.txt.
code: working for only when one notepad is opend / for top notepad at desktop
HWND hNotepad, hEdit;
hNotepad = ::FindWindow("Notepad",NULL);
hEdit = ::FindWindowEx(hNotepad, NULL,"edit", NULL);
int iLength = (int)::SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0);
::SendMessage(hEdit, WM_GETTEXT, iLength+1, (LPARAM)textData);
CString temp = textData;
temp += "\r\n";
temp += "MFC";
::SendMessage(hEdit, WM_SETTEXT,0,(LPARAM)textData);
I had try..... ( Not working.. if more then one / abc.txt is not at top in
desktop)
hNotepad = ::FindWindow("Notepad","abc.txt");
hNotepad = ::FindWindow("Notepad","abc");
HWND FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName); //syntax
If the lpWindowName parameter is not NULL, FindWindow calls the
GetWindowText function to retrieve the window name for comparison.
GetWindowText cannot retrieve the text of a control in another application.
How to select specfic txt file... if more then one is opened!
I want to write the data in specfic file that i supply in program
If more than one notepad is opened in desktop.. then its work for "top"
notepad only
Want to ... write a data in specfic .txt file. for example abc.txt, but if
"top.txt" is at top at desktop then, the data is written in top.txt.... not
in abc.txt.
code: working for only when one notepad is opend / for top notepad at desktop
HWND hNotepad, hEdit;
hNotepad = ::FindWindow("Notepad",NULL);
hEdit = ::FindWindowEx(hNotepad, NULL,"edit", NULL);
int iLength = (int)::SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0);
::SendMessage(hEdit, WM_GETTEXT, iLength+1, (LPARAM)textData);
CString temp = textData;
temp += "\r\n";
temp += "MFC";
::SendMessage(hEdit, WM_SETTEXT,0,(LPARAM)textData);
I had try..... ( Not working.. if more then one / abc.txt is not at top in
desktop)
hNotepad = ::FindWindow("Notepad","abc.txt");
hNotepad = ::FindWindow("Notepad","abc");
HWND FindWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName); //syntax
If the lpWindowName parameter is not NULL, FindWindow calls the
GetWindowText function to retrieve the window name for comparison.
GetWindowText cannot retrieve the text of a control in another application.
How to select specfic txt file... if more then one is opened!
I want to write the data in specfic file that i supply in program