Jan 27, 2011 at 4:39pm Jan 27, 2011 at 4:39pm UTC
I am simply trying to change the text of an open window, in this case notepad.
The text of notepad gets changed but to chinese characters, not the english characters. I have this working in VB but cannot figure it out in c++. I am using VS2010.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include <iostream>
#include <Windows.h>
#include <string>
using namespace std;
int main()
{
::HWND notepad = ::FindWindowW(NULL, L"Untitled - Notepad" );
::SendMessage(notepad,WM_SETTEXT,0,(LPARAM)"Message Recieved" );
return 0;
}
Thank you,
Mike
also, what are the valid datatypes to use as LPARAM.
Last edited on Jan 27, 2011 at 4:41pm Jan 27, 2011 at 4:41pm UTC
Jan 27, 2011 at 5:28pm Jan 27, 2011 at 5:28pm UTC
Have you tried:
(LPARAM)L"Message Recieved"
Last edited on Jan 27, 2011 at 5:31pm Jan 27, 2011 at 5:31pm UTC
Jan 28, 2011 at 2:00am Jan 28, 2011 at 2:00am UTC
thank you guestgulkan, that L was the fix.
Jan 28, 2011 at 2:03am Jan 28, 2011 at 2:03am UTC
freddie, with yours I still had to insert the L before the strings but that works too.
Thanks Guys