| | |
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 |
Tag cloud for C++
api application array arrays assignment beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator getline givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multidimensional multiple newbie news node number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets






