?
Solved

how to programming Areo style wizard

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

A small collection of useful tips and tricks for Windows 10 users that I decided to write as a result of recent questions that were asked and answered at Experts Exchange. Two short video tutorials included. Enjoy..
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
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…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

764 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