Hanya sharing pengalaman: nge blog, google AdSense, cyber enjoyable

Naruto Fans Kampanye Damai Pemilu Indonesia 2009 Mendukung SBY untuk menjadi Presiden 2009-2014

Jun 13, 2007

HIDE Windows taskbar

Task:

HIDE Windows taskbar

Place on the Module
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const SWP_HIDEWINDOW = &H80
Public Const SWP_SHOWWINDOW = &H40

Code
Dim rtn As Long

'hide the taskbar
rtn = FindWindow("Shell_traywnd", "") 'get the Window
Call SetWindowPos(rtn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW) 'hide the Tasbar
'show th taskbar
rtn = FindWindow("Shell_traywnd", "") 'get the Window
Call SetWindowPos(rtn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW) 'show the Taskbar

Create a circular form

Task: Create a circular form (VB)

Declarations

Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal

Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long,

ByVal hRgn As Long, ByVal bRedraw As Long) As Long

Code

'place this code in the form load event

Private Sub Form_Load()

Dim lngRegion As Long

Dim lngReturn As Long

Dim lngFormWidth As Long

Dim lngFormHeight As Long

lngFormWidth = Me.Width / Screen.TwipsPerPixelX

lngFormHeight = Me.Height / Screen.TwipsPerPixelY

lngRegion = CreateEllipticRgn(0, 0, lngFormWidth, lngFormHeight)

lngReturn = SetWindowRgn(Me.hWnd, lngRegion, True)

End Sub


Alexa Rank