Prev: dhSqliteDemo
Next: Scientific to Decimal
From: Rick Raisley on 30 Nov 2009 14:18 I'm embarrassed to ask this, but things aren't working quite as I expected. I want to run some non-trivial code (non-trivial here means it can take a bit of time to do) whenever a user goes back to my running program. Basically, he could have changed the document loaded in another (non-VB) program, and I want to see if that has happened, and if so, get information on the active document from that program. Anyhow, I thought that the Form_Activate event might work, or Form_GotFocus, but both of those don't fire when the form isn't changed (this simple program only has one form). Form_Paint works, but fires hundreds of times, so is not what I want. What can I use to determine that the user has gone back to my running app, and as he/she may have changed the document in the other app, I would then do a check to see if it's changed? -- Regards, Rick Raisley heavymetal-A-T-bellsouth-D-O-T-net
From: Nobody on 30 Nov 2009 15:19 Not sure if there is an easier way, but lookup WM_ACTIVATEAPP.
From: Jeff Johnson on 30 Nov 2009 15:24 "Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet> wrote in message news:u9sJyHfcKHA.5796(a)TK2MSFTNGP06.phx.gbl... > What can I use to determine that the user has gone back to my running app, > and as he/she may have changed the document in the other app, I would then > do a check to see if it's changed? http://vbnet.mvps.org/code/subclass/activation.htm
From: Rick Raisley on 30 Nov 2009 16:13 <shudder>subclassing</shudder> I think I'm subclassing challenged. I avoid it like the plague, probably because of the IDE crashing problems when breaking to change code (which I do /all/ the time). If that's the only way, I'm afraid I'll have to leave this feature out. :-( -- Regards, Rick Raisley heavymetal-A-T-bellsouth-D-O-T-net "Jeff Johnson" <i.get(a)enough.spam> wrote in message news:%23O57psfcKHA.2184(a)TK2MSFTNGP04.phx.gbl... > "Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet> wrote in message > news:u9sJyHfcKHA.5796(a)TK2MSFTNGP06.phx.gbl... > >> What can I use to determine that the user has gone back to my running >> app, and as he/she may have changed the document in the other app, I >> would then do a check to see if it's changed? > > http://vbnet.mvps.org/code/subclass/activation.htm >
From: Bob Butler on 30 Nov 2009 16:23
"Rick Raisley" <heavymetal-A-T-bellsouth-D-O-Tnet> wrote in message news:eO8b8HgcKHA.612(a)TK2MSFTNGP06.phx.gbl... > <shudder>subclassing</shudder> > > I think I'm subclassing challenged. I avoid it like the plague, probably > because of the IDE crashing problems when breaking to change code (which I > do /all/ the time). > > If that's the only way, I'm afraid I'll have to leave this feature out. > :-( Code it so the subclassing is only done when the app is not running in the IDE and/or get used to saving often! |