Последние записи
- Рандомное слайдшоу
- Событие для произвольной области внутри TImage
- Удаление папки с файлами
- Распечатка файла
- Преобразовать массив байт в вещественное число (single)
- TChromium (CEF3), сохранение изображений
- Как в Delphi XE обнулить таймер?
- Изменить цвет шрифта TextBox на форме
- Ресайз PNG без потери прозрачности
- Вывод на печать графического файла
Интенсив по Python: Работа с API и фреймворками 24-26 ИЮНЯ 2022. Знаете Python, но хотите расширить свои навыки?
Slurm подготовили для вас особенный продукт! Оставить заявку по ссылке - https://slurm.club/3MeqNEk
Online-курс Java с оплатой после трудоустройства. Каждый выпускник получает предложение о работе
И зарплату на 30% выше ожидаемой, подробнее на сайте академии, ссылка - ttps://clck.ru/fCrQw
16th
Мар
Выполнение макросов на 64-x разрядных системах
Posted by obzor under VBA
Часто сталкиваюсь с тем, что некоторые макросы — не выполняются на 64-x разрядных системах.
Подскажите универсальную строчку кода, которая бы позволила запускаться макросу на 64-х разрядных системах ?
#If VBA7 Then
Public Declare PtrSafe Function bla-bla-bla
#Else
Public Declare Function bla-bla-bla
#End If
Нашёл вот такую «строку».Код:
#If Win64 Then
#If VBA7 Then ' Windows x64, Office 2010
Declare PtrSafe Function SetForegroundWindow Lib "user32" (ByVal hwnd As LongLong) As LongLong
Declare PtrSafe Function ShowWindow Lib "user32" (ByVal hwnd As LongLong, ByVal nCmdShow As Integer) As Integer
Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongLong, ByVal wMsg As LongLong, ByVal wParam As Integer, ByVal lParam As Any) As LongLong
Declare PtrSafe Function GetParent Lib "user32" (ByVal hwnd As LongLong) As LongLong
Declare PtrSafe Function GetWindow Lib "user32" (ByVal hwnd As LongLong, ByVal wCmd As LongLong) As LongLong
Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongLong
Declare PtrSafe Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As LongLong, lpdwprocessid As LongLong) As LongLong
Declare PtrSafe Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As LongLong, ByVal hwndChildAfter As LongLong, ByVal lpszClass As String, ByVal lpszWindow As String) As LongLong
#Else ' Windows x64,Office 2003-2007
Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As LongLong) As LongLong
Declare Function ShowWindow Lib "user32" (ByVal hwnd As LongLong, ByVal nCmdShow As Integer) As Integer
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongLong, ByVal wMsg As LongLong, ByVal wParam As Integer, ByVal lParam As Any) As LongLong
Declare Function GetParent Lib "user32" (ByVal hwnd As LongLong) As LongLong
Declare Function GetWindow Lib "user32" (ByVal hwnd As LongLong, ByVal wCmd As LongLong) As LongLong
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongLong
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As LongLong, lpdwprocessid As LongLong) As LongLong
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As LongLong, ByVal hwndChildAfter As LongLong, ByVal lpszClass As String, ByVal lpszWindow As String) As LongLong
#End If
#Else
#If VBA7 Then ' Windows x86, Office 2010
Declare PtrSafe Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Declare PtrSafe Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Integer) As Integer
Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Declare PtrSafe Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Declare PtrSafe Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare PtrSafe Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwprocessid As Long) As Long
Declare PtrSafe Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long
#Else ' Windows x86, Office 2003-2007
Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long
Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Integer) As Integer
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwprocessid As Long) As Long
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hwndParent As Long, ByVal hwndChildAfter As Long, ByVal lpszClass As String, ByVal lpszWindow As String) As Long
#End If
#End If
Похожие статьи
Купить рекламу на сайте за 1000 руб
пишите сюда - alarforum@yandex.ru
Да и по любым другим вопросам пишите на почту
пеллетные котлы
Пеллетный котел Emtas
Наши форумы по программированию:
- Форум Web программирование (веб)
- Delphi форумы
- Форумы C (Си)
- Форум .NET Frameworks (точка нет фреймворки)
- Форум Java (джава)
- Форум низкоуровневое программирование
- Форум VBA (вба)
- Форум OpenGL
- Форум DirectX
- Форум CAD проектирование
- Форум по операционным системам
- Форум Software (Софт)
- Форум Hardware (Компьютерное железо)