VB设置进程优先级
http://topic.csdn.net/t/20060401/19/4656391.html
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
Const IDLE_PRIORITY_CLASS = &H40 '新进程应该有非常低的优先级——只有在系统空闲的时候才能运行。基本值是4
Const HIGH_PRIORITY_CLASS = &H80 '新进程有非常高的优先级,它优先于大多数应用程序。基本值是13。注意尽量避免采用这个优先级
Const NORMAL_PRIORITY_CLASS = &H20 '标准优先级。如进程位于前台,则基本值是9;如在后台,则优先值是7
Dim CurrentProcesshWnd As Long '当前进程句柄
Private Sub Form_Load()
CurrentProcesshWnd = GetCurrentProcess
If (SetPriorityClass(CurrentProcesshWnd, HIGH_PRIORITY_CLASS) = 0) Then
MsgBox "设置当前进程优先级为高。失败!"
Else
MsgBox "设置当前进程优先级为高。成功!"
End If
End Sub
相关文档:
http://tieba.baidu.com/f?kz=580219489
http://www.anqn.com/vb/154/8974.shtml
http://www.codefans.net/soft/5089.shtml
http://www.mndsoft.com/blog/article.asp?id=1121
http://topic.csdn.net/t/20020113/14/474848.html
直接运行网页中的JavaScript:
function alllefttab()
WebBrowser1.Document.par ......
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Private Sub Command1_Click()
Dim Url As String, Filepath As String
Url = "h ......
Dim wdapp As Word.Application
Dim wddoc As Word.Document
Dim wdtable As Word.Table
Set wdapp = CreateObject("word.application")
Set wddoc = wdapp.Documents.Add
  ......
代码如下:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As
Long, ByVal hWndInsertAfter As Long,& _
ByVal X As Long, ByVal Y As
Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long & _
&n ......
Private Sub Form_load()
'判断程序是否已经运行
If App.PrevInstance
Then
MsgBox "本程序已经运行!", vbInformation Or vbOKOnly, "提示信息"
Unload
Me
Exit Sub
&n ......