⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 21650.html

📁 VB技巧问答10000例 VB技巧问答10000例
💻 HTML
字号:
<html>  <head>    <title>Re: 请问要如何利用VB将其它正在执行的程式关闭?</title>  </head>  <body bgcolor="#FFFFFF" vlink="#808080">    <center>      <h1>Re: 请问要如何利用VB将其它正在执行的程式关闭?</h1>    </center><hr size=7 width=75%><hr size=7 width=75%><p>Posted by <a href="mailto:janyeh@mail.cgu.edu.tw">Jan Yeh</a> on November 27, 1999 at 02:27:34:<p>In Reply to: <a href="21642.html">请问要如何利用VB将其它正在执行的程式关闭?</a> posted by 小龙 on November 26, 1999 at 22:12:24:<p>: 请问要如何利用VB将其它正在执行的程式关闭?<br>以下转载别人的一段程式码,其中必须要指定你想关闭之程式的TITLE(就是FORM上端蓝底白字的那一串字,要一模一样喔)<br>' #VBIDEUtils#********************************************************<br>' * Programmer Name  : Waty Thierry<br>' * Web Site         : www.geocities.com/ResearchTriangle/6311/<br>' * E-Mail           : waty.thierry@usa.net<br>' * Date             : 23/04/99<br>' * Time             : 14:45<br>' *******************************************************************<br>' * Comments         : Can I close an application<br>' *<br>' *<br>' *******************************************************************<p>' You can always use the FindWindow-function and the PostMessage-function <br>' to find the wanted application, and then send it a message that it has<br>to close itself.<br>' One disadvantage: you'll need the exact caption of this application.<p>Private Declare Function FindWindow Lib "user32" Alias "FindWindowA"<br>(ByVal lpClassName As String, ByVal lpWindowName As String) As Long<br>Private Declare Function PostMessage Lib "user32" Alias "PostMessageA"<br>(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As<br>Any) As Long<br>Const WM_CLOSE = &H10<p>Private Sub Form_Load()<br>   <br>   Dim winHwnd As Long<br>   Dim RetVal As Long<br>   winHwnd = FindWindow(vbNullString, "Calculator")<br>   If winHwnd <> 0 Then<br>      PostMessage winHwnd, WM_CLOSE, 0&, 0&<br>   Else<br>      MsgBox "The Calculator is not open."<br>   End If<p>End Sub<p>如果你不确定那一行的字会是什么,你可以利用CWW网页http://www.hosp.ncku.edu.tw/~cww/htmapi76.htm的方式,一个一个找看看你要的程式在不在,再利用上述方式就可以啰...<br>参考看看吧!<br><br><hr size=7 width=75%><p><a name="followups">Follow Ups:</a><br><ul><!--insert: 21650--></ul><!--end: 21650--><br><hr size=7 width=75%><p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -