달력

10

« 2019/10 »

  •  
  •  
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  •  
  •  
2010.04.08 13:20

VisualBasic 폼의 투명도 설정하기 Language/VB2010.04.08 13:20

' 선언부
' ### 투명화 관련
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 SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

' 사용시
MakeLayeredWnd Me.hWnd
SetLayeredWindowAttributes Me.hWnd, 0, 255 * (투명도), LWA_ALPHA
Posted by 현자

댓글을 달아 주세요

2010.04.08 12:42

VisualBasic 폼을 원으로 만들기 Language/VB2010.04.08 12:42

' 선언부

' ### 폼 원형으로 설정
Private Declare Function CreateEllipticRgn Lib "gdi32.dll" ( _
    ByVal X1 As Long, _
    ByVal Y1 As Long, _
    ByVal X2 As Long, _
    ByVal Y2 As Long _
) As Long
Private Declare Function SetWindowRgn Lib "user32.dll" ( _
    ByVal hWnd As Long, _
    ByVal hRgn As Long, _
    ByVal bRedraw As Boolean _
) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" ( _
    ByVal hObject As Long _
) As Long

' 사용시

' ### 폼을 둥글게 설정한다.
Dim hRgn As Long
hRgn = CreateEllipticRgn(0, 0, ScaleX(Me.Width, vbTwips, vbPixels), ScaleY(Me.Height, vbTwips, vbPixels))
SetWindowRgn hWnd, hRgn, False
DeleteObject hRgn
Posted by 현자

댓글을 달아 주세요

' 선언부

' ### 커서/아이콘 관련
Private Declare Function GetIconInfo Lib "user32.dll" (ByVal hIcon As Long, ByRef piconinfo As ICONINFO) As Long
Private Declare Function GetCursorInfo Lib "user32.dll" (ByRef pci As CURSORINFO) As Long
Private Declare Function DrawIconEx Lib "user32.dll" ( _
    ByVal hdc As Long, _
    ByVal xLeft As Long, _
    ByVal yTop As Long, _
    ByVal hIcon As Long, _
    ByVal cxWidth As Long, _
    ByVal cyWidth As Long, _
    ByVal istepIfAniCur As Long, _
    ByVal hbrFlickerFreeDraw As Long, _
    ByVal diFlags As Long _
) As Long

'사용 시

Dim ci As CURSORINFO, ii As ICONINFO, pt As POINTAPI, rc As RECT, rcForm As RECT, rcIntersect As RECT, cx As Long, cy As Long

ci.cbSize = Len(ci)
GetCursorInfo ci ' ### 마우스 커서 정보를 얻는다.
GetIconInfo ci.hCursor, ii ' ### 마우스 커서의 아이콘 정보를 얻는다.
pt = ci.ptScreenPos
Posted by 현자

댓글을 달아 주세요