Sign in to follow this  

PropertyGrid / PropertySheet

Recommended Posts

Hi everyone,

I'm currently making a scene editor with c++ and winapi.

I'd like to make a property grid / sheet in native c++ like in c# (or like in the Visual Studio, the Property Window). I've searched by google and I've found that the PROPSHEETHEADER and the PROPSHEETPAGE are the only (?) way.
I have a main window and I have a groupbox in it. I'd like to put my property sheet into that box (I know the handle of the gb). Here is my first try:
void PropertyGrid::CreateDummy(const HWND& _parent)
HINSTANCE hInstance = (HINSTANCE)GetWindowLong(_parent, GWL_HINSTANCE);

memset(&propSheet, 0, sizeof(PROPSHEETHEADER));
memset(pages, 0, sizeof(pages));

pages[0].dwSize = sizeof(PROPSHEETPAGE);
pages[0].dwFlags = PSP_DEFAULT;
pages[0].hInstance = hInstance;
pages[0].pszTitle = "page 1";

propSheet.dwSize = sizeof(PROPSHEETHEADER);
propSheet.dwFlags = PSH_PROPSHEETPAGE;
propSheet.hwndParent = _parent;
propSheet.hInstance = hInstance;
propSheet.nPages = sizeof(pages) / sizeof(PROPSHEETPAGE);
propSheet.ppsp = (LPCPROPSHEETPAGE)pages;

int ret = PropertySheet(&propSheet);
I want to see an empty property grid, but I can't see anyting.

I hope you could help me,

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this