| | |
Pointer to a structure
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
How would I declare a pointer to MINMAXINFO that is passed to WPARAM
In WM_GETMINMAXINFO wParam is a pointer to a place on the stack that holds MINMAXINFO. I've tried and several other variations to no avail.
Thanks
In WM_GETMINMAXINFO wParam is a pointer to a place on the stack that holds MINMAXINFO. I've tried
C++ Syntax (Toggle Plain Text)
MINMAXINFO *Info; Info = MINMAXINFO *wParam;
Thanks
Just cast it the usual way:
Hope this helps.
C++ Syntax (Toggle Plain Text)
LRESULT CALLBACK MyWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { if (uMsg == WM_GETMINMAXINFO) { cout << "Max Window Size is (" << ((LPMINMAXINFO)lParam)->x << ", " << ((LPMINMAXINFO)lParam)->y << ")" << endl; } return DefWindowProc( hWnd, uMsg, wParam, lParam ); }
Thank-you Duoas, my adaptation is as follows and works as expected
C++ Syntax (Toggle Plain Text)
case WM_GETMINMAXINFO: ((LPMINMAXINFO) lParam)->ptMinTrackSize.x = WndInfo.MaxWidth; ((LPMINMAXINFO) lParam)->ptMaxTrackSize.x = WndInfo.MaxWidth; ((LPMINMAXINFO) lParam)->ptMaxTrackSize.y = WndInfo.MaxHeight; ((LPMINMAXINFO) lParam)->ptMinTrackSize.y = WndInfo.MinHeight; break;
I also remebered the way I wanted to do it
I don't believe their is any advantage this way other than less to type and easier to read?
C++ Syntax (Toggle Plain Text)
LPMINMAXINFO Info Info = LPMINMAXINFO (lParam)
![]() |
Similar Threads
- GTK code uses pointer for structs and not normal instances why? (C)
- Help about C++ Array/Pointer/Structure (C++)
- How to delete a data structure in Builder 6.0? (C++)
- Why does my array still empty (C++)
- file pointer increament (C)
- accessing private data members (C++)
Other Threads in the C++ Forum
- Previous Thread: Dating Game
- Next Thread: encrypting text
| Thread Tools | Search this Thread |
api array based binary bitmap c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






