Jump to content
Fórum Script Brasil
  • 0

Janelas Diferentes


iSoron

Question

5 answers to this question

Recommended Posts

  • 0

Qualquer linguagem que tenha acesso as APIs do Windows poderá fazer isso. Segue aí um exemplo em VB (basta setar a propriedade BorderStyle para 0 e a propriedade Picture para a figura desejada, lembrando que a figura deverá ter uma determinada cor que ficará "invisível" e esta mesma cor deve estar presente no primeiro pixel da imagem.):

Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Const RGN_DIFF = 4
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2

Private Sub Form_Activate()
    Dim X, Y As Integer
    Me.ScaleMode = 3
    CurRgn = CreateRectRgn(0, 0, Me.ScaleWidth, Me.ScaleHeight)
    transcolor = GetPixel(Me.hdc, 1, 1)
    
    Do While Y <= Me.ScaleHeight
        Do While X <= Me.ScaleWidth
            If GetPixel(Me.hdc, X, Y) = transcolor Then
                TempRgn = CreateRectRgn(X, Y, X + 2, Y + 2)
                success = CombineRgn(CurRgn, CurRgn, TempRgn, RGN_DIFF)
                DeleteObject (TempRgn)
            End If
            X = X + 1
        Loop
        Y = Y + 1
        X = 0
    Loop

    success = SetWindowRgn(Me.hwnd, CurRgn, True)
    DeleteObject (CurRgn)
    Me.ScaleMode = 1
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 1 Then
        ReleaseCapture
        SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
    End If
End Sub

ok?

Abraços,

Graymalkin

Link to comment
Share on other sites

  • 0

aí iSoron, desculpe por não ter postado o cód ainda, é q ando com "excesso de pouco tempo" e os arq q tinha feito dessa maneira está nos meus backups q não tive tempo de abrir - sem falar q nessa maq q estou agora não tem nem vb nem delphi!

...assim q possível eu mando alguma coisa! ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.1k
    • Total Posts
      652k
×
×
  • Create New...