Click here to Skip to main content
13,149,756 members (53,407 online)
Click here to Skip to main content

Stats

539.3K views
3.6K downloads
131 bookmarked
Posted 6 Sep 2001

Add Windows XP Theme Style to your current projects

, 6 Sep 2001
Add Windows XP Theme Style to your current projects
Test
Test.dsp
Test.dsw
xptheme.bin
// Test.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include <commctrl.h>
#include "resource.h"

int CALLBACK DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    switch (uMsg) {

    case WM_INITDIALOG:

        RECT    rc;

        GetWindowRect(hDlg, &rc);

        int     nWidth, nHeight;
        
        nWidth = rc.right - rc.left;
        nHeight = rc.bottom - rc.top;
        
        int     cxScreen, cyScreen;
        
        cxScreen = GetSystemMetrics(SM_CXSCREEN);
        cyScreen = GetSystemMetrics(SM_CYSCREEN);

        MoveWindow(hDlg, (cxScreen - nWidth) / 2, (cyScreen - nHeight) / 2, nWidth, nHeight, TRUE);

        break;

    case WM_COMMAND:

        switch (LOWORD(wParam)) {

        case IDOK:
        case IDCANCEL:

            EndDialog(hDlg, 0);
            return 1;

        }

        break;

    }
    return 0;
}

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    InitCommonControls();
	DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_DIALOG), 0, DlgProc, 0);

	return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Jiang Hong
China China
No Biography provided

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170924.2 | Last Updated 7 Sep 2001
Article Copyright 2001 by Jiang Hong
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid