Cricheditctrl in MSNQQ - Background

xiaoxiao2021-03-06  67

First of all, a title indicate that in the MSN, the chat window may be a custom class. The big house can take a look at SPY .

For your custom window, you can use CreateWindow, SetWindowlong or SubclassWindow, but this is not

It is the topic I am discussing now.

Ok, let's take a look again:

The main thing I achieve is: (1) Font format; (b) hyperlink; (3) background picture; (4) animation expressions

About the background realization, I read an article on Blog, I know that I can't directly handle WM_RASEBKGND. I didn't do this. (If you have no testing, it's easy to believe in others, huh, huh, :))

It is said that hook is needed, or rewrite the WM_PAINT processing function.

Is it horrible? In fact, it is not so horrible.

In fact, it is very simple, the key is Richedit20a

WS_EX_TRANSPARENT this style!

With it, we can create a transparent cricheditctrl, then painted pictures directly in Dialog! This looks like this

Richedit's background, isn't it?

First of all:

1m_chat.createex (WS_EX_TRANSPARENT, "Richedit20a", "", WS_Visible | WS_CHILD |

2 WS_CLIPCHILDREN | WS_VSCROLL | ES_MULTILINE | ES_READONLY |

3 ES_AUTOVSCROLL | ES_LEFT | ES_WANTRETURN, RT, THIS, IDC_CHAT, NULL); we got a transparent Richedit, is it very handsome?

Then you can use two ways to draw form background.

(1) Respond to WM_ERASEBKGND

(2) OnctLColor (CDC * PDC, CWND * PWND, UINT NCTLCOLOR)

There is also a transparent price, and Richedit will not refresh the background, you have to do it yourself. The minimum refresh Rect is the main problem with the discussion.

Save time, don't say more.

转载请注明原文地址:https://www.9cbs.com/read-90670.html

New Post(0)