about LPARAM tranfs to char
hello everybody .
I want to transform LPARAM to char * in this code
LRESULT CALLBACK d3d::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch( msg )
{
case WM_CHAR:
strcpy(mesgg,(LPCTSTR)lParam);
break;
case WM_KEYDOWN:
if( wParam == VK_ESCAPE )
::DestroyWindow(hwnd);
break;
}
return ::DefWindowProc(hwnd, msg, wParam, lParam);
}
but it cant ok.
how can I do it? thanks
If you're using standard windows messaging, lParam is not a character string or even a character. It's a series of flags.
If you want to display the character, that's wParam. But, remember, it's a single character and not a null-terminated string.
You can try:
If you want to display the character, that's wParam. But, remember, it's a single character and not a null-terminated string.
You can try:
case WM_CHAR: mesgg[0]=wParam; mesgg[1]=0;
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement