| | |
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 arrays based beginner binary bitmap c++ c/c++ calculator char char* class code coding compile compiler console conversion count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings struct temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






