Писал программу на Viaual Basic и вот такая ошибка вылезла: Code: Слишком большое число аргументов у "Declare Ansi Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (hwndctory As String, nShowCmd As Long) As Long". Чем она может быть вызвана? Кто встречался с такой ошибкой помогите Сильно не ругаться
Сам код программы такой: Code: Public Class Form1 Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwndctory As String, ByVal nShowCmd As Long) As Long Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click Call ShellExecute(0&, "Open", "http://www.mail.ru/", "", "", 1) End Sub А в первом посте была написана ошибка которая выскакивает внизу
пробуй так Code: Public Class Form1 Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label2.Click Call ShellExecute(0&, "Open", "http://www.mail.ru/", "", "", 1) End Sub
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ (ByVal hwnd As Long, ByVal lpszOp As String, _ ByVal lpszFile As String, ByVal lpszParams As String, _ ByVal LpszDir As String, ByVal FsShowCmd As Long) _ As Long http://support.microsoft.com/kb/170918
Парни вот всё делаю дальше по своему плану и вот тут ещё такая ошибка вышла о_О Сам код: Code: Option Explicit Private Declare Function Shell_NotifyIcon Lib "shell32.dll" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long Private Const NIM_ADD = &H0 Private Const NIM_DELETE = &H2 Private Const NIM_MODIFY = &H1 Private Const WM_MOUSEMOVE = &H200 Private Const NIF_MESSAGE = &H1 Private Const NIF_TIP = &H4 Private Const NIF_ICON = &H2 Private Const WM_LBUTTONDBLCLK = &H203 Private Const WM_LBUTTONDOWN = &H201 Private Const WM_LBUTTONUP = &H202 Private Const WM_RBUTTONDBLCLK = &H206 Private Const WM_RBUTTONDOWN = &H204 Private Const WM_RBUTTONUP = &H205 Private Type NOTIFYICONDATA cbSize As Long hwnd As Long uID As Long uFlags As Long uCallbackMessage As Long hIcon As Long szTip As String * 64 End Type Private tray As NOTIFYICONDATA Private Sub Command1_Click() Shell_NotifyIcon NIM_ADD, tray End Sub Private Sub Command2_Click() Shell_NotifyIcon NIM_DELETE, tray End Sub Private Sub Form_Load() Command1.Caption = "Добавить" Command2.Caption = "Удалить" tray.cbSize = Len(tray) tray.hIcon = Me.Icon tray.hwnd = Me.hwnd tray.szTip = "Всплывающая подсказка" & Chr(0) tray.uCallbackMessage = WM_MOUSEMOVE tray.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE tray.uID = 0 End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim msg As Long msg = X / Screen.TwipsPerPixelX Select Case msg Case WM_LBUTTONDBLCLK Me.Print "Двойной клик левой кнопкой" Case WM_LBUTTONDOWN Me.Print "Левая кнопка мыши нажата" Case WM_LBUTTONUP Me.Print "Левая кнопка мыши отжата" Case WM_RBUTTONDBLCLK Me.Print "Двойной клик правой кнопкой" Case WM_RBUTTONDOWN Me.Print "Правая кнопка мыши нажата" Case WM_RBUTTONUP Me.Print "Правая кнопка мыши отжата" End Select End Sub А вот и она.. Неизвестно-Плохая ошибка