Hi guys,

Im currently writing a stock handling program for a company that deals with recycling computers for 3rd world countries.
However im having a bit of trouble with the property windows of my 'Add new stock' wizard.
I cant seem to prevent a change to the next tab. (When required data is not entered for example.)

~This is my notify code so far.... (Buillt from an example)

mov eax,uMsg
.if eax==WM_NOTIFY
mov edx,lParam
mov eax,NMHDR.code
.if eax==PSN_SETACTIVE ; page gaining focus
m2m hPropSheet,NMHDR.hwndFrom
__ PostMessage,hPropSheet,PSM_SETWIZBUTTONS,0,PSWIZB_FINISH or PSWIZB_BACK
__ SetWindowLong,hWin,DWL_MSGRESULT,0
.elseif eax==PSN_KILLACTIVE
;page loosing focus
__ SetWindowLong,hWin,DWL_MSGRESULT,0
.elseif eax==PSN_WIZFINISH

.elseif eax==PSN_RESET
;Add own cancel code here
.endif


Im missing a vital peice of information here i think. Please help. :)
Posted on 2006-12-05 19:14:19 by Nice Eddie
Doh!
Ive done it again!  :lol:

Answer is use

__ SetWindowLong,hWin,DWL_MSGRESULT,TRUE

when conditions aren't met.
The Property sheet will ignore users button  press and you can throw up a messagebox like this

__ MessageBox,hWin,"Please try again","Error stock number not entered correctly",MB_ICONERROR

Thx anyways guys
Posted on 2006-12-05 19:35:46 by Nice Eddie
Why not disable the "next" button until valid data is entered?
Posted on 2006-12-06 08:32:37 by f0dder
thanks fodder

Im using your method now , its smarter.

thanks
Posted on 2006-12-09 13:00:44 by Nice Eddie