VB用API实现各种对话框(总结)(转载)

''标准对话框(SmDialog)
   ''
   Option Explicit
   ''''定义一个全局变量,用于保存字体的各种属性
   Public Type SmFontAttr
   FontName As String ''字体名
   FontSize As Integer ''字体大小
   FontBod As Boolean ''是否黑体
   FontItalic As Boolean ''是否斜体
   FontUnderLine As Boolean ''是否下划线
   FontStrikeou As Boolean
   FontColor As Long
   WinHwnd As Long
   End Type
   Dim M_GetFont As SmFontAttr
   ''''**系统常量------------------------------------------
   Private Const SWP_NOOWNERZORDER = &H200
   Private Const SWP_HIDEWINDOW = &H80
   Private Const SWP_NOACTIVATE = &H10
   Private Const SWP_NOMOVE = &H2
   Private Const SWP_NOREDRAW = &H8
   Private Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
   Private Const SWP_NOSIZE = &H1
   Private Const SWP_NOZORDER = &H4
   Private Const SWP_SHOWWINDOW = &H40
   Private Const RESOURCETYPE_DISK = &H1 ''网络驱动器
   Private Const RESOURCETYPE_PRINT = &H2 ''网络打印机
   ''/------------------------------------------------------------
   Private Const NoError = 0
   Private Const CSIDL_DESKTOP = &H0
   Private Const CSIDL_PROGRAMS = &H2
   Private Const CSIDL_CONTROLS = &H3
   Private Const CSIDL_PRINTERS = &H4
   Private Const CSIDL_PERSONAL = &H5
   Private Const CSIDL_FAVORITES = &H6
   Private Const CSIDL_STARTUP = &H7
   Private Const CSIDL_RECENT = &H8
   Private Const CSIDL_SENDTO = &H9
   Private Const CSIDL_BITBUCKET = &HA
   Private Const CSIDL_STARTMENU = &HB
   Private Const CSIDL_DESKTOPDIRECTORY = &H10
   Private Const CSIDL_DRIVES = &H11
   Private Const CSIDL_NETWORK = &H12
   Private Const CSIDL_NETHOOD = &H13
   Private Const CSIDL_FONTS = &H14
   Private Const CSIDL_TEMPLATES = &H15
   Private Const LF_FACESIZE = 32
   Private Const MAX_PATH = 260
   Private Const CF_INITTOLOGFONTSTRUCT = &H40&
   Private Const CF_FIXEDPITCHONLY = &H4000&
   Private Const CF_EFFECTS = &H100&
   Private Const ITALIC_FONTTYPE = &H200
   Private Const BOLD_FONTTYPE = &H100
   Private Const CF_NOFACESEL = &H80000
   Private Const CF_NOSCRIPTSEL = &H800000
   Private Const CF_PRINTERFONTS = &H2
   Private Const CF_SCALABLEONLY = &H20000
   Private Const CF_SCREENFONTS = &H1
   Private Const CF_SHOWHELP = &H4&
   Private Const CF_BOTH = (CF_SCREENFONTS Or CF_PRINTERFONTS)
   ''/------------------------------------------
   Private Type CHOOSECOLOR
   lStructSize As Long
   hwndOwner As Long
   hInstance As Long
   rgbResult As Long
   lpCustColors As String
   flags As Long
   lCustData As Long
   lpfnHook As Long
   lpTemplateName As String
   End Type
   Private Type OPENFILENAME
   lStructSize As Long
   hwndOwner As Long
   hInstance As Long
   lpstrFilter As String
   lpstrCustomFilter As String
   nMaxCustFilter As Long
   nFilterIndex As Long
   lpstrFile As String
   nMaxFile As Long
   lpstrFileTitle As String
   nMaxFileTitle As Long
   lpstrInitialDir As String
   lpstrTitle As String
   flags As Long
   nFileOffset As Integer
   nFileExtension As Integer
   lpstrDefExt As String
   lCustData As Long
   lpfnHook As Long
   lpTemplateName As String
   End Type
   ''/-----------------------------------------------------------
   Private Type LOGFONT
   lfHeight As Long
   lfWidth As Long
   lfEscapement As Long
   lfOrientation As Long
   lfWeight As Long
   lfItalic As Byte
   lfUnderline As Byte
   lfStrikeOut As Byte
   lfCharSet As Byte
   lfOutPrecision As Byte
   lfClipPrecision As Byte
   lfQuality As Byte
   lfPitchAndFamily As Byte
   lfFaceName As String * LF_FACESIZE
   End Type
   Private Type CHOOSEFONT
   lStructSize As Long
   hwndOwner As Long
   hdc As Long
   lpLogFont As Long
   iPointSize As Long
   flags As Long
   rgbColors As Long
   lCustData As Long
   lpfnHook As Long
   lpTemplateName As String
   hInstance As Long
   lpszStyle As String
   nFontType As Integer
   MISSING_ALIGNMENT As Integer
   nSizeMin As Long
   nSizeMax As Long
   End Type
   ''/--------------
   Private Type SHITEMID
   cb As Long
   abID() As Byte
   End Type
   Private Type ITEMIDLIST
   mkid As SHITEMID
   End Type
   ''/------------------------------------------
   Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias
   "SHGetPathFromIDListA" _
   (ByVal Pidl As Long, ByVal pszPath As String) As Long
   Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" _
   (ByVal hwndOwner As Long, ByVal nFolder As Long, _
   Pidl As ITEMIDLIST) As Long
   ''/------------------------------------------
   Private Declare Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA"
   (pOpenfilename As OPENFILENAME) As Long
   Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA"
   (pOpenfilename As OPENFILENAME) As Long
   Private Declare Function CHOOSECOLOR Lib "comdlg32.dll" Alias "ChooseColorA"
   (pChoosecolor As CHOOSECOLOR) As Long
   Private Declare Function WNetConnectionDialog Lib "mpr.dll" (ByVal hWnd As Long,
   ByVal dwType As Long) As Long
   Private Declare Function CHOOSEFONT Lib "comdlg32.dll" Alias "ChooseFontA"
   (pChooseFont As CHOOSEFONT) As Long
   ''/=======显示断开网络资源对话框============
   Private Declare Function WNetDisconnectDialog Lib "mpr.dll" _
   (ByVal hWnd As Long, ByVal dwType As Long) As Long
   ''/================================================================================
   Private Declare Sub CoTaskMemFree Lib "ole32.dll" (ByVal pv As Long)
   Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias
   "SHBrowseForFolderA" _
   (lpBrowseInfo As BROWSEINFO) As Long
   Private Type BROWSEINFO
   hOwner As Long
   pidlRoot As Long
   pszDisplayName As String
   lpszTitle As String
   ulFlags As Long
   lpfn As Long
   lParam As Long
   iImage As Long
   End Type
   ''/结构说明: _
   hOwner 调用这个对话框的窗口的句柄 _
   pidlRoot 指向你希望浏览的最上面的文件夹的符列表 _
   pszDisplayName 用于保存用户所选择的文件夹的显示名的缓冲区 _
   lpszTitle 浏览对话框的标题 _
   ulFlags 决定浏览什么的标志(见下) _
   lpfn 当事件发生时对话框调用的回调函数的地址.可将它设定为NULL _
   lparam 若定义了回调函数,则为传递给回调函数的值 _
   iImage As Long 保存所选文件夹映像索引的缓冲区 _
   ulFlags参数(见下:)
   Private Const BIF_RETURNONLYFSDIRS = &H1 ''仅允许浏览文件系统文件夹
   Private Const BIF_DONTGOBELOWDOMAIN = &H2 ''利用这个值强制用户仪在网上邻居的域级别
   中
   Private Const BIF_STATUSTEXT = &H4 ''在选择对话中显示状态栏
   Private Const BIF_RETURNFSANCESTORS = &H8 ''返回文件系统祖先
   Private Const BIF_BROWSEFORCOMPUTER = &H1000 ''允许浏览计算机
   Private Const BIF_BROWSEFORPRINTER = &H2000 ''允许游览打印机文件夹
   ''/--------------------------------------------------------------------------------
   Dim FontInfo As SmFontAttr ''字体
   ''/--------------------------------------------------------------------------------
   Private Function GetFolderValue(wIdx As Integer) As Long
   If wIdx < 2 Then
   GetFolderValue = 0
   ElseIf wIdx < 12 Then
   GetFolderValue = wIdx
   Else
   GetFolderValue = wIdx + 4
   End If
   End Function
   ''
   Private Function GetReturnType() As Long
   Dim dwRtn As Long
   dwRtn = dwRtn Or BIF_RETURNONLYFSDIRS
   GetReturnType = dwRtn
   End Function
   ''
   ''文件夹选择对话框
   ''函数:SaveFile
   ''参数:Title 设置对话框的标签.
   '' hWnd 调用此函数的HWND
   '' FolderID SmBrowFolder枚举(默认:我的电脑).
   ''返回值:String 文件夹路径.
   ''例子:
   Public Function GetFolder(Optional Title As String, _
   Optional hWnd As Long, _
   Optional FolderID As SmBrowFolder = MyComputer) As String
   Dim Bi As BROWSEINFO
   Dim Pidl As Long
   Dim Folder As String
   Dim IDL As ITEMIDLIST
   Dim nFolder As Long
   Dim ReturnFol As String
   Dim Fid As Integer
   Fid = FolderID
   Folder = String$(255, Chr$(0))
   With Bi
   .hOwner = hWnd
   nFolder = GetFolderValue(Fid)
   If SHGetSpecialFolderLocation(ByVal hWnd, ByVal nFolder, IDL) = NoError Then
   .pidlRoot = IDL.mkid.cb
   End If
   .pszDisplayName = String$(MAX_PATH, Fid)
   If Len(Title) > 0 Then
   .lpszTitle = Title & Chr$(0)
   Else
   .lpszTitle = "请选择文件夹:" & Chr$(0)
   End If
   .ulFlags = GetReturnType()
   End With
   Pidl = SHBrowseForFolder(Bi)
   ''/返回所选的文件夹路径
   If SHGetPathFromIDList(ByVal Pidl, ByVal Folder) Then
   ReturnFol = Left$(Folder, InStr(Folder, Chr$(0)) - 1)
   If Right$(Trim$(ReturnFol), 1) <> "\" Then ReturnFol = ReturnFol & "\"
   GetFolder = ReturnFol
   Else
   GetFolder = ""
   End If
   End Function
   ''
   ''文件保存对话框
   ''函数:SaveFile
   ''参数:WinHwnd 调用此函数的HWND
   '' BoxLabel 设置对话框的标签.
   '' StartPath 设置初始化路径.
   '' FilterStr 文件过滤.
   '' Flag 标志.(参考MSDN)
   ''返回值:String 文件名.
   ''例子:
   Public Function SaveFile(WinHwnd As Long, _
   Optional BoxLabel As String = "", _
   Optional StartPath As String = "", _
   Optional FilterStr = "*.*|*.*", _
   Optional Flag As Variant = &H4 Or &H200000) As String
   Dim Rc As Long
   Dim pOpenfilename As OPENFILENAME
   Dim Fstr1() As String
   Dim Fstr As String
   Dim I As Long
   Const MAX_Buffer_LENGTH = 256
   On Error Resume Next
   If Len(Trim$(StartPath)) > 0 Then
   If Right$(StartPath, 1) <> "\" Then StartPath = StartPath & "\"
   If Dir$(StartPath, vbDirectory + vbHidden) = "" Then
   StartPath = App.Path
   End If
   Else
   StartPath = App.Path
   End If
   If Len(Trim$(FilterStr)) = 0 Then
   Fstr = "*.*|*.*"
   End If
   Fstr1 = Split(FilterStr, "|")
   For I = 0 To UBound(Fstr1)
   Fstr = Fstr & Fstr1(I) & vbNullChar
   Next
   ''/--------------------------------------------------
   With pOpenfilename
   .hwndOwner = WinHwnd
   .hInstance = App.hInstance
   .lpstrTitle = BoxLabel
   .lpstrInitialDir = StartPath
   .lpstrFilter = Fstr
   .nFilterIndex = 1
   .lpstrDefExt = vbNullChar & vbNullChar
   .lpstrFile = String(MAX_Buffer_LENGTH, 0)
   .nMaxFile = MAX_Buffer_LENGTH - 1
   .lpstrFileTitle = .lpstrFile
   .nMaxFileTitle = MAX_Buffer_LENGTH
   .lStructSize = Len(pOpenfilename)
   .flags = Flag
   End With
   Rc = GetSaveFileName(pOpenfilename)
   If Rc Then
   SaveFile = Left$(pOpenfilename.lpstrFile, pOpenfilename.nMaxFile)
   Else
   SaveFile = ""
   End If
   End Function
   ''
   ''文件打开对话框
   ''函数:OpenFile
   ''参数:WinHwnd 调用此函数的HWND
   '' BoxLabel 设置对话框的标签.
   '' StartPath 设置初始化路径.
   '' FilterStr 文件过滤.
   '' Flag 标志.(参考MSDN)
   ''返回值:String 文件名.
   ''例子:
   Public Function OpenFile(WinHwnd As Long, _
   Optional BoxLabel As String = "", _
   Optional StartPath As String = "", _
   Optional FilterStr = "*.*|*.*", _
   Optional Flag As Variant = &H8 Or &H200000) As String
   Dim Rc As Long
   Dim pOpenfilename As OPENFILENAME
   Dim Fstr1() As String
   Dim Fstr As String
   Dim I As Long
   Const MAX_Buffer_LENGTH = 256
   On Error Resume Next
   If Len(Trim$(StartPath)) > 0 Then
   If Right$(StartPath, 1) <> "\" Then StartPath = StartPath & "\"
   If Dir$(StartPath, vbDirectory + vbHidden) = "" Then
   StartPath = App.Path
   End If
   Else
   StartPath = App.Path
   End If
   If Len(Trim$(FilterStr)) = 0 Then
   Fstr = "*.*|*.*"
   End If
   Fstr = ""
   Fstr1 = Split(FilterStr, "|")
   For I = 0 To UBound(Fstr1)
   Fstr = Fstr & Fstr1(I) & vbNullChar
   Next
   With pOpenfilename
   .hwndOwner = WinHwnd
   .hInstance = App.hInstance
   .lpstrTitle = BoxLabel
   .lpstrInitialDir = StartPath
   .lpstrFilter = Fstr
   .nFilterIndex = 1
   .lpstrDefExt = vbNullChar & vbNullChar
   .lpstrFile = String(MAX_Buffer_LENGTH, 0)
   .nMaxFile = MAX_Buffer_LENGTH - 1
   .lpstrFileTitle = .lpstrFile
   .nMaxFileTitle = MAX_Buffer_LENGTH
   .lStructSize = Len(pOpenfilename)
   .flags = Flag
   End With
   Rc = GetOpenFileName(pOpenfilename)
   If Rc Then
   OpenFile = Left$(pOpenfilename.lpstrFile, pOpenfilename.nMaxFile)
   Else
   OpenFile = ""
   End If
   End Function
   ''
   ''颜色对话框
   ''函数:GetColor
   ''参数:
   ''返回值:Long,用户所选择的颜色.
   ''例子:
   Public Function GetColor() As Long
   Dim Rc As Long
   Dim pChoosecolor As CHOOSECOLOR
   Dim CustomColor() As Byte
   With pChoosecolor
   .hwndOwner = 0
   .hInstance = App.hInstance
   .lpCustColors = StrConv(CustomColor, vbUnicode)
   .flags = 0
   .lStructSize = Len(pChoosecolor)
   End With
   Rc = CHOOSECOLOR(pChoosecolor)
   If Rc Then
   GetColor = pChoosecolor.rgbResult
   Else
   GetColor = -1
   End If
   End Function
   ''
   ''显示映射网络驱动器对话框
   ''函数:ConnectDisk
   ''参数:hWnd 调用此函数的窗口HWND.(ME.HWN)
   ''返回值:=0,成功,<>0,失败.
   ''例子:
   Public Function ConnectDisk(Optional hWnd As Long) As Long
   Dim Rc As Long
   If IsNumeric(hWnd) Then
   Rc = WNetConnectionDialog(hWnd, RESOURCETYPE_DISK)
   Else
   Rc = WNetConnectionDialog(0, RESOURCETYPE_DISK)
   End If
   ConnectDisk = Rc
   End Function
   ''
   ''显示映射网络打印机对话框
   ''函数:ConnectPrint
   ''参数:hWnd 调用此函数的窗口HWND.(ME.HWN)
   ''返回值:=0,成功,<>0,失败.
   ''例子:
   Public Function ConnectPrint(Optional hWnd As Long) As Long
   Dim Rc As Long
   If IsNumeric(hWnd) Then
   Rc = WNetConnectionDialog(hWnd, RESOURCETYPE_PRINT)
   Else
   Rc = WNetConnectionDialog(0, RESOURCETYPE_PRINT)
   End If
   End Function
   ''
   ''断开映射网络驱动器对话框
   ''函数:DisconnectDisk
   ''参数:hWnd 调用此函数的窗口HWND.(ME.HWN)
   ''返回值:=0,成功,<>0,失败.
   ''例子:
   Public Function DisconnectDisk(Optional hWnd As Long) As Long
   Dim Rc As Long
   If IsNumeric(hWnd) Then
   Rc = WNetDisconnectDialog(hWnd, RESOURCETYPE_DISK)
   Else
   Rc = WNetDisconnectDialog(0, RESOURCETYPE_DISK)
   End If
   End Function
   ''
   ''断开映射网络打印机关话框
   ''函数:DisconnectPrint
   ''参数:hWnd 调用此函数的窗口HWND.(ME.HWN)
   ''返回值:=0,成功,<>0,失败.
   ''例子:
   Public Function DisconnectPrint(Optional hWnd As Long) As Long
   Dim Rc As Long
   If IsNumeric(hWnd) Then
   Rc = WNetDisconnectDialog(hWnd, RESOURCETYPE_PRINT)
   Else
   Rc = WNetDisconnectDialog(0, RESOURCETYPE_PRINT)
   End If
   End Function
   ''
   ''字体选择对话框
   ''函数:GetFont
   ''参数:WinHwnd 调用此函数的窗口HWND.(ME.HWN)
   ''返回值:SmFontAttr 结构变量.
   ''例子:
   '' Dim mDialog As New SmDialog
   '' Dim mFontInfo As SmFontAttr
   '' mFontInfo = mDialog.GetFont(Me.hWnd)
   '' Set mDialog = Nothing
   Public Function GetFont(WinHwnd As Long) As SmFontAttr
   Dim Rc As Long
   Dim pChooseFont As CHOOSEFONT
   Dim pLogFont As LOGFONT
   With pLogFont
   .lfFaceName = StrConv(FontInfo.FontName, vbFromUnicode)
   .lfItalic = FontInfo.FontItalic
   .lfUnderline = FontInfo.FontUnderLine
   .lfStrikeOut = FontInfo.FontStrikeou
   End With
   With pChooseFont
   .hInstance = App.hInstance
   If IsNumeric(WinHwnd) Then .hwndOwner = WinHwnd
   .flags = CF_BOTH + CF_INITTOLOGFONTSTRUCT + CF_EFFECTS + CF_NOSCRIPTSEL
   If IsNumeric(FontInfo.FontSize) Then .iPointSize = FontInfo.FontSize *
   10
   If FontInfo.FontBod Then .nFontType = .nFontType + BOLD_FONTTYPE
   If IsNumeric(FontInfo.FontColor) Then .rgbColors = FontInfo.FontColor
   .lStructSize = Len(pChooseFont)
   .lpLogFont = VarPtr(pLogFont)
   End With
   Rc = CHOOSEFONT(pChooseFont)
   If Rc Then
   FontInfo.FontName = StrConv(pLogFont.lfFaceName, vbUnicode)
   FontInfo.FontName = Left$(FontInfo.FontName, InStr(FontInfo.FontName,
   vbNullChar) - 1)
   With pChooseFont
   FontInfo.FontSize = .iPointSize / 10 ''返回字体大
   小
   FontInfo.FontBod = (.nFontType And BOLD_FONTTYPE) ''返回是/否黑
   体
   FontInfo.FontItalic = (.nFontType And ITALIC_FONTTYPE) ''是/否斜体
   FontInfo.FontUnderLine = (pLogFont.lfUnderline) ''是/否下划线
   FontInfo.FontStrikeou = (pLogFont.lfStrikeOut)
   FontInfo.FontColor = .rgbColors
   End With
   End If
   GetFont = FontInfo
   End Function
   ''
   ''文件打开.(带预览文件功能)
   ''函数:BrowFile
   ''参数:Pattern 文件类型字符串,StarPath 开始路径,IsBrow 是否生成预览
   ''返回值:[确定] 文件路径.[取消] 空字符串
   ''例:Me.Caption =
   FileBrow.BrowFile("图片文件|*.JPG;*.GIF;*.BMP|媒体文件|*.DAT;*.MPG;*.SWF;*.MP3;*.MP2
   ")
   Public Function BrowFile(Optional Pattern As String = "*,*|*.*", _
   Optional StarPath As String = "C:\", _
   Optional IsBrow As Boolean = True) As String
   On Error Resume Next
   If Len(Trim$(Pattern)) = 0 Then Pattern = "*.*|*.*"
   P_FilePart = Pattern
   P_StarPath = StarPath
   P_IsBrow = IsBrow
   FrmBrowFile.Show 1
   BrowFile = P_FullFileName
   End Function
   ''
   ''显示网上邻居
   ''函数:ShowNetWork
   ''参数:FrmCap 窗口标题,Labction 提示标签名.
   ''返回值:[确定] 所选计算机名称.[取消] 空字符串.
   ''例:
   Public Function ShowNetWork(Optional FrmCap As String = "网上邻居", _
   Optional Labction As String = "选择计算机名称.") As
   String
   ShowLan.Hide
   ShowLan.Caption = FrmCap
   ShowLan.LabNNCaption = Labction
   ShowLan.Show 1
   ShowNetWork = P_NetReturnVal
   End Function

转载于:https://www.cnblogs.com/bennylam/archive/2009/10/28/1591498.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/435737.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【转】DICOM简述!!!!

转自&#xff1a;DICOM简述 - 简书 视频教程&#xff1a;https://www.bilibili.com/video/av66144772 DICOM&#xff08;Digital Imaging and Communications in Medicine&#xff09;即医学数字成像和通信&#xff0c;是医学图像和相关信息的国际标准&#xff08;ISO 12052&…

WinCE OAL中的OEMIoControl函数

关于OEMIoControl函数&#xff0c;我在2008年1月份写过一篇blog叫“WinCE BSP中OAL层中的OEMIoControl介绍”&#xff0c;已经比较详细的介绍了OEMIoControl&#xff0c;今天在这里只是对OEMIoControl中比较常用的case说一说。看看PB的文档就知道OEMIoControl可以包含很多case而…

实用MYSQL语句收集

SQL分类&#xff1a; DDL—数据定义语言(Create&#xff0c;Alter&#xff0c;Drop&#xff0c;DECLARE) DML—数据操纵语言(Select&#xff0c;Delete&#xff0c;Update&#xff0c;Insert) DCL—数据控制语言(GRANT&#xff0c;REVOKE&#xff0c;COMMIT&#xff0c;ROLLBAC…

【转】xilinx usb下载器 速度高速极限设置 JTAG-SMT2 JTAG-HS2 JTAG-HS3和Platform Cable USB DLC9 DLC10速度测试

xilinx usb下载器 下载速度极限设置以及高速JTAG-SMT2(HS1 HS2 HS3)和DLC9 DLC10 速度测试 对于一款xilinx的下载器&#xff0c;研发和烧录以及boss都最关心下载速度的极限值。因为速度快可以在短时间内完成下载和仿真采集数据等任务。时间就是金钱&#xff0c;能节约时间大家…

DataGridView中的CheckBox

1.为DataGridView添加一列类型为DataGridViewCheckBoxColumn的列, 如果想CheckBox能单独选择的话,就一定要为DataGridView启用编辑.否则就去掉启用编辑的勾选项. 2.DataGridView中CheckBox的全选与不全选 一般会使用Button,LinkLabel,CheckBox来做为事件的起点,那么就可以在相应…

WinCE的I2C驱动程序设计

1 I2C 通信协议及S3C2410 芯片介绍 I2C(Inter Integrated Circuit) 总线是1980 年由Philips 公司推出的。 I2C 总线用两条线&#xff08;SDA 和SCL &#xff09;在总线和装置之间传递信息&#xff0c;在微控制器和外部设备之间进行串行通信或在主设备和从设备之间进行双向数据传…

【转】vivado18.3的安装 安装教程

原装性能 Xilinx下载器 赛灵思下载线 Platform Cable USB仿真器 Xilinx下载器 CPLD FPGA digilent usb JTAG SMT2 高速 赛灵思线 转自&#xff1a;Vivado18.3的安装 安装教程_Daniel_Banana的博客-CSDN博客 本文内容学习自【ALINX】FPGA ZYNQ视频教程——AX7010/AX7020教程—…

局域网共享设置

我们在多机使用时候&#xff0c;连机使用共享文件是最常用到的&#xff0c;如何设置共享文件呢&#xff1f;下面我们就来一一介绍。首先我们要看看共享文件时需要的基本条件。 windows网上邻居互访的基本条件&#xff1a; 1) 双方计算机打开&#xff0c;且设置了网络共享资源&a…

【转】5分钟了解FPGA之Xilinx 7系列

转自&#xff1a;http://xilinx.eetrend.com/content/2019/100042384.html xilinx7系列FPGA主要包括&#xff1a;Spartan-7、Artix-7、Kintex-7、Virtex-7。其性能/密度/价格也随着系列的不同而提升。 Spartan7系列是7系列中的屌丝青年&#xff0c;拥有最低的价格、最低的功耗…

WinCE 修改系统字体 开启ClearType平滑字体

系统字体&#xff1a; "Wt"宽度[正负相等:A-A,并且过大的时候例如这里的:fffffff4按XFFFFFFFF-X]"Ht"高度[正负相等:A-A,并且过大的时候例如这里的:fffffff4按XFFFFFFFF-X]"Nm""字体名称""CS"[0使用系统默认,1使用Nm] &quo…

不允许后退提交数据的方法(抗重复刷新提交)

试试了一下在 .NET中通过如下语句Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);就可以使页面的缓存失效&#xff0c;每次都需要获取新页面。 转载于:https://www.cnblogs.com/0000/archive/2009/11/11/1601036.html

【转】FPGA到底是啥?

转自&#xff1a;FPGA到底是啥&#xff1f; - 知乎 怎么才叫学会了FPGA&#xff0c;怎么才叫学好了FPGA&#xff1f;我相信有很多朋友有类似的问题&#xff0c;因为在多数人的潜意识里&#xff0c;FPGA是非常高深莫测的技术&#xff0c;能够玩转FPGA的都是大神级的人物。 其实…

VS配合VSS时,编译报错:未能向文件“....csproj.FileListAbsolute.txt”写入命令行,对路径的访问被拒绝。...

最近帮别人调试的时候&#xff0c;出现这个问题。环境&#xff1a;VS2008VSS2005&#xff0c;多人配合完成一个项目。 在编译的时候报错&#xff1a;未能向文件“....csproj.FileListAbsolute.txt”写入命令行,对路径的访问被拒绝。 在网上开始查找出错的解决方法&#xff0c;终…

【转】重新打包DebianISO实现无人应答安装(UEFI+BIOS)

转自&#xff1a;重新打包DebianISO实现无人应答安装&#xff08;UEFIBIOS&#xff09; - 全部 - 真不是你的 之前我写过打包DebianISO的文章&#xff0c;但是那种打包的方法只能用在引导是BIOS的机器上&#xff0c;按照正常的情况&#xff0c;应该是UEFIBIOS同时支持。 正好前…

定制mini2440 wince启动界面

定制mini2440 wince启动界面过程 我的显示屏是7寸的&#xff0c;所以应该按照分辨率制作一张800*480像素的图片。 详细步骤如下&#xff1a; 1、我用photoshop的制作的&#xff0c;如下图&#xff1a; 2、用bmp2T.exe转换这个图片&#xff0c;在命令符下输入bmp2T空格图片名…

Copying to tmp table Problem Solving

Labels: MySQL, MySQL_Problem_Solving 今天一早突然系统突然报慢&#xff0c;查了一下是以下语句&#xff1a; 6177700 username ip db——name Query 549 Copying to tmp table SELECT ....................原因如下&#xff1a;Copying to tmp table on disk The tempora…

WinCE启动界面的定制

本文将以模拟器为例&#xff0c;简单介绍如何定制WinCE的启动界面&#xff0c;实现动画效果。在实际硬件平台上一般在BOOTLOADER中定制开机界面。如果BOOT从Flash加载NK到内存的时间较长&#xff0c;通常也会加一个进度条显示。如果从NK加载完成到进入CE桌面的时间也很长&#…

【转】CT辐射量如何计算?

转自:CT辐射量如何计算&#xff1f; - 知乎 作者&#xff1a;西门子中国 链接&#xff1a;https://www.zhihu.com/question/27399697/answer/190062962 来源&#xff1a;知乎 著作权归作者所有。商业转载请联系作者获得授权&#xff0c;非商业转载请注明出处。 CT检查后&am…

linux c++连接mysql示例

编译和连接程序 MySQL中有一个特殊的脚本,叫做mysql_config. 它会为你编译MySQL客户端,并连接到MySQL服务器提供有用的信息.你需要使用下面两个选项. 1. --libs 选项 - 连接MySQL客户端函数库所需要的库和选项. $ mysql_config --libs 2. --cflags 选项 - 使用必要的include文件…

ucGUI内存管理

ucGUI内存管理分析 1. 概述 ucGUI为了提高在不同硬件与软件平台的可移植性&#xff0c;它的内存分配没有用到像molloc和free这样的与平台相关的函数。它有自己的一套机制来管理内存。以下详细描述其内存管理机制。 2. ucGUI需要管理的内存 a) 窗体&#x…