Well, this would work with normal DbgOut messages, as written in the article.Do you even internet?
You must be registered to see links
inline void DbgOutA (LPCSTR p){
COPYDATASTRUCT cd;
HWND hWnd = ::FindWindow (g_dbgOutwindowClassName, g_dbgOut);
if (hWnd)
{
cd.dwData = 0;
cd.cbData = (strlen(p)+1)*sizeof(char);
cd.lpData = (void *)p;
::SendMessage (hWnd, WM_COPYDATA, 0, (LPARAM)&cd);
}
}
Haha, dont rage bro.
Ton of people out there even don't know how to compile the source code.
I just review some of your posts and I can not find any helpful reply, just rage and scold.
Try to gentle and helpful bro.
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!
OK, but why dafaqshould we use this simple tool instead of AllocConsole() ??!!
Anyway you did smth yourself so its ok that you're able to use your brain.
Cheers
That is an absolutely stupid question.
Logging purposes, to say the least, let alone timestamping and not having to deal with some cheap hack-y method.
A better idea would be to use OutputDebugString(), but that is beyond the scope of this thread.
// Window Proc override
LRESULT CClientDebugOutDlg::WindowProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_COPYDATA:
{
// Dispatch client Message
COPYDATASTRUCT* pcds = (COPYDATASTRUCT*)lParam;
if (pcds->dwData == 0)
{
// convert 8-byte char to 16-byte wchar_t
LPCSTR msg = (LPCSTR)pcds->lpData;
LPCWSTR w_msg = CA2W(msg);
handleClientDbgMessage(w_msg);
}
else if (pcds->dwData == 0xFEFF)
{
// 16-byte char
LPCWSTR msg = (LPCWSTR)pcds->lpData;
handleClientDbgMessage(msg);
}
}
break;
}
// Default Return
return CDialogEx::WindowProc(msg, wParam, lParam);
}
void CClientDebugOutDlg::handleClientDbgMessage(std::wstring message /*alternatively: const wchar_t* message*/)
{
// Handle the message here
}
Or i can release official masang ones, but all the leechers here are too far away from deserve that.
By the level of "tools" released by masang I am kinda confident that everyone here would deserve them... You can't get much lower than masang level.