How to close a Property Sheet after deferred Save activity?

"Dick Dievendorff" <[email protected]>
Newsgroups gmane.comp.windows.wtl
Message-ID <003301c9ab5e$40618c20$c124a460$@net>
I have a property sheet and a property page that has some number of edit
controls.  When the user presses OK or Apply I need to write the "dirty"
control values to an external device (via a serial port) when the user
clicks the "Apply" or "OK" buttons.  My routines that send the values to the
external device are asynchronous.  I start a request and when the request is
complete I receive an "event complete" sort of windows message.

 

When I reach OnApply, I'm able to start the asynchronous "save" operation
and respond with PSNRET_INVALID_NOCHANGEPAGE to keep the page from
terminating immediately. 

 

My question is, when I receive the completion message indicating the
completion of my asynchronous activity I want to then close the property
sheet.  

(I'm simplifying this; there are a number of asynchronous messages and
responses, but I can tell when I'm done).

 

I'm also not quite sure in the OnApply method whether the OK or the Apply
button has been clicked; both get me to OnApply.

 

I'm currently issuing PostMessage (GetPropertySheet().m_hWnd, WM_SYSCOMMAND,
SC_CLOSE, 0L); which is like faking the red x at the top right of the
property sheet.  

 

I feel like I'm cheating.  Is there a better way to close the property sheet
once my async work is done?

 

Dick

 



[Non-text portions of this message have been removed]



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.