News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Loses Focus msg?

Started by Mark Jones, August 19, 2005, 03:58:14 PM

Previous topic - Next topic

Mark Jones

Is there a message for "control loses focus?" I'm shadowing all of my controls' values into a struct and would like to update each member as the mouse leaves each control (rather than updating all of them when any control is changed.) Any ideas? Is subclassing the only answer?
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Tedd

WM_KILLFOCUS is sent to a window just before it loses focus.
Is that what you mean?
No snowflake in an avalanche feels responsible.

ramguru

I used "TrackMouseEvent" to make my 3 state (up enter/leave down) button in WM_MOUSEMOVE msg.

Mark Jones

I'm hoping for a "WM_LOSESFOCUS" message but there doesn't appear to be anything like this. Basically I have a window with some controls on it (edit boxes, checkboxes, etc.) and I have all their states and values shadowed into a struct. This makes it easy to save and restore the state of all controls, simply by using Get/WritePrivateProfileStruct to an .ini file. But in my current implementation, all the controls are copied to the structure whenever the window loses focus (on WM_ACTIVATE message.) But if I change one value then press the "go" button lets say, the changed value has not been updated in the shadow struct yet, so errors occur. What I want to do it catch some message when the mouse or focus leaves each individual control - so that the control losing focus can have it's new value copied into the shadow struct. :) Hope I made that clear enough. It's kinda hard to explain and a nightmare to look at as code. :)
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Tedd

Hmm... looks like it's gonna be subclassing or the parent tracking the mouse for each individual component. :bdg
I think subclassing would be better; especially if it's mostly only for edit boxes(?)
No snowflake in an avalanche feels responsible.