[VB.NET]vb.net 系统最小化消息是什么?

前端之家收集整理的这篇文章主要介绍了[VB.NET]vb.net 系统最小化消息是什么?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
vb.net 系统最小化消息是什么? Protected Overrides Sub WndProc(ByRef m As Message) If (m.WParam.ToInt32 = 126722) Then //系统最小化消息是什么? MsgBox( 最喜爱 ) Else MyBase.WndProc(m) End If End Sub __________________________________________________________________________ 61472 ***************************************************************************** 欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 最新版本:20070212 http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html __________________________________________________________________________ 谢谢!你是怎么查到的?授渔吧,谢谢! __________________________________________________________________________ Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) If (m.Msg = &H112) Then If (m.WParam = &HF020) Then Console.WriteLine( 最小化按钮点击了 ) ElseIf (m.WParam = &HF030) Then Console.WriteLine( 最大化按钮点击了 ) ElseIf (m.WParam = &HF060) Then Console.WriteLine( 关闭按钮点击了 ) End If End If MyBase.WndProc(m) __________________________________________________________________________ 这是定义好的 http://doc.ddart.net/msdn/header/include/winuser.h.html __________________________________________________________________________ 教教我怎么查吧,我想知道窗体从最小化到窗体重现在屏幕上的消息是什么? __________________________________________________________________________ 最小化的消息是SC_MINIMIZE __________________________________________________________________________ 用 SC_MINIMIZE 要 imports 什么? __________________________________________________________________________ 不需要imports , 你需要自己定义一个常量 Private Const SC_MINIMIZE = &HF020& If (m.WParam = SC_MINIMIZE) Then Console.WriteLine( 最小化按钮点击了 ) __________________________________________________________________________ feiyun0112 最小化的消息是SC_MINIMIZE =================================================== 会变量未定义 ,要 import 什么? __________________________________________________________________________ 那在 VC 中 有 SC_MINIMIZE 这常量定义 。vb中不能引用吗? __________________________________________________________________________ 你参考下面的代码,常用常数: Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message) Dim SC_ARRANGE As Integer = &HF110 Dim SC_CLOSE As Integer = &HF060 Dim SC_HOTKEY As Integer = &HF150 Dim SC_HSCROLL As Integer = &HF080 Dim SC_KEYMENU As Integer = &HF100 Dim SC_MAXIMIZE As Integer = &HF030 Dim SC_MINIMIZE As Integer = &HF020 Dim SC_MOUSEMENU As Integer = &HF090 Dim SC_MOVE As Integer = &HF010 Dim SC_NEXTWINDOW As Integer = &HF040 Dim SC_PREVWINDOW As Integer = &HF050 Dim SC_RESTORE As Integer = &HF120 Dim SC_SCREENSAVE As Integer = &HF140 Dim SC_SIZE As Integer = &HF000 Dim SC_TASKLIST As Integer = &HF130 Dim SC_VSCROLL As Integer = &HF070 If (m.Msg = &H112) Then If (m.WParam = SC_MINIMIZE) Then Console.Write( 最小化按钮点击了 ) ElseIf (m.WParam = SC_MAXIMIZE) Then Console.Write( 最大化按钮点击了 ) ElseIf (m.WParam = SC_CLOSE) Then Console.Write( 关闭按钮点击了 ) ElseIf (m.WParam = SC_RESTORE) Then Console.Write( 还原按钮点击了 ) End If Console.WriteLine(m) End If MyBase.WndProc(m) End Sub __________________________________________________________________________ 但你们用 Dim SC_CLOSE As Integer = &HF060 这样常数,操作系统变了怎么办? __________________________________________________________________________ 一般是不会变啦,这是微软定义好的 就算变啦,只要该这个常数就可以拉 __________________________________________________________________________ 常数 是不会变的,不会变的才叫常数:) __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/263619.html

猜你在找的VB相关文章