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
相关文档:
'代码:
Option Explicit
'======================用于查找进程和终止进程的API函数常数定义================ =====
Private Declare Function CreateToolhelpSnapshot Lib "kernel32" Alias "CreateToolhelp32Snapshot" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function ProcessF ......
VERSION 5.00
Begin VB.Form Form2
AutoRedraw = -1 'True
Caption = "计算界面"
ClientHeight = 4905
ClientLe ......
mxl=1 && 最大的文本框编号
mnl=1 &n ......
全屏
Private Sub Form_Load()
Me.Width = Screen.Width
Me.Height = Screen.Height
Me.WindowState = 2
End Sub
置顶
1.在VB的通用代码里写入API声明
Private Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, _
&n ......
VB 注释程序代码的符号是 ',只要在某行程序前面加上该符号就可以注释该行程序。但如果程序代码语句很多的时候,一行一行地注释就非常不方便。其实 VB
本身提供了一次性注释多条语句的功能:在主菜单“视图”选项的“工具栏”下,选中“编辑”,VB
的界面会出现一排工具按钮,其中就有用 ......