Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

how to programming Areo style wizard

Posted on 2016-11-04
4
Medium Priority
?
48 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this modest contribution, I want to share with the IT community (especially system administrators, IT Support Engineers and IT Help Desks) about Windows crashes/hangs and how to deal with these particular problems.
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
Simple Linear Regression
Starting up a Project

618 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