|
-
Sep 4th, 2001, 02:57 AM
#1
Thread Starter
Addicted Member
icon on form/window's title bar
I am using a form , but it is without title bar, control box and clip box. i.e. its borderstyle property is none.now i m customising the control box with coding.but i m getting problem in putting a icon for this form. i just want to show an icon when some one minimize it. (i m minimizing it through code.) as there is no title bar so form.icon is not working.window's title bar also i set fm Setwindowtext api.i used draw icon but that draws on window's client area not on title bar.form'2 showintaskbar property is true.
but i m not able to show an icon when it get minimized , any API fucntion or any other method to do it ????
thanks in advance ...
-
Sep 4th, 2001, 10:09 PM
#2
Try this:
VB Code:
Private Declare Function SetWindowLong Lib "user32" _
Alias "SetWindowLongA" (ByVal hwnd As Long, _
ByVal nIndex As Long, ByVal dwNewLong As Long) _
As Long
Const GWL_STYLE = (-16)
Const WS_SYSMENU = &H80000
Private Sub Form_Load()
Call SetWindowLong(Me.hwnd, GWL_STYLE, WS_SYSMENU)
End Sub
-
Sep 4th, 2001, 11:55 PM
#3
Thread Starter
Addicted Member
hi , thanks a lot for ur help .. i m getting what i wanted but a bit more prob.as setwindowlong function changes window attributes . so when i insert a menu on form ( though its not visible) , then at run time its title bar comes back showing icon and title. and this happens only one time when form loads , once i minimize it and again restore then title bar goes off and normal form form without title bar comes , means it is happening only once while loading the form. any remedy for it ??
thanks ..
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
|