菜鸟又一问,关于类名的!谢谢!(100分)

  • 主题发起人 主题发起人 monkeyking1983
  • 开始时间 开始时间
M

monkeyking1983

Unregistered / Unconfirmed
GUEST, unregistred user!
在用工具取得类名的时候经常出现一些这样的类名,
如MyIE 的是 afx40000:8:10011:0:10c01c5
oicq 的是 #32770
哪位大狭可以给我解释一下,再讲解如何利用这样的类名
非常感谢!
 
VC写的程序,《深入浅出MFC》里面有讲:

奇怪的窗口类名称Afx:b:14ae:6:3e8f
用Spy++(VC++所附的一个工具)观察窗口类的名称时,会发现窗口类名称变成像Afx:b:14ae:6:3e8f这副奇怪的模样?

原来是Application Framework 把窗口类的名称转换为Afx:: x :y :z :w的类型,成为独一无二的窗口类型名称:

x:窗口风格的hex值

y:窗口鼠标光标的hex值

z:窗口后台颜色的hex值

w:窗口图标的hex值

 
很感谢zw84611的解释,可是如何利用他们呢?
 
和普通的类名一样用。

procedure TForm1.Button9Click(Sender: TObject);
var
h: HWND;
begin
h:=FindWindow('afx:400000:8:10011:0:33051b',nil); //我这里的类名是这样,你照你的改一下。
if h <> 0 then
begin
PostMessage(h,WM_CLOSE,0,0); //发送一个关闭窗口的消息
end
else ShowMessage('MyIE not find');
end;
 
那OICQ 的#32770 又怎么解释和使用呢?
 
用VC写的对话框程序类名都是#32770

System Classes
The system registers the system classes for all processes to use. Any process
can use a system class at any time. Because the system registers these classes, a process cannot destroy them.

Each Win32-based application receives its own copy of the system classes. All
16-bit Windows-based applications in the same VDM share system classes, just
as they do on 16-bit Windows.

The following table describes the system classes:

Class Description
Button The class for a button.
ComboBox The class for a combo box.
ComboLBox The class for the list box contained in a combo box.
DDEMLEvent Windows NT: The class for DDEML events.
Edit The class for an edit control.
ListBox The class for a list box.
MDIClient The class for an MDI client window.
Message Windows NT 5.0 and later: The class for a message-only window.
ScrollBar The class for a scroll bar.
Static The class for a static control.
#32768 The class for a menu.
#32769 The class for the desktop window.
#32770 The class for a dialog box.
#32771 The class for the task switch window.
#32772 Windows NT: The class for icon titles.

至于使用,和上面的一样。
 
接受答案了.
 
后退
顶部