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. :)
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. :)
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
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
Why not disable the "next" button until valid data is entered?
thanks fodder
Im using your method now , its smarter.
thanks
Im using your method now , its smarter.
thanks