Solved

how to programming Areo style wizard

Posted on 2016-11-04
4
39 Views
Last Modified: 2016-11-15
I have sample code from MS for areo style Wizard, I do not know how to customize some of the buttons, say, I need to change button text for cancel, remove button next, or even ownerdraw those buttons, I do not know how to do it.

I have use spy to looking into the window, I find that the button is not simple, it has 2 layers of window, and I find ID for those buttons are all 0, so I do not know how to do it.

Does any one has experience working on Areo style of Wizard?

Thanks for any help.

Evan
0
Comment
Question by:Evan Li
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 31

Expert Comment

by:Zoppo
ID: 41875400
Hi Evan Li,

could you post the link from where you got the sample cpde?

In what kind of application do you want to use it, managed C#/C++, unmanaged C++ with or without MFC, anything else ...?

Best regards,

ZOPPO
0
 

Author Comment

by:Evan Li
ID: 41875785
https://1drv.ms/u/s!Aj_4C3yAj7IOguNTs_37UvjNAkX9Ww
I have share the file, this is from Microsoft SDK. I need to be able to customize the buttons. Thank you for your help.
0
 

Accepted Solution

by:
Evan Li earned 0 total points
ID: 41881419
OK, After some research I have following solution:

This is the function to find button window handle:

HWND FindButton(HWND hdlg, TCHAR *ptr)
{
      HWND hSheet = GetParent(hdlg);
      hSheet = GetParent(hSheet);

      HWND hchild = NULL;
      do
      {
            TCHAR szTitle[100];
            hchild = FindWindowEx(hSheet, hchild, "CtrlNotifySink", NULL);

            HWND hButton = NULL;
            if (hchild)
            {
                  hButton = FindWindowEx(hchild, hButton, "Button", NULL);
                  auto lID = GetWindowLongPtr(hButton, GWLP_ID);
                  GetWindowText(hButton, szTitle, 100);
                  if (!strcmp(szTitle, ptr))
                  {
                        return hButton;
                  }
            }
            else
            {
                  break;
            }

      } while (true);
      return NULL;
}

When add following lines under message WM_NOTIFY, PSN_SETACTIVE:


                        TCHAR szBtnName[] = "&Next";
                        HWND hWndBtn = FindButton(hwndDlg, szBtnName);
                        SetWindowText(hWndBtn, "Changed");

As ID for the buttons are 0, we can only use button text as ID, which means we need to change the text ID when the language changed, this can be always digged out.

Thanks Zoppo for your help.
0
 

Author Closing Comment

by:Evan Li
ID: 41887621
I have found the solution myself.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This article summaries thoughts and ideas from two years of sustained use. It provides good reasoning to make the jump to Windows 10.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question