PROBLEMA DE COMPATIBILIDADE VBA 64 E 32

LUCASLC7 02/01/2014 14:09:37
#432593
tenho dois computadores e ultilizo um codico vba para facilitar a vida, fiz o codigo com api de 32bits ai nao funcionou no 64 bits arrumei inserindo ptrsafe
para 32
Citação:


Option Explicit
Private Declare Function FindWindow Lib [Ô]user32[Ô] Alias [Ô]FindWindowA[Ô] (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib [Ô]user32[Ô] Alias [Ô]GetWindowLongA[Ô] (ByVal hWnd As Long, ByVal nIndex As Long) As Long
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 ShowWindow Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long


para 64
Citação:


Option Explicit
Private Declare PtrSafe Function FindWindow Lib [Ô]user32[Ô] Alias [Ô]FindWindowA[Ô] (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetWindowLong Lib [Ô]user32[Ô] Alias [Ô]GetWindowLongA[Ô] (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong Lib [Ô]user32[Ô] Alias [Ô]SetWindowLongA[Ô] (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare PtrSafe Function ShowWindow Lib [Ô]user32[Ô] (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long


ai nao funciona no 32, assim nao da ne, nao posso ficar corrigindo isso sempre.
espero a ajuda obrigado
Faça seu login para responder