Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
  • Avatar do usuário
  • Avatar do usuário
Avatar do usuário
Por pasedo
Posts Avatar
#32444
Bom dia pessoal, gostaria de por um icone no meu userform, como faço isso? Grato.
Você não está autorizado a ver ou baixar esse anexo.
Avatar do usuário
Por pasedo
Posts Avatar
#32481
Pessoal bom dia achei este mas não está funcionando. Podem dar uma olhada.Grato
Você não está autorizado a ver ou baixar esse anexo.
Por babdallas
#32533
Explique o que você fazer por favor.
Avatar do usuário
Por pasedo
Posts Avatar
#32541
Boa noite babdallas, eu quero que este icone do computador apareça no form na barra de titulo onde esta no caption "TESTE DE CÓDIGO" ao iniciar o formulário como esta na imagem que vai junto no arquivo rar
Você não está autorizado a ver ou baixar esse anexo.
Por babdallas
#32552
Meu nível de VBA ainda não resolve problemas com API do WIndows. Até tentei dar uma pesquisada, mas não consegui.
Um opção é você postar sua dúvida no Fórum do Tomas Vasquez, já que imagino que você deve ter pegado este código lá.
Sinto por não poder ajudar mais.
Avatar do usuário
Por pasedo
Posts Avatar
#32555
babdallas muito obrigado pela tentativa de ajuda, vou ver la no forum dele. Grato.
Por repairkerkereh
#32639
Providing electric shutter repair services throughout Tehran, Karaj, and suburban cities is carried out by an experienced and experienced Iranian team at any time of day and at the best price.
Electric shutter repair requires a high level of knowledge and is a highly specialized work. There are, therefore, there are few groups that can perform repairs and because of the complexity of تعمیرات کرکره برقی the structure of the shutters, it is necessary for تعمیرات موتور کرکره برقی
the electric shutter repairer to be well It has a bunch of pieces and recognizes existing bugs and works best to fix problems.
Avatar do usuário
Por JCabral
Avatar
#32641
Veja se esse exemplo ajuda.

Nota: Não é da minha autoria
Você não está autorizado a ver ou baixar esse anexo.
Avatar do usuário
Por pasedo
Posts Avatar
#32652
JCabral muito obrigado, vou ver se consigo adapta-lo para iniciar com o icone ja colocado no form...
Por babdallas
#32805
Este código funciona, já testei. Mas tem um porém, a extensão do arquivo deve ser .ICO. Fonte: https://answers.microsoft.com/en-us/mso ... 6aea36974d

Código: Selecionar todos
Private Declare Function FindWindow _
    Lib "user32" Alias "FindWindowA" _
   (ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long
 
Private Declare Function ExtractIcon _
    Lib "shell32.dll" Alias "ExtractIconA" _
   (ByVal hInst As Long, _
    ByVal lpszExeFileName As String, _
    ByVal nIconIndex As Long) As Long
 
Private Declare Function SendMessage _
    Lib "user32" Alias "SendMessageA" _
   (ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Integer, _
    ByVal lParam As Long) As Long
 
Private Const WM_SETICON = &H80
 
Private Sub UserForm_Initialize()
    Dim strIconPath As String
    Dim lngIcon As Long
    Dim lnghWnd As Long
    
    With frmTest
        .Caption = "TESTE DE CÓDIGO  - ppasedo@gmail.com"
    End With
    
    ' Change to the path and filename of an icon file
    strIconPath = "C:\Program Files\Microsoft Office\root\Office16\FORMS\1046\ACTIVITL.ICO"
    ' Get the icon from the source
    lngIcon = ExtractIcon(0, strIconPath, 0)
    ' Get the window handle of the userform
    lnghWnd = FindWindow("ThunderDFrame", Me.Caption)
    'Set the big (32x32) and small (16x16) icons
    SendMessage lnghWnd, WM_SETICON, True, lngIcon
    SendMessage lnghWnd, WM_SETICON, False, lngIcon
End Sub

Private Sub btnOK_Click()
    Unload Me
End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord