Solved

how to programming Areo style wizard

Posted on 2016-11-04
4
20 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
  • 3
4 Comments
 
LVL 30

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now