Results 1 to 3 of 3

Thread: [RESOLVED] Icon On Taskbar!

  1. #1

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Resolved [RESOLVED] Icon On Taskbar!

    I have a VB6 app which uses 10 Forms. Apart from the start-up Form the other 9 Forms load when a menu item is clicked.

    When the app starts & the start-up Form loads, the icon on the Taskbar is shown "depressed" meaning that my app is currently being used by the user. Now when I click a menu item & one of the 9 Forms gets loaded, I find that the icon in the Taskbar no longer remains "depressed" although the user is currently using my app wherein the focus is not on the start-up Form but on some other Form. If the loaded Form is closed i.e. the focus shifts back to the start-up Form, then the icon in the Taskbar again can be seen "depressed". This happens with a MsgBox as well.

    So how do I ensure that the icon in the Taskbar always remains "depressed" when the user is working with my app (irrespective of whether the focus is on the start-up Form or on any of the other 9 Forms)?

    Please note that all the Forms (of course, other than the start-up Form) are modal.


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  2. #2

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Re: Icon On Taskbar!

    No answers?? I thought this might be an easy question


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  3. #3

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Re: Icon On Taskbar!

    Well guys, this is how you can always make the icon on the Taskbar look "depressed" when your app is in the focus but the user is not working with the main Form of your app but with some other Form other than the main Form:
    VB Code:
    1. Private Const GWL_HWNDPARENT = -8
    2. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    3.  
    4. Private Sub Form_Load()
    5.     SetWindowLong Me.hwnd, GWL_HWNDPARENT, 0
    6. End Sub
    But I must confess that when I searched for the solution in this Forum, I found it pretty strange that no one has asked this question ever in this Forum & I am pretty sure that I definitely must not be the first VB programmer in this world to encounter this problem!

    Anyways............all's well that ends well


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

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