|
-
Jan 12th, 2000, 07:23 PM
#1
Thread Starter
New Member
Hi,
I notice that when I set the BorderStyle to 0, the icon on the taskbar is missing as well, so is there anyway to keep the icon in taskbar while remove the form's titlebar?
Thanks for helping 
Hank
------------------
We are the soul creators, for computers.
-
Jan 12th, 2000, 11:08 PM
#2
Sure, use this code on a Normal Form, (Don't set the Border Style to Borderless).
Code:
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 GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private 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
Private Const WS_CAPTION = &HC00000
Private Const GWL_STYLE = (-16)
Private Const SWP_FRAMECHANGED = &H20
Private Const SWP_NOMOVE = &H2
Private Sub Form_Load()
Dim W As Integer
Dim H As Integer
W = ScaleX(Width, ScaleMode, vbPixels)
H = ScaleY(ScaleHeight, ScaleMode, vbPixels)
Caption = "Captionless Form with Icon"
Call SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) Xor WS_CAPTION)
Call SetWindowPos(hwnd, 0&, 0&, 0&, W, H, SWP_NOMOVE Or SWP_FRAMECHANGED)
End Sub
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|