Skip to content

Instantly share code, notes, and snippets.

Created July 2, 2011 11:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
void SendPad( string str )
//std::wstring wstr(str.begin(),str.end());
//_ReportTip( wstr, -1 );
HWND childhandle = NULL;
HWND npad = ::FindWindowA("NOTEPAD",NULL);
if (npad)
POINT pt; pt.x=0x14, pt.y=0x14;
childhandle = ::ChildWindowFromPoint(npad, pt);
for ( int i=0; i< (int)(str.size()); ++i)
unsigned long x =;
::PostMessage( childhandle, 0x102, x, 1 );
::PostMessage( childhandle, 0x102, 0x0d, 1 );
#ifdef _DEBUG
#define MYTRACE DbgStrOut
#define MYTRACE
#define OUTPUT_BUFF_LEN 512
void DbgStrOut(const TCHAR *fmt, ...)
va_list ap;
va_start(ap, fmt);
StringCbVPrintf(szOutStr, OUTPUT_BUFF_LEN, fmt, ap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment