Results 1 to 3 of 3

Thread: icon on form/window's title bar

  1. #1

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225

    Question 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 ...
    Chander
    Email:[email protected]

  2. #2
    Matthew Gates
    Guest
    Try this:


    VB Code:
    1. Private Declare Function SetWindowLong Lib "user32" _
    2. Alias "SetWindowLongA" (ByVal hwnd As Long, _
    3. ByVal nIndex As Long, ByVal dwNewLong As Long) _
    4. As Long
    5.  
    6. Const GWL_STYLE = (-16)
    7. Const WS_SYSMENU = &H80000
    8.  
    9. Private Sub Form_Load()
    10.     Call SetWindowLong(Me.hwnd, GWL_STYLE, WS_SYSMENU)
    11. End Sub

  3. #3

    Thread Starter
    Addicted Member chander's Avatar
    Join Date
    Nov 2000
    Location
    New Delhi , India
    Posts
    225

    Question

    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 ..
    Chander
    Email:[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
  •  



Click Here to Expand Forum to Full Width