Solved

Problem PropertySheets Controls

Posted on 2000-05-11
2
293 Views
Last Modified: 2013-12-03
When using the PropertySheet Control (form comctl32.dll) the program receives a WM_NOTIFY message when the user presses the "Back", "Next", "Finish" or "Cancel" button. The lParam now points to a struct which can be used to get the type of action the user wants. E.g. PSN_WIZFINISH when the user presses "Finish" and PSN_WIZNEXT when the user presses "Next".
When my program receives a PSN_WIZNEXT or PSN_WIZFINISH the program validates the input given by the user.

My problem now is that when the input is invalid the program should stay on the same dialog and so in that case I return -1 (as the MSDN library describes). But... the program still goes to the next dialog (!?).

How do I fix this problem?
0
Comment
Question by:eelko
2 Comments
 
LVL 15

Accepted Solution

by:
NickRepin earned 100 total points
ID: 2802165
Dialog procedures may return TRUE or FALSE only.

To return result to the notification message, use the following code:


    SetWindowLong(hPropPage,DWL_MSGRESULT,-1);
    return TRUE;
0
 
LVL 2

Author Comment

by:eelko
ID: 2809916
You're right. That was the mistake I made. It now works perfectly!
Thanks.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

808 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