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

VB OpenGL绘图

要想在VB6.0中使用OpenGL绘图,必须先下载一个SDK,名字叫vbogl.tlb。我用的版本是2.1,这个月要出3.0版本的了。
下载该文件后,直接在VB6.0“工程”-“引用”里面引用
1、在form中加入一个PictureBox控件
2、要在Windows里面使用OpenGL,必须先进行像素格式设置,函数代码如下
Dim hRC     As Long’全局变量
 
   '启用OGL
Sub EnableOpenGL(ghDC As Long)
On Error GoTo Err
Dim pfd As PIXELFORMATDESCRIPTOR                'pfd像素格式设置.
    ZeroMemory pfd, Len(pfd)
    pfd.nSize = Len(pfd)                        '大小
    pfd.nVersion = 1                            '版本
    pfd.dwFlags = PFD_DRAW_TO_WINDOW Or PFD_SUPPORT_OPENGL Or PFD_DOUBLEBUFFER '标志
    pfd.iPixelType = PFD_TYPE_RGBA              '像素类型
    pfd.cColorBits = 24                         '颜色位数
    pfd.cDepthBits = 32                         '位宽
    pfd.iLayerType = PFD_MAIN_PLANE             '图层类型
   
    Dim PixFormat As Long
    PixFormat = ChoosePixelFormat(ghDC, pfd)    '选择设备中最匹配我们所设置的像素
    SetPixelFormat ghDC, PixFormat, pfd  &nbs


相关文档:

VB.NET2005读取XML数据

通过调用CreateDataSetfromXml取得XML数据
Imports System.Xml
Public Const FILE_CONFIG = "MZZ.xml"
Public Const PATH_CONFIG = "\XML\"
Dim dstXML As DataSet
Dim tblXML_DB As DataTable
Dim dtCod As New DataTable
Dim strSQL As String = ""

clsPublic ......

VB 6.0使用api

这一段大家编写程序很多时候都在使用API,它给我们带来了强大的功能.让我们非常惊喜.
但是我们在调试程序的时候有时候总会奔溃.这样很不方便.
其中有些是api惹的祸
使用api注意事项:
首先我说说我的观点.
1:Api是很多系统也在用.我们在设置参数时如果和系统的参数有冲突.就可能引起软件出错
2.api很多都是c语言编写的, ......

vb自动关机程序

Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Const EWX_LOGOFF = 0
Private Const EWX_SHUTDOWN = 1
Private Const EWX_REBOOT = 2
Private Const EWX_FORCE = 4
Private closeTime As String
Sub AdjustTokenPrivilegesForNT()
  ......

vb自动关机程序

Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Private Const EWX_LOGOFF = 0
Private Const EWX_SHUTDOWN = 1
Private Const EWX_REBOOT = 2
Private Const EWX_FORCE = 4
Private closeTime As String
Sub AdjustTokenPrivilegesForNT()
  ......

VB开机运行程序

Option Explicit
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll" Alias ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号