×

releasecapture

改写扫雷游戏,增加鼠标功能?Vb 怎么调用IE

admin admin 发表于2022-06-13 08:50:18 浏览126 评论0

抢沙发发表评论

改写扫雷游戏,增加鼠标功能


void CMineWnd::OnLButtonDown(UINT nFlags, CPoint point)
{
//按钮所在的区域
CRect rcBtn(m_uBtnRect, 15, m_uBtnRect, 39);
//雷区所在的区域
CRect rcMineArea(MINE_AREA_LEFT, MINE_AREA_TOP,
MINE_AREA_LEFT + m_uXNum * MINE_WIDTH, MINE_AREA_TOP + m_uYNum * MINE_HEIGHT);

SetCapture(); // capture the mouse cursor
m_bClickBtn = FALSE;
m_bLRBtnDown = FALSE;

if (rcBtn.PtInRect(point))
{// click in the button area
m_bClickBtn = TRUE;
m_uBtnState = BUTTON_DOWN;
InvalidateRect(rcBtn);
}
else if (rcMineArea.PtInRect(point))
{// click in the mine area
// change mine state by gamestate
switch(m_uGameState)
{
case GS_WAIT: case GS_RUN:
m_pNewMine = GetMine(point.x, point.y);
if (!m_pNewMine) return;
if (m_pNewMine-》uState == STATE_NORMAL)
{
m_pNewMine-》uState = STATE_EMPTY;
}
if (m_pNewMine-》uState == STATE_DICEY)
{
m_pNewMine-》uState = STATE_DICEY_DOWN;
}
m_pOldMine = m_pNewMine;
break;
case GS_DEAD: case GS_VICTORY:
return;
break;
default :
break;
}
m_uBtnState = BUTTON_CLICK;
InvalidateRect(rcBtn);
// both of the left button and the right button are pushing down
if (nFlags == (MK_LBUTTON | MK_RBUTTON))
{
m_bLRBtnDown = TRUE;
OnLRBtnDown(m_pOldMine-》uRow, m_pOldMine-》uCol);
}
InvalidateRect(rcMineArea);
}
else
{ // click in other area
if (m_uGameState == GS_WAIT || m_uGameState == GS_RUN)
{
m_uBtnState = BUTTON_CLICK;
InvalidateRect(rcBtn);
}
}

CWnd::OnLButtonDown(nFlags, point);
}

void CMineWnd::OnLButtonUp(UINT nFlags, CPoint point)
{
//笑脸图按钮所在的区域
CRect rcBtn(m_uBtnRect, 15, m_uBtnRect, 39);
//雷区所在的区域
CRect rcMineArea(MINE_AREA_LEFT, MINE_AREA_TOP,
MINE_AREA_LEFT + m_uXNum * MINE_WIDTH,
MINE_AREA_TOP + m_uYNum * MINE_HEIGHT);

if (rcBtn.PtInRect(point))
{// 点击笑脸图

Invalidate();
InitGame();
}
else if (rcMineArea.PtInRect(point))
{//点击雷区域
CString value;
UINT around = 0;

//根据不同的游戏状态作处理
switch(m_uGameState)
{
//游戏进行状态
case GS_WAIT: case GS_RUN:
// first get the MINEWND which if pushing down
m_pOldMine = GetMine(point.x, point.y);
if (!m_pOldMine)
{
ReleaseCapture();
return;
}
// do normal process
// judge whether the lr button are both pushed down
//检测判断当前状态是否为左右鼠标同时按下
if (m_bLRBtnDown)
{
m_bLRBtnDown = FALSE;
OnLRBtnUp(m_pOldMine-》uRow, m_pOldMine-》uCol);
if (m_uGameState == GS_WAIT)
{
m_uBtnState = BUTTON_NORMAL;
Invalidate();
ReleaseCapture();
return;
}
// if the around flags number equal to the around mines number, expand.
//假若周围已经标识的雷=周围真正的雷数,拓展
if (m_pOldMine-》uState != STATE_FLAG)
{
OpenAround(m_pOldMine-》uRow, m_pOldMine-》uCol);
}
// check whether the MINEWND around the special MINEWND is a mine, if it is then dead.
if (ErrorAroundFlag(m_pOldMine-》uRow, m_pOldMine-》uCol))
{

Dead(m_pOldMine-》uRow, m_pOldMine-》uCol);
ReleaseCapture();
return;
}
}
else
{
// start the game, init the mines area
//如果游戏尚未开始,点击左键启动游戏
if (m_uGameState == GS_WAIT)
{
if (m_uTimer)
{
KillTimer(ID_TIMER_EVENT);
m_uTimer = 0;
}
// the following five lines refresh the remining mine num rect immediately
// when click in the mine area at the first time
m_uSpendTime = 1;
Invalidate();
if (m_bSoundful)
{
sndPlaySound((LPCTSTR)LockResource(m_pSndClock), SND_MEMORY | SND_ASYNC | SND_NODEFAULT);
}
//启动定时器
m_uTimer = SetTimer(ID_TIMER_EVENT, 1000, NULL);
//布雷
LayMines(m_pOldMine-》uRow, m_pOldMine-》uCol); // lay all the mines down
//改变游戏状态为“运行/GS_RUN“
m_uGameState = GS_RUN;

}

if (m_pOldMine-》uOldState == STATE_NORMAL)
{//当该雷区域为正常未作标记才打开
// first judge if the special MINEWND is a mine
//如果该区域为雷,则死亡
if (IsMine(m_pOldMine-》uRow, m_pOldMine-》uCol))
{
Dead(m_pOldMine-》uRow, m_pOldMine-》uCol);
ReleaseCapture();
return;
}
// the special MINEWND is not a mine
//不是雷的时候,获取其周围的雷数目
around = GetAroundNum(m_pOldMine-》uRow, m_pOldMine-》uCol);
// 如果为空白区域,拓展,否则打开该区域(显示周围有多少雷数)
if (around == 0) ExpandMines(m_pOldMine-》uRow, m_pOldMine-》uCol);
else DrawDownNum(m_pOldMine, around);
}
else if (m_pOldMine-》uOldState == STATE_DICEY)
{//标志为“?”问号的时候
m_pOldMine-》uState = STATE_DICEY;
}

//判断是否为胜利
if (Victory())
{
Invalidate();
ReleaseCapture();
return;
}
}
break;
case GS_VICTORY:
case GS_DEAD:
ReleaseCapture(); // release the cursor
return;
default :
break;
}
m_uBtnState = BUTTON_NORMAL;
Invalidate();
}
else
{//点击非雷区域
if (m_uGameState == GS_WAIT || m_uGameState == GS_RUN)
{
m_uBtnState = BUTTON_NORMAL;
InvalidateRect(rcBtn);
}
}

ReleaseCapture(); // release the cursor
CWnd::OnLButtonUp(nFlags, point);
}

void CMineWnd::OnRButtonDown(UINT nFlags, CPoint point)
{
//笑脸图按钮所在的区域
CRect rcBtn(m_uBtnRect, 15, m_uBtnRect, 39);
//雷区所在的区域
CRect rcMineArea(MINE_AREA_LEFT, MINE_AREA_TOP,
MINE_AREA_LEFT + m_uXNum * MINE_WIDTH,
MINE_AREA_TOP + m_uYNum * MINE_HEIGHT);

m_bLRBtnDown = FALSE;

if (rcMineArea.PtInRect(point))
{//点击雷区域
if (m_uGameState == GS_WAIT || m_uGameState == GS_RUN)
{
m_pNewMine = GetMine(point.x, point.y);
if (!m_pNewMine) return;
// both of the left button and the right button are pushing down
if (nFlags == (MK_LBUTTON | MK_RBUTTON))
{
m_bLRBtnDown = TRUE;
OnLRBtnDown(m_pNewMine-》uRow, m_pNewMine-》uCol);
}
else
{
switch(m_pNewMine-》uState)
{
case STATE_NORMAL:
m_pNewMine-》uState = STATE_FLAG;
m_pNewMine-》uOldState = STATE_FLAG;
m_nLeaveNum--;
break;
case STATE_FLAG:
m_pNewMine-》uState = STATE_DICEY;
m_pNewMine-》uOldState = STATE_DICEY;
m_nLeaveNum++;
break;
case STATE_DICEY:
m_pNewMine-》uState = STATE_NORMAL;
m_pNewMine-》uOldState = STATE_NORMAL;
break;
default:
break;
}
}
Invalidate();

}
}

CWnd::OnRButtonDown(nFlags, point);
}

void CMineWnd::OnRButtonUp(UINT nFlags, CPoint point)
{
CRect rcBtn(m_uBtnRect, 15, m_uBtnRect, 39);
CRect rcMineArea(MINE_AREA_LEFT, MINE_AREA_TOP,
MINE_AREA_LEFT + m_uXNum * MINE_WIDTH, MINE_AREA_TOP + m_uYNum * MINE_HEIGHT);

m_pOldMine = GetMine(point.x, point.y);
if (!m_pOldMine) return;
// judge whether the lr button are both pushed down
if (m_bLRBtnDown)
{
m_bLRBtnDown = FALSE;
OnLRBtnUp(m_pOldMine-》uRow, m_pOldMine-》uCol);
if (m_uGameState == GS_WAIT)
{
m_uBtnState = BUTTON_NORMAL;
Invalidate();
return;
}
// if the around flags number equal to the around mines number, expand.
if (m_pOldMine-》uState != STATE_FLAG)
{
OpenAround(m_pOldMine-》uRow, m_pOldMine-》uCol);
}
// check whether the MINEWND around the special MINEWND is a mine, if it is then dead.
if (ErrorAroundFlag(m_pOldMine-》uRow, m_pOldMine-》uCol))
{
// Dead(m_pOldMine-》uRow, m_pOldMine-》uCol);
// ReleaseCapture();
return;
}
}
else
{
Victory();
}

CWnd::OnRButtonUp(nFlags, point);
}

void CMineWnd::OnMouseMove(UINT nFlags, CPoint point)
{
if (nFlags == MK_LBUTTON || nFlags == (MK_LBUTTON | MK_RBUTTON))
{
CRect rcBtn(m_uBtnRect, 15, m_uBtnRect, 39);
CRect rcMineArea(MINE_AREA_LEFT, MINE_AREA_TOP,
MINE_AREA_LEFT + m_uXNum * MINE_WIDTH, MINE_AREA_TOP + m_uYNum * MINE_HEIGHT);

if (rcBtn.PtInRect(point))
{ // point in button area
switch(m_uGameState)
{
case GS_RUN:
m_uBtnState = (m_bClickBtn) ? BUTTON_DOWN : BUTTON_CLICK;
break;
case GS_DEAD: case GS_VICTORY:
if (m_bClickBtn) m_uBtnState = BUTTON_DOWN;
break;
default:
break;
}
InvalidateRect(rcBtn);
}
else if (rcMineArea.PtInRect(point))
{ // point in mine area
switch(m_uGameState)
{
case GS_RUN:
m_pNewMine = GetMine(point.x, point.y);
if (!m_pNewMine || !m_pOldMine) return;
if (m_pNewMine-》uCol != m_pOldMine-》uCol ||
m_pNewMine-》uRow != m_pOldMine-》uRow)
{
// change the new mine rect state
switch(m_pNewMine-》uState)
{
case STATE_NORMAL:
m_pNewMine-》uState = STATE_EMPTY;
break;
case STATE_DICEY:
m_pNewMine-》uState = STATE_DICEY_DOWN;
break;
}
// resume the old mine rect state
switch(m_pOldMine-》uOldState)
{
case STATE_NORMAL:
m_pOldMine-》uState = STATE_NORMAL;
break;
case STATE_DICEY:
m_pOldMine-》uState = STATE_DICEY;
break;
default :
break;
}
// judge whether the lr button are pushed down
if (m_bLRBtnDown)
{
OnLRBtnUp(m_pOldMine-》uRow, m_pOldMine-》uCol);
OnLRBtnDown(m_pNewMine-》uRow, m_pNewMine-》uCol);
}
m_pOldMine = m_pNewMine;
}
InvalidateRect(rcMineArea);
break;
case GS_VICTORY: case GS_DEAD:
return;
default:
break;
}
}
else
{ // point in other area
switch(m_uGameState)
{
case GS_RUN:
m_uBtnState = (m_bClickBtn) ? BUTTON_NORMAL : BUTTON_CLICK;
if (m_pNewMine)
{
if (m_pNewMine-》uOldState == STATE_NORMAL)
{
m_pNewMine-》uState = STATE_NORMAL;
}
else if (m_pNewMine-》uOldState == STATE_DICEY)
{
m_pNewMine-》uState = STATE_DICEY;
}
}
break;
case GS_DEAD:
m_uBtnState = BUTTON_DEAD;
break;
case GS_VICTORY:
m_uBtnState = BUTTON_VICTORY;
break;
default:
break;
}
Invalidate();
}
}

CWnd::OnMouseMove(nFlags, point);
}

Vb 怎么调用IE


我前一段时间也做了个自动登录记录考勤的程序,可以使用WebBrowser控件。以下是当时在CSDN上查到的说明文档,希望对你有所帮助。

32.WebBrowser 控件-说明
很多地方还是空白,我还不知道用法。望各位赐教,谢谢
这是我自己编制浏览器时的资料,供各位参考。
控件文件:system32\shdocvw.oca shdocvw.dll
注册:regsvr32 shdocvw.dll
WebBrowser 是 IE 内核做的 VB 控件,
WebBrowser.Document 为活动的文档返回自动化对象,引用 Microsoft HTML Object Library 可查看详细属性和方法

下面的解说假设窗体中有一个名称为 Web1 的 WebBrowser 控件
■■方法 ==============================
▲GoBack 相当于IE的“后退”按钮,使你在当前历史列表中后退一项
▲GoForward 相当于IE的“前进”按钮,使你在当前历史列表中前进一项
▲GoHome 相当于IE的“主页”按钮,连接用户默认的主页
▲GoSearch 相当于IE的“搜索”按钮,连接用户默认的搜索页面
▲Navigate 连接到指定的 URL,并显示网页
▲Navigate2 与 Navigate 作用同?
▲Refresh 刷新当前页面
▲Refresh2 同上,只是可以指定刷新级别,所指定的刷新级别的值来自RefreshConstants枚举表,
该表定义在ExDisp.h中,可以指定的不同值如下:
REFRESH_NORMAL 执行简单的刷新,不将HTTP pragma: no-cache头发送给服务器
REFRESH_IFEXPIRED 只有在网页过期后才进行简单的刷新
REFRESH_CONTINUE 仅作内部使用。在MSDN里写着DO NOT USE! 请勿使用
REFRESH_COMPLETELY 将包含pragma: no-cache头的请求发送到服务器
▲Stop 相当于IE的“停止”按钮,停止当前页面及其内容的载入
■■属性===================================
▲Document 为活动的文档返回自动化对象。如果HTML当前正被显示在 Web1 中,则 Document 提供
对DHTML Object Model的访问途径。下面有详细介绍
▲TopLevelContainer 返回一个Boolean值,表明 IE 是否是 Web1 控件顶层容器,是就返回 true
▲Type 返回已被 Web1 控件加载的对象的类型。例如:
如果加载.doc文件,就会返回 Microsoft Word Document
▲LocationName 返回一个字符串,该字符串包含着 Web1 当前显示的资源的名称,
如果资源是网页就是网页的标题;
如果是文件或文件夹,就是文件或文件夹的名称
▲LocationURL 返回 Web1 当前正在显示的资源的 URL
▲Busy 返回一个Boolean值,说明 Web1 当前是否正在加载 URL,如果返回 true
就可以使用 stop 方法来撤销正在执行的访问操作
▲Object 设置返回一个显现网页的 SHDocVwCtl.WebBrowser_V1 对象。参见下文。
▲MenuBar
▲StatusBar
▲ToolBar
▲Visible

■■事件===================================
▲BeforeNavigate2 导航发生前触发(打开网页前),刷新时不触发
▲CommandStateChange 当命令的激活状态改变时触发。它表明何时激活或关闭Back和Forward菜单项或按钮
▲DocumentComplete 当整个文档完成是触发,刷新页面不触发
▲DownloadBegin 当某项下载操作已经开始后触发,刷新也可触发此事件
▲DownloadComplete 当某项下载操作已经完成后触发,刷新也可触发此事件
▲NavigateComplete2 导航完成后触发,刷新时不触发
▲NewWindow2 弹出新窗口以前触发
可在此事件中设置 ppDisp 参数新网页显示对象,同时不会出现 SHDocVwCtl.WebBrowser_V1 的 NewWindow 事件
▲OnFullScreen 当 FullScreen 属性改变时触发。该事件采用 VARIENT_BOOL 的一个输入参数来指示 IE 是全
屏显示方式(VARIENT_TRUE)还是普通显示方式(VARIENT_FALSE)
▲OnMenuBar 改变 MenuBar 属性时触发,标示参数是 VARIENT_BOOL 类型的。
VARIANT_TRUE 可见,VARIANT_ FALSE 隐藏
▲OnQuit 无论是用户关闭浏览器还是开发者调用Quit方法,当IE退出时就会触发
▲OnStatusBar 改变 StatusBar 属性时触发,标示状态栏是否可见。
▲OnToolBar 改变 ToolBar 属性时触发,标示工具栏是否可见。
▲OnVisible 改变 Visible 属性时触发
▲StatusTextChange 控件的状态信息改变时触发。
▲TitleChange 网页标题改变时触发。参数 Text 是新标题,Web1.LocationName 属性是旧标题
■■SHDocVwCtl.WebBrowser_V1 对象==================
在窗体声明部分加入:Private WithEvents Web_V1 As SHDocVwCtl.WebBrowser_V1
在 Form_Load 加入:Set Web_V1 = Web1.Object
这样,Web_V1 就会有如下事件:
▲NewWindow 弹出新窗口以前触发
如果在 Web1_NewWindow2 设置了 ppDisp 为新显示对象,就不会出现此事件
★例子1,用自己开发的程序的新窗口显示弹出网页:
Dim nForm As New FormMain ’FormMain 为你的放有 Web1 控件的窗体
Processed = True ’阻止控件调用 IE 弹出窗口
nForm.Show
nForm.Web1.Navigate URL
★例子2,在同一窗口显示网页:
Processed = True ’阻止控件调用 IE 弹出窗口
Web1.Navigate URL
■■■■■■■■■■■■■■■■■■■■■■■■
■■Web1.Document 对象(HTMLDocument 对象)=======================
▲All(1)集合,已加载到 Web1 中的 html 文档包含的所有标签对象:HTMLAreaElement
集合对象索引起点为0,总个数为 All.length
可以用索引访问其中对象,如:All(1)
也可以用 Html 头元素名称访问对象,如:All(“body“)
All(0) 一般是自身的 outerHTML,可以这样返回文档代码(查看源文件):
Text1.Text = Web1.Document.All(0).outerhtml
但上一条语句并不可靠,有的网页开头的代码不是《html》,而是其他,例如:《!--STATUS OK--》
All()集合有 HTMLAreaElement 对象的大多数属性,有的元素还有特有的属性。
注意 某元素的 sourceIndex 属性就是该对象在 Document.All() 集合中的编号
▲body 主体元素对象:IHTMLElement
▲activeElement 活动元素:IHTMLElement
▲anchors 锚集合:IHTMLElementCollection
▲appendChild 方法:附加子对象(newChild As IHTMLDOMNode) As IHTMLDOMNode
▲applets 程序集合Java:IHTMLElementCollection
▲attachEvent 方法:隶属事件(event As String, pdisp As object) As Boolean
▲attributes 属性对象:object
▲bgColor 背景色:Variant
▲childNodes 子节点:object
▲clear 方法:清除
▲cloneNode 方法:复制节点(fDeep As Boolean) As IHTMLDOMNode
▲close 方法:关闭
▲compatMode
▲cookie 缓存
▲createAttribute 方法:创建属性(bstrattrName As String) As IHTMLDOMAttribute
▲createComment 方法:创建注释(bstrdata As String) As IHTMLDOMNode
▲createDocumentFragment 方法:创建文档片段() As IHTMLDocument2
▲createDocumentFromUrl 方法:从URL创建文档(bstrUrl As String, bstrOptions As String) As IHTMLDocument2
▲createElement 方法:创建元素(eTag As String) As IHTMLElement
▲CreateEventObject 方法:创建事件对象([pvarEventObject]) As IHTMLEventObj
▲createRenderStyle 方法:(v As String) As IHTMLRenderStyle
▲createStyleSheet 方法:创建方式表([bstrHref As String], [lIndex As Long = -1]) As IHTMLStyleSheet
▲createTextNode 方法:创建文本节点(text As String) As IHTMLDOMNode
▲defaultCharset 默认字符集?
▲detachEvent 方法:分离事件(event As String, pdisp As object)
▲dir
▲doctype 文档类型:IHTMLDOMNode
▲documentElement 文档元素:IHTMLElement
▲domain
▲elementFromPoint 方法:点所属组(x As Long, y As Long) As IHTMLElement
▲embeds :IHTMLElementCollection
▲execCommand 方法:实行命令(cmdID As String, [showUI As Boolean = False], [value]) As Boolean
▲execCommandShowHelp 方法:帮助命令(cmdID As String) As Boolean
▲fgColor 前景色:Variant
▲fileCreatedDate 文件创建日期
▲file Modified Date 文件修改日期
▲fileSize 文件大小
▲fileUpdatedDate 文件更新日期
▲FireEvent 方法:首事件(bstrEventName As String, [pvarEventObject]) As Boolean
▲firstChild 首子对象:IHTMLDOMNode
▲focus 方法:
▲forms 窗体:IHTMLElementCollection
▲frames 框架结构:FramesCollection
▲getElementById 方法:获取指定的 ID 元素(v As String) As IHTMLElement
▲getElementsByName 方法:获取指定的 Name 元素集合(v As String) As IHTMLElementCollection
▲getElementsByTagName 方法:获取指定的 TagName 元素集合(v As String) As IHTMLElementCollection
▲hasChildNodes 方法:
▲hasFocus 方法:() As Boolean
▲images 图像集合:IHTMLElementCollection

▲implementation 执行:IHTMLDOMImplementation
▲insertBefore 方法:插入前面(newChild As IHTMLDOMNode, [refChild]) As IHTMLDOMNode
▲lastChild
▲lastModified 上一修改
▲linkColor 链接色
▲alinkColor A 链接色:
▲vlinkColor V 链接色:
▲links 连接集合:IHTMLElementCollection
▲location 位置:HTMLLocation
▲media 媒体
▲mimeType
▲nameProp
▲namespaces 名称空间:object
▲nextSibling 下一相同对象
▲nodeName
▲nodeType
▲nodeValue
▲open 方法:打开([url As String = “text/html“], [name], [features], [replace]) As object
▲ownerDocument 所有者文档:object
▲parentNode 父节点:IHTMLDOMNode
▲parentWindow 父窗口:IHTMLWindow2
▲plugins 插件集合?:IHTMLElementCollection
▲previousSibling 前一兄弟:IHTMLDOMNode
▲protocol 协议
▲queryCommandEnabled 方法:查询命令能否执行(cmdID As String) As Boolean
▲queryCommandIndeterm 方法:查询命令? (cmdID As String) As Boolean
▲queryCommandState 方法:查询命令状态(cmdID As String) As Boolean
▲queryCommandSupported 方法:查询命令支持(cmdID As String) As String
▲queryCommandText 方法:查询命令文本(cmdID As String) As Boolean
▲queryCommandValue 方法:查询命令值 (cmdID As String)
▲readyState
▲recalc 方法:([fForce As Boolean = False])
▲referrer
▲releaseCapture 方法:
▲removeChild 方法:
▲removeNode 方法:
▲replaceChild 方法:
▲replaceNode 方法:替换节点(replacement As IHTMLDOMNode) As IHTMLDOMNode
▲scripts script集合:IHTMLElementCollection
▲security 安全:String
▲selection 已选择的对象集合:IHTMLSelectionObject
▲styleSheets 方式表单:HTMLStyleSheetsCollection
▲swapNode 方法:交换节点(otherNode As IHTMLDOMNode) As IHTMLDOMNode
▲title
▲toString 方法:
▲url
▲URLUnencoded
▲write 方法:(ParamArray psarray() As Variant)
▲writeln 方法:(ParamArray psarray() As Variant)
▲onstop 既是属性,又是事件
▲共有属性和事件
■■共有属性和事件:既是属性,又是事件。面带 on 的=======================
▲onactivate onActivate 激活
▲onafterupdate onAfterUpdate 更新后
▲onbeforeactivate onBeforeActivate 激活前
▲onbeforecopy onBeforeCopy 复制前
▲onbeforecut onBeforeCut 剪切前
▲onbeforedeactivate onBeforeDeactivate 无效前
▲onbeforeeditfocus onBeforeEditFocus 获得编辑焦点前
▲onbeforepaste onBeforePaste 粘贴前
▲onbeforeupdate onBeforeUpdate 更新前
▲onblur onBlur 模糊
▲oncellchange onCellChange 单元改变
▲onclick onClick 单击
▲oncontextmenu onContextMenu 上下文菜单
▲oncontrolselect onControlSelect 控件选定
▲oncopy onCopy 复制
▲oncut onCut 剪切
▲ondataavailable onDataAvailable 有用数据
▲ondatasetchanged onDataSetChanged 数据设置改变
▲ondatasetcomplete onDataSetComplete 数据设置完成
▲ondblclick onDblClick 双击
▲ondeactivate onDeactivate 变为非活动
▲ondrag onDrag 拖
▲ondragend onDragEnd 拖结束
▲ondragenter onDragEnter 拖进
▲ondragleave onDragLeave 拖离
▲ondragover onDragOver 拖过
▲ondragstart onDragStart 拖开始
▲ondrop onDrop
▲onerrorupdate onErrorUpdate 更新错误
▲onfilterchange onFilterChange 过滤器改变
▲onfocus onFocus
▲onfocusin onFocusIn 焦点进入
▲onfocusout onFocusOut 焦点离开
▲onhelp onHelp
▲onkeydown onKeyDown
▲onkeypress onKeyPress
▲onkeyup onKeyUp
▲onlayoutcomplete onLayoutComplete 版面完成
▲onlosecapture onLoseCapture 失去捕获
▲onmousedown onMouseDown
▲onmouseenter onMouseEnter
▲onmouseleave onMouseLeave
▲onmousemove onMouseMove
▲onmouseout onMouseOut
▲onmouseover onMouseOver
▲onmouseup onMouseUp
▲onmousewheel onMouseWheel 鼠标滚轮
▲onmove onMove
▲onmoveend onMoveEnd
▲onmovestart onMoveStart
▲onpage onPage
▲onpaste onPaste 粘贴
▲onpropertychange onPropertyChange 性质改变
▲onreadystatechange onSeadyStateChange 准备状态改变
▲onresize onResize
▲onresizeend onResizeEnd
▲onresizestart onResizeStart
▲onrowenter onRowEnter 行进入
▲onrowexit onRowExit
▲onrowsdelete onRowsDelete
▲onrowsinserted onRowsInserted
▲onscroll onScroll
▲onselectstart onSelectStart
-------
■■HTMLDivElement 对象:div 元素特有的属性=======================
▲align 排列:String
▲dataFld 数据流体:String
▲dataFormatAs 数据格式:String
▲dataSrc 数据Src:String
▲noWrap
■■HTMLAreaElement 对象:区域元素 大多数元素共有的属性=======================
一个 HTMLAreaElement 可以包含多个 HTMLAreaElement 对象,用 all() 集合访问
▲sourceIndex 对象在 Document.All() 集合中的编号
▲accessKey String:访问键
▲addBehavior 方法:添加行为(bstrUrl As String, [pvarFactory]) As Long
▲addFilter 方法:添加过滤器(pUnk As Unknown)
▲all 【参 HTMLAreaElement】
▲alt
▲appendChild 【参 HTMLAreaElement】
▲applyElement 方法:申请元素(apply As IHTMLElement, where As String) As IHTMLElement
▲attachEvent 方法:隶属事件(event As String, pdisp As object) As Boolean
▲attributes 【参 HTMLAreaElement】
▲behaviorUrns 行为缸对象:object
▲blur 方法:模糊
▲canHaveChildren 是否能拥有子对象
▲canHaveHTML 是否能拥有HTML
▲childNodes 子节点:object
▲children 是否子对象
▲className 类名
▲clearAttributes 方法:清除属性
▲click 方法:单击
▲clientHeight 内部高度?
▲clientLeft
▲clientTop
▲clientWidth
▲cloneNode 方法:克隆节点(fDeep As Boolean) As IHTMLDOMNode
▲componentFromPoint 方法:点所属组(x As Long, y As Long) As String
▲contains 方法:包含contains(pChild As IHTMLElement) As Boolean
▲contentEditable
▲coords
▲createControlRange 方法:创建控制山脉(行列)() As object
▲currentStyle 当前样式:IHTMLCurrentStyle
▲detachEvent 方法:分离事件(event As String, pdisp As object)
▲dir
▲disabled 不可用
▲document 文档对象:object
▲doScroll 方法([component])
▲dragDrop 方法:拖放
▲filters 过滤器: IHTMLFiltersCollection
▲FireEvent 方法FireEvent(bstrEventName As String, [pvarEventObject]) As Boolean
▲firstChild 首子对象:IHTMLDOMNode
▲focus 方法
▲getAdjacentText 方法:获取临近文本(where As String) As String
▲getAttribute 方法:获取属性(strAttributeName As String, [lFlags As Long])
▲getAttributeNode 方法:获取属性节点(bstrName As String) As IHTMLDOMAttribute
▲getBoundingClientRect 方法:获取内部范围矩形() As IHTMLRect
▲getClientRects 方法:获取委托矩形() As IHTMLRectCollection
▲getElementsByTagName 【参 HTMLAreaElement】
▲getExpression 方法:获取表达(propname As String)
▲hasChildNodes 【参 HTMLAreaElement】
▲hash 无用信息
▲hideFocus
▲host 主人
▲hostname 主人名称
▲href 默认属性
▲id 标示字符串
▲innerHTML 元素内的 html 代码
▲innerText 内部的纯文本,可以显示到网页上的文字
▲insertAdjacentElement 方法:插入临近元素(where As String, insertedElement As IHTMLElement) As IHTMLElement
▲insertAdjacentHTML 方法:(where As String, html As String)
▲insertAdjacentText 方法:(where As String, text As String)
▲insertBefore 方法:(newChild As IHTMLDOMNode, [refChild]) As IHTMLDOMNode
▲isContentEditable
▲isDisabled
▲isMultiLine
▲isTextEdit
▲lang
▲language
▲lastChild
▲mergeAttributes 方法:合并属性(mergeThis As IHTMLElement, [pvarFlags])
▲nextSibling 下一同级对象
▲nodeName
▲nodeType
▲nodeValue
▲noHref
▲normalize 方法:规格化
▲offsetHeight 偏移(缩进)高度
▲offsetLeft
▲offsetParent
▲offsetTop
▲offsetWidth

▲outerHTML 包含元素本身及内部的 html 代码
▲outerText
▲ownerDocument
▲parentElement
▲parentNode
▲parentTextEdit
▲pathname
▲port
▲previousSibling
▲protocol
▲readyState
▲recordNumber
▲releaseCapture 方法:释放捕获
▲removeAttribute 方法:移除属性
▲removeAttributeNode 方法
▲removeBehavior 方法:移除行为
▲removeChild 方法
▲removeExpression 方法
▲removeFilter 方法
▲removeNode 方法
▲replaceAdjacentText 方法:替换临近文本
▲replaceChild 方法
▲replaceNode 方法
▲runtimeStyle 运行方式:IHTMLStyle
▲scopeName 范围名称
▲scrollHeight
▲scrollIntoView 方法
▲scrollLeft
▲scrollTop
▲scrollWidth
▲search
▲setActive 方法
▲setAttribute 方法
▲setAttributeNode 方法
▲setCapture 方法
▲setExpression 方法
▲shape
▲style
▲swapNode 方法:交换节点
▲tabIndex
▲tagName 标签名
▲tagUrn 标签缸
▲target 目标
▲title
▲toString
■■Web1 应用例子
▲在网页加裁完毕后,运行其中某层的链接,当然事先必须知道该层链接的TagName:
WebBrowser1.Document.getElementsByname(“TagName“).click。

这断代码什么意思


//hWnd没有定义过没有赋过值为何就能用了
直接写hwnd就相当于me.hwnd,是本窗体的句柄

//WM_NCLBUTTONDOWN是什麽呢?HTCAPTION?
WM_开头的常数多为系统消息类常数,这一个是表示鼠标左键被按下
htcaption表示窗体的标题栏
//ReleaseCapture()为何是Releasecapture()干嘛的
这是一个API函数,它的作用是让当前的应用程序释放对鼠标的捕获

加在一起是这样理解
先让鼠标自由,然后发一个消息给本窗体告诉它鼠标左键按在了你的标题栏上了

你平时把鼠标左键按在了一个窗体的标题栏上是要干嘛,它基本上和你的想法一样

这种应用通常是为了移动没有标题栏的窗体
-releasecapture