动态调试
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//发送到记事本 | |
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 = str.at(i); | |
::PostMessage( childhandle, 0x102, x, 1 ); | |
} | |
::PostMessage( childhandle, 0x102, 0x0d, 1 ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef _DEBUG | |
#define MYTRACE DbgStrOut | |
#else | |
#define MYTRACE | |
#endif | |
#define OUTPUT_BUFF_LEN 512 | |
void DbgStrOut(const TCHAR *fmt, ...) | |
{ | |
TCHAR szOutStr[OUTPUT_BUFF_LEN]; | |
va_list ap; | |
va_start(ap, fmt); | |
StringCbVPrintf(szOutStr, OUTPUT_BUFF_LEN, fmt, ap); | |
va_end(ap); | |
OutputDebugString(szOutStr); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment