以下是引用清澂居士在2007-1-10 14:53:50的发言:
可以在运行时用App.Path得到绝对路径,然后用LoadLibrary
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32"(ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long,ByVal Msg As Any, ByVal wParam As Any, ByVal lParam As Any) As Long
Private Sub Form_Load()
On Error Resume Next
Dim lb As Long,pa As Long
lb =LoadLibrary("user32")
pa =GetProcAddress(lb,"SetWindowTextA")
CallWindowProc pa,Me.hWnd,"Hello !",ByVal 0&,ByVal 0&
FreeLibrary lb
End Sub
可以在运行时用App.Path得到绝对路径,然后用LoadLibrary
Private Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32"(ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long,ByVal Msg As Any, ByVal wParam As Any, ByVal lParam As Any) As Long
Private Sub Form_Load()
On Error Resume Next
Dim lb As Long,pa As Long
lb =LoadLibrary("user32")
pa =GetProcAddress(lb,"SetWindowTextA")
CallWindowProc pa,Me.hWnd,"Hello !",ByVal 0&,ByVal 0&
FreeLibrary lb
End Sub
太高深了 看不懂 难道没有简单的解决办法?