- Код: Выделить всё
Declare Function FreeLibrary Lib "kernel32" (ByVal hLibModule As Long) As Long
Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
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 Command1_Click()
lb = LoadLibrary("user32")
pa = GetProcAddress(lb, "SetWindowTextA")
CallWindowProc pa, Me.hWnd, "Privet!", ByVal 0&, ByVal 0&
FreeLibrary lb
End Sub
Почему привыполнении на XP SP2 программа вылетает с ошибкой, хотя отлично видно, что API сделала своё дело