user interface - On which occasions exactly is WM_ACTIVATE sent? -


i'm trying debug huge win32 gui application (i have full sources) divided several processes. problem following: in 1 process have dialog listbox, when double-click item in listbox process started creates own window brought front , covers initial dialog. if manipulations (that can't explain yet since don't understand them yet) forces initial dialog start flashing in taskbar.

i tried microsoft spy++ , see whenever manipulation wm_activate sent dialog, of times has these parameters:

factive: wa_inactive fminimized:false hwndprevious:(null) 

and in cases dialog doesn't starts flashing. once in while parameters are

factive: wa_active fminimized:false hwndprevious:(null) 

and precisely corresponds dialog flashing.

msdn says wm_activate sent wa_active when window activated method other mouse click (for example, call setactivewindow function or use of keyboard interface select window).

now in application code setactivewindow() never called , don't keyboard switch windows.

what other reasons possible wm_activate being sent wa_active?

your problem caused setforegroundwindow(). has counter-measures in place prevents process shoving window face of user while she's actively working in app.

the setforegroundwindow() happening when second process creates window , implicitly tries take foreground it. (you said when wrote "brought front".)

the first application should call allowsetforegroundwindow() "it's okay, window allowed take foreground activation me."

note if this, user may run situation:

  • user clicks on list box item.
  • the second process slow start up.
  • the user clicks on else in first application. (lost patience.)
  • the second process steals foreground first application. (user frustrated because in middle of doing else.)

that situation causing blinking in current code. window manager detected user has given waiting second process , started doing else first process, blocks second process when gets around trying steal foreground.


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -