Results 1 to 8 of 8

Thread: two questions

  1. #1

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    two questions

    1) how do i change the icon of my .exe file in vb
    2) i want my program icon to come in taskbar, n on mouse click restore to its original possition

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: two questions

    1. me.icon = loadpicture("MYICON.ICO")
    2. that is nomal procedure when an aplication is minimised

    rgds peter

  3. #3
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: two questions

    Another way is to set the "Icon" property of the form in the properties panel of VB.

    You can use the above method, but then you would have to redistribute the icon with your app.

    Using the "Icon" property of the form embeds the icon in the form... no distribution of the icon needed.

  4. #4

    Thread Starter
    Addicted Member hyousuf2's Avatar
    Join Date
    Dec 2004
    Location
    Dublin
    Posts
    226

    Re: two questions

    well one of ma questions is answered, but wat abt the second question that i want the application's icon to display in the taskbar ?

  5. #5
    Banned
    Join Date
    Dec 2004
    Posts
    174

    Re: two questions

    search google for "Visual Basic Systray"

  6. #6
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: two questions

    Quote Originally Posted by hyousuf2
    well one of ma questions is answered, but wat abt the second question that i want the application's icon to display in the taskbar ?
    The .ICO files that I've had made by my programmers were done in MS Visual C++ IDE. The LARGE ICON (for the IMAGE of the SHORTCUT, let's say) is the "Standard 32x32" image.

    The SMALL ICON (that appears in the TASKBAR) is the "Small 16x16" image.

    What do you see if you open the .ICO file in C++?

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: two questions

    If form's border is set to 0 (none) but ShowInTaskbar is True - icon will not appear unless you do something like the following:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Const GWL_STYLE = (-16)
    4. Private Const WS_SYSMENU = &H80000
    5. Private Const WS_MINIMIZEBOX = &H20000
    6.  
    7. Private Declare Function GetWindowLong Lib "user32" _
    8.     Alias "GetWindowLongA" _
    9.     (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    10. Private Declare Function SetWindowLong Lib "user32" _
    11.     Alias "SetWindowLongA" _
    12.     (ByVal hwnd As Long, ByVal nIndex As Long, _
    13.      ByVal dwNewLong As Long) As Long
    14.  
    15. Private Sub Form_Load()
    16. Dim lStyle As Long
    17.  
    18.     'ensure taskbar icon visibility
    19.     lStyle = GetWindowLong(Me.hwnd, GWL_STYLE) Or WS_SYSMENU Or WS_MINIMIZEBOX
    20.     SetWindowLong Me.hwnd, GWL_STYLE, lStyle
    21.    
    22. End Sub

  8. #8
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: two questions

    Another option to change the icon of your exe is to add an icon to a resource file and set the ID of the icon to APPICON


    Has someone helped you? Then you can Rate their helpful post.

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