易截截图软件、单文件、免安装、纯绿色、仅160KB

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


相关文档:

VB下载文件

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 ......

VB六个数取最大值和平均数的平方

VERSION 5.00
Begin VB.Form Form2
   AutoRedraw      =   -1  'True
   Caption         =   "计算界面"
   ClientHeight    =   4905
   ClientLe ......

VB 单实例运行

VB6
在程序运行时用如下语句:
if   app.PrevInstance=true   then  
            end    
end   if
VB 2005:
1. 在VB2005中,打开"属性"页,启用"应用程序“框架, 选中"
单实例应用程序"前面复选框,就行了。
......

vb用api调用对话框

建一个模块
Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
Public Type OPENFILENAME
lStructSize As Long
hwndOwner As Long
hInstance As Long
lpstrFilter As String
lpstrCustomFilt ......

VB怎样判断、防止程序重复执行

Private Sub Form_load()
    '判断程序是否已经运行
    If App.PrevInstance
Then
     MsgBox "本程序已经运行!", vbInformation Or vbOKOnly, "提示信息"
     Unload
Me
     Exit Sub
&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号