Solved

how to programming Areo style wizard

Posted on 2016-11-04
4
32 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 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

815 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

7 Experts available now in Live!

Get 1:1 Help Now