erwinspy main.bas

来自「这个源程序用来读写ERWIN设计的ER1文件中的元数据信息」· BAS 代码 · 共 37 行

BAS
37
字号
Attribute VB_Name = "Module1"
Option Explicit
Private Declare Function SetWindowLong Lib "user32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As _
Long) As Long
Private Const WS_EX_APPWINDOW = &H40000
Private Const GWL_EXSTYLE = (-20)

Sub Main()
    On Error GoTo ErrExit
    
    ' Activate the API
    Dim oSCAPI As New SCAPI.Application
    
    ' Init the form
    frmMain.Init oSCAPI
    
    ' Do this to activate the form icon on the taskbar or systray
    ' ShowInTaskBar for the form should be false
    Dim FormStyles As Long
    FormStyles = GetWindowLong(frmMain.hwnd, GWL_EXSTYLE)
    FormStyles = FormStyles Or WS_EX_APPWINDOW
    Call SetWindowLong(frmMain.hwnd, GWL_EXSTYLE, FormStyles)
    
    ' Show the form
    frmMain.Show 1
    
    Exit Sub
' Error exit
ErrExit:
    MsgBox "Failed to create SCAPI instance"

End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?