CreateWindowEx () Slow On Windows 7 (sometimes)

I'm having pretty bad performance issues on Windows 7 (and probably Vista), with CreateWindowEx () calls.

Some of the windows I create take up a lot more on Windows 7 than XP. Time can reach 15-25 ms, which is very important if you need to create a lot. (The time on XP is constantly 0-2 ms.) Why is this? and what can be done?

All windows are created in one thread. Some of them are built in window classes, some of them are my own. It seems to me that all windows with WS_POPUP [EDIT: and WS_EX_TOOLWINDOW] suffer from this delay, and all windows cannot do this without it. (But the actual reason, of course, may be some other property.) It seems to be applicable to all my windows except for the RICHEDIT_CLASS control, which is the only one that inconsistently fluctuates between 1-30 ms, but only by 7 . Thank!

[EDIT: The application suffers the most from many (~ 300) tooltips created when creating the main window using gToolTip . I could postpone the creation of a tooltip until a window appears, but I have other “evil” windows, and I would still like to understand exactly what’s going on]

UPDATE: My hint issue has been greatly improved. The wrapper class that I used from CodeProject is not suitable [for calling 300 times, once for each control], because it creates a new window for each call. The trick is to create one tooltip (for each popup), and then send only the TTM_ADDTOOL message for each control.

Thus, the performance is significantly improved, but a noticeable lag remains for the rest of the windows ...

+3
source share
2 answers

WS_POPUP, CS_SAVEBITS, WS_VISIBLE.

CS_SAVEBITS (0x0800)

, .... , , .

+2

Aero, XP. , , , .

+1

Source: https://habr.com/ru/post/1774137/


All Articles