-
Property Sheets
Does anybody have a tutorial on Property Sheets ? i can't find anyone except for MFC, i need win32 api one. Anyway this is what i came out with after reading MSDN propersheety example, but returned a fatal error.
Code:
void DoPropertySheet(HWND hwndOwner)
{
PROPSHEETPAGE psp;
PROPSHEETHEADER psh;
psp.dwSize = sizeof(PROPSHEETPAGE);
psp.dwFlags = PSP_USEHICON;
psp.hInstance = g_hinst;
psp.pszTemplate = MAKEINTRESOURCE(IDD_DIALOG);
psp.pfnDlgProc = DlgProc;
psp.lParam = 0;
psp.pfnCallback = NULL;
psh.dwSize = sizeof(PROPSHEETHEADER);
psh.dwFlags = PSH_USEHICON | PSH_PROPSHEETPAGE;
psh.hwndParent = hwndOwner;
psh.hInstance = g_hinst;
psh.pszCaption = (LPSTR) "Cell Properties";
psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
psh.nStartPage = 0;
psh.ppsp = (LPCPROPSHEETPAGE) &psp;
psh.pfnCallback = NULL;
PropertySheet(&psh);
}
and compiler error returned
Code:
main.obj : error LNK2001: unresolved external symbol __imp__PropertySheetA@4
Debug/Prop.exe : fatal error LNK1120: 1 unresolved externals
Can someone help me out or could anybody do a veri simple property sheet example and show me ? just as a reference, the one MSDN offered is too vague, without resources, nth.
-
>> i can't find anyone except for MFC
Property Sheet Reference
You have to link with comctl32.lib and initialize the common controls DLL: Common Controls
Use the TOC pane on the left for documentation on all the controls.
gg
-
err codeplug, i got my property sheets reference from msdn, and it returned that error to me. can you tell me what does this mean and how should i link it?
Code:
You have to link with comctl32.lib and initialize the common controls DLL: Common Controls
so do i #include <comctl32.lib> or wat ?
-
Hey man, i know how to link to the *lib alreadi. THANZ !! and the property sheet is working fine.
-
Can someone tell me, how to set my dialog position ? I used SetWindowPos and MoveWindow but it didn't work. ( my dialog box is the Parent/Main )
-
>> I used SetWindowPos and MoveWindow but it didn't work.
Can you elaborate? Did the functions fail? What did GetLastError() return?
Once you've added error checking, post the code.
gg
-
CodePlug, i used SetWindowPos becoz they have a flag to restrict the size of my dialog changing and it returned 1402 - INVALID CURSOR HANDLE, what does it mean man.
My code as below.
Code:
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
SetWindowPos(hwnd,HWND_TOP,0,0,0,0,SWP_NOSIZE);
Call(GetLastError(),0);
break;
default:
return FALSE;
}
return TRUE;
}
-
That's not error checking. SetWindowPos() returns a BOOL to indicate success or failure.
That call to SetWindowPos() will position your dialog to the client coordinates (0,0) of the dialog's parent (the desktop in your case) and bring it to the top of the Z-order. Is that what you want to do?
gg
-
yeap, but the function didn't work. I meant the GetLastError() returned 1402