コード例 #1
0
ファイル: intl.c プロジェクト: RPG-7/reactos
static LONG APIENTRY
Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
{
    PROPSHEETPAGE psp[3];
    PROPSHEETHEADER psh;
    TCHAR Caption[BUFFERSIZE];

    if (OpenSetupInf())
    {
        ParseSetupInf();
    }

    LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));

    ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
    psh.dwSize = sizeof(PROPSHEETHEADER);
    psh.dwFlags =  PSH_PROPSHEETPAGE | PSH_PROPTITLE;
    psh.hwndParent = hCPLWindow;
    psh.hInstance = hApplet;
    psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
    psh.pszCaption = Caption;
    psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE);
    psh.nStartPage = 0;
    psh.ppsp = psp;

    InitPropSheetPage(&psp[0], IDD_GENERALPAGE, GeneralPageProc);
    InitPropSheetPage(&psp[1], IDD_LANGUAGESPAGE, LanguagesPageProc);
    InitPropSheetPage(&psp[2], IDD_ADVANCEDPAGE, AdvancedPageProc);

    return (LONG)(PropertySheet(&psh) != -1);
}
コード例 #2
0
ファイル: intl.c プロジェクト: amaneureka/reactos
static LONG APIENTRY
Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
{
    TCHAR Caption[BUFFERSIZE];
    PROPSHEETPAGE psp[3];
    PROPSHEETHEADER psh;
    PGLOBALDATA pGlobalData;
    LONG ret;

    if (OpenSetupInf())
    {
        ParseSetupInf();
    }

    pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBALDATA));
    if (pGlobalData == NULL)
        return FALSE;

    pGlobalData->SystemLCID = GetSystemDefaultLCID();
    pGlobalData->bIsUserAdmin = IsUserAdmin();

    LoadString(hApplet, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));

    ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
    psh.dwSize = sizeof(PROPSHEETHEADER);
    psh.dwFlags =  PSH_PROPSHEETPAGE;
    psh.hwndParent = hCPLWindow;
    psh.hInstance = hApplet;
    psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
    psh.pszCaption = Caption;
    psh.nPages = 0; //sizeof(psp) / sizeof(PROPSHEETPAGE);
    psh.nStartPage = 0;
    psh.ppsp = psp;

    InitIntlPropSheetPage(&psp[0], IDD_GENERALPAGE, GeneralPageProc, (LPARAM)pGlobalData);
    psh.nPages++;
    InitIntlPropSheetPage(&psp[1], IDD_LANGUAGESPAGE, LanguagesPageProc, (LPARAM)pGlobalData);
    psh.nPages++;

    if (pGlobalData->bIsUserAdmin)
    {
        InitIntlPropSheetPage(&psp[2], IDD_ADVANCEDPAGE, AdvancedPageProc, (LPARAM)pGlobalData);
        psh.nPages++;
    }

    ret = (LONG)(PropertySheet(&psh) != -1);

    HeapFree(GetProcessHeap(), 0, pGlobalData);

    return ret;
}