Switch between SysTray Icons?

Advanced game related topics
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Switch between SysTray Icons?

Post by Mythros »

Hi all. I was working on my program as usual, but have run into a small problem.

When I minimize my program, it should switch to icon5.ico. If the user double clicks the systray icon it should switch back to the original icon.ico. When double clicking maximize, the maximize code should only work once until it has been re-minimized.

If I did not explain well, I do apologize, and just ask if you want me to explain better! =)

Here is the part of the code that matters:

Code: Select all

 OpenWindowedScreen(WindowID(0), 100, 150, 300, 100, 1, 0, 0, 0)

  CompilerIf #PB_Compiler_OS = #PB_OS_Windows
    ; .ico format is available only on Windows
    IconName$ = "icon.ico"
    IconName2$ = "icon5.ico"
  CompilerElse
    IconName$ = "icon5.ico"
  CompilerEndIf
  
  AddSysTrayIcon(1, WindowID(0), LoadImage(1, IconName$))
  SysTrayIconToolTip(1, "Icon 1")
  
  Repeat
    
    ClearScreen(RGB(240, 240, 240))
    Event = WaitWindowEvent()
    
    ExamineKeyboard()
    
    If Event = #PB_Event_MinimizeWindow
      SetWindowState(0, #PB_Window_Minimize)
      HideWindow(0, 1)
      WindowShowBalloonTip(0, 1, "Test!", "Test!", 1)
      Speak( "eSpeak-en" , "Program minimized successfully!" , 100, 2, 150) ; if the voice Espeak installed 
      Speak( "Microsoft Anna" , "Program minimized successfully!" , 100, 1, 0) ; if the voice Microsoft Anna installed 
    EndIf
    
    If Event = #PB_Event_SysTray
        If EventType() = #PB_EventType_LeftDoubleClick
          ShowWindow(0, 1)
          SetWindowState(0, #PB_Window_Normal)
          SetWindowState(0, #PB_Window_WindowCentered)
          SetWindowPos_(WindowID(0),#HWND_TOPMOST,WindowWidth(0)/2,WindowHeight(0)/2,300,150,#SWP_NOMOVE|#SWP_NOSIZE)
          SysTrayIconToolTip(EventGadget(), "Changed!")
          Speak( "eSpeak-en" , "Program maximized successfully!" , 100, 2, 150) ; if the voice Espeak installed 
          Speak( "Microsoft Anna" , "Program maximized successfully!" , 100, 1, 0) ; if the voice Microsoft Anna installed 
        EndIf
        ChangeSysTrayIcon (EventGadget(), LoadImage(2, IconName2$))
    EndIf
Thank you so much!

P.S. Ignore the microsoft anna stuff. I have that there as a test :P
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Switch between SysTray Icons?

Post by IdeasVacuum »

The SysTray Icon does not need to be a .ico file, you can simply use an image (.bmp, .png), so that is an easy way around the issue.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: Switch between SysTray Icons?

Post by Mythros »

Well see that doesn't really help at least I don't think it will because I merely want to switch between an icon & a 2nd icon. 1 for minimizing, the other for maximizing. plus, i already tried a png. it didn't make a difference.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Switch between SysTray Icons?

Post by IdeasVacuum »

Ah, I think I get you now, you want to display different tray icons depending on the display state of your app. The nearest I have got to that is just changing the icon the next time the app is 'sent' to the tray.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Switch between SysTray Icons?

Post by IdeasVacuum »

EDIT: The following code works:

Code: Select all

UsePNGImageDecoder()  ;Load png file

Enumeration
#Win
#TrayIcon
EndEnumeration

Global igIconMax.i = CatchImage(005,?IconMax)
Global igIconMin.i = CatchImage(006,?IconMin)
Global igIconApp.i = CatchImage(007,?IconApp)

Procedure Win()
;--------------

       If OpenWindow(#Win, 0, 0, 400, 200, "Win", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)

                                   SetWindowTitle(#Win,"Win")
                                   AddSysTrayIcon(#TrayIcon, WindowID(#Win), igIconApp)
                               SysTrayIconToolTip(#TrayIcon, "Win")
       EndIf

EndProcedure

Procedure WaitForUser()
;----------------------
Protected    iEvent.i = 0
Protected     iExit.i = #False

          Repeat
                        iEvent = WaitWindowEvent(1)
                 Select iEvent

                          Case #PB_Event_MaximizeWindow

                                   SetWindowTitle(#Win,"Win Max")
                                ChangeSysTrayIcon(#TrayIcon, igIconMax)
                               SysTrayIconToolTip(#TrayIcon, "Win Maximised")

                          Case #PB_Event_MinimizeWindow

                                   SetWindowTitle(#Win,"Win Min")
                                ChangeSysTrayIcon(#TrayIcon, igIconMin)
                               SysTrayIconToolTip(#TrayIcon, "Win Minimised")

                          Case #PB_Event_RestoreWindow

                                   SetWindowTitle(#Win,"Win")
                                ChangeSysTrayIcon(#TrayIcon, igIconApp)
                               SysTrayIconToolTip(#TrayIcon, "Win")

                          Case #PB_Event_SysTray 

                                    Select EventGadget()

                                               Case #TrayIcon : HideWindow(#Win,#False)
                                    EndSelect

                          Case #PB_Event_CloseWindow

                               iExit = #True

                 EndSelect

          Until iExit = #True

EndProcedure

;###Main Entry Point
Win()
WaitForUser()
End

DataSection
  IconMax:
  Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$6891900000000208,$5948700900000036
  Data.q $0E0000C40E000073,$00001B0E2B9501C4,$DD07454D49740700,$649BA5232D161009,$58457407000000E0
  Data.q $00726F6874754174,$0C00000048CCAEA9,$6373654474584574,$006E6F6974706972,$0A00000023210913
  Data.q $79706F4374584574,$0FAC007468676972,$45740E0000003ACC,$6974616572437458,$00656D6974206E6F
  Data.q $09000000090FF735,$74666F5374584574,$FF705D0065726177,$5845740B0000003A,$69616C6373694474
  Data.q $8FB4C0B70072656D,$7458457408000000,$00676E696E726157,$0700000087E61BC0,$72756F5374584574
  Data.q $00EB83FFF5006563,$4374584574080000,$F600746E656D6D6F,$7406000000BF96CC,$656C746954745845
  Data.q $00000027D2EEA800,$95912854414449EE,$F1C61041434A31D2,$02F00730B4298BDF,$2A4D828822ED1962
  Data.q $97606F3B439E3041,$A58289B10F784BCE,$978688D0B051B062,$0F366C799E2D6626,$F33FE76776298642
  Data.q $D390D59CB059B0CD,$260538A0CAF7945F,$47C8845F25C3B06C,$643A284E4EB16974,$55E16CC681E3D31C
  Data.q $878BD40D66D0DCFA,$7808ED9EE6F87E13,$554C28655A3399E2,$A47C1A6F4472184D,$38A33834F18107CD
  Data.q $982F7A7B1D9C4C44,$EC4E87FFB2AB7643,$149C172A5E0D1A8D,$7C4692A4F3249528,$5C02419C992EE9CE
  Data.q $7B29C87BA733A4D3,$654AA3340740255C,$9C5B390310707DE7,$E4D82E3B96B55B73,$E7D16565F816409D
  Data.q $8E7F652C017A98C3,$00E76F3A8EDE89FB,$AE444E4549000000,$0000000000826042
EndDataSection
DataSection
  IconMin:
  Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$6891900000000208,$5948700900000036
  Data.q $0E0000C40E000073,$00001B0E2B9501C4,$DD07454D49740700,$742CB8332D161009,$5845740700000084
  Data.q $00726F6874754174,$0C00000048CCAEA9,$6373654474584574,$006E6F6974706972,$0A00000023210913
  Data.q $79706F4374584574,$0FAC007468676972,$45740E0000003ACC,$6974616572437458,$00656D6974206E6F
  Data.q $09000000090FF735,$74666F5374584574,$FF705D0065726177,$5845740B0000003A,$69616C6373694474
  Data.q $8FB4C0B70072656D,$7458457408000000,$00676E696E726157,$0700000087E61BC0,$72756F5374584574
  Data.q $00EB83FFF5006563,$4374584574080000,$F600746E656D6D6F,$7406000000BF96CC,$656C746954745845
  Data.q $01000027D2EEA800,$63912854414449C1,$C4C0148188F55CD4,$EF3FD9E6FDF0C0C0,$EF9FEFFFF757E15F
  Data.q $3E4888B035402E77,$AA9C5BD3F7F25E9F,$B7DFE0A5367EFCFF,$291252C2AC0D50CF,$11FAFDFD16A6CFAD
  Data.q $15CA4D9F3FDFEA8B,$606065B3D6E58B74,$2FBBB3D7E1FB8460,$FD7EFE67FB0B3517,$E3E18181882EDF94
  Data.q $ADF61F7C5CCC75E1,$F8443554E2C80E14,$836DF994A4D80201,$220ABFD87E24771E,$79B213A7AADF61F2
  Data.q $30303451AAE03DCD,$E59991917BBF7C30,$F3FC7EBF7F538DFB,$793898276BB7C5EE,$2D1186AC8EBC3C7E
  Data.q $7EFCE5F3FDFFFF58,$DFBFA64646050936,$2232303218AA723E,$0B332322F341602B,$FE191FAFDFCBB1AF
  Data.q $EE8D5341101663FF,$76519F3DF7E72FA4,$FFFF6BC3E7F8CD3B,$E53BA4F2669DBDFE,$D761FFFF0C2DF1D3
  Data.q $3056FB0FFDF9EBF0,$8808B2596970B330,$C7EBBD3E7F682872,$270865088C0CCBBD,$C2E3D5DBF5F1FBFD
  Data.q $C25C437E7F0C3981,$D1F3F563A5CEE66B,$A0F27130BFDF7FF5,$E7274FCFB7DFFA78,$FBFF682870978689
  Data.q $E181818B9D898DF9,$1F3FAC2C8CDF9FFF,$0A7F2A5BA2BD78DD,$BF3F7F49D4273B13,$438ABA2C57313A7F
  Data.q $819AA20181819B41,$8181819585918181,$94D9E0A424434E5D,$78F86D417FBFFF82,$02849B21AAA73D78
  Data.q $2F5FD9E6FDF06E03,$4103C7A105DBF21F,$F631CABA49840000,$45490000000057ED,$0000826042AE444E
EndDataSection
DataSection
  IconApp:
  Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$6891900000000208,$5948700900000036
  Data.q $0E0000C40E000073,$00001B0E2B9501C4,$DD07454D49740700,$F1D3311105171009,$58457407000000FD
  Data.q $00726F6874754174,$0C00000048CCAEA9,$6373654474584574,$006E6F6974706972,$0A00000023210913
  Data.q $79706F4374584574,$0FAC007468676972,$45740E0000003ACC,$6974616572437458,$00656D6974206E6F
  Data.q $09000000090FF735,$74666F5374584574,$FF705D0065726177,$5845740B0000003A,$69616C6373694474
  Data.q $8FB4C0B70072656D,$7458457408000000,$00676E696E726157,$0700000087E61BC0,$72756F5374584574
  Data.q $00EB83FFF5006563,$4374584574080000,$F600746E656D6D6F,$7406000000BF96CC,$656C746954745845
  Data.q $01000027D2EEA800,$9591285441444955,$7FC61050C28A3F92,$60255213E2125659,$16F01795A27C0DE1
  Data.q $11586D884BC52936,$8DA0EF414EC6DAC4,$AF62424C01EA0895,$97644ACD122DBE96,$CCDE61FCC37818FD
  Data.q $43E67C2FF14A69F7,$6981A3402DDB2BD7,$2523DFB6654AD2E6,$5216581860618596,$17D7DE64D4BC3872
  Data.q $18486125CB252042,$E4183042252058B2,$8A25DBA0847BF61A,$9D1144451834E388,$A44A47D27364420E
  Data.q $D2D3972997288A24,$CB648FCA93649FA7,$09ECCB4D1F7E89D3,$7B76E274E3D7A34D,$4A218418615ABD2C
  Data.q $19F398E297D9C711,$31FAF5830C0208A5,$E22C539F33EF8121,$73E64D3071C46938,$85960B97ACF5E082
  Data.q $711CBF1E302851E7,$AE2CB0F3C050A234,$00D5AE984B429457,$1B7693669F7C77EE,$D254A86CD94E98A5
  Data.q $080E1DC41FBB764D,$3AE8DB616AD2EB81,$94BAE16AD36D8EBA,$948306E2398F1C4A,$C98CD98CD984C9B8
  Data.q $1DF0E18952956A84,$D5E5A1A53F9CC9D3,$88DFD7ABE2A5BB7A,$31EF06F8EFC34DEF,$00005593A3106FE5
  Data.q $42AE444E45490000,$0000000000008260
EndDataSection
Last edited by IdeasVacuum on Tue Sep 17, 2013 1:43 pm, edited 1 time in total.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: Switch between SysTray Icons?

Post by Mythros »

Thanks, but it's showing both icons at the same time 1 right next to another. If you can make it switch BETWEEN those 2, 1 when the screen is minimized, and the 2nd 1 when the user re-opens the window, that would be GREAT! Thanks ALOT you guys! =)
Fred
Administrator
Administrator
Posts: 18224
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Switch between SysTray Icons?

Post by Fred »

I don't understand, what's wrong with ChangeSystrayIcon() ?

Code: Select all

UsePNGImageDecoder()  ;Load png file

Enumeration
#Win
#TrayIconMax
#TrayIconMin
#TrayIconApp
EndEnumeration

Global igIconMax.i = CatchImage(005,?IconMax)
Global igIconMin.i = CatchImage(006,?IconMin)
Global igIconApp.i = CatchImage(007,?IconApp)

Procedure Win()
;--------------

       If OpenWindow(#Win, 0, 0, 400, 200, "Win", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered)

                                   SetWindowTitle(#Win,"Win")
                                   AddSysTrayIcon(#TrayIconMax, WindowID(#Win), igIconApp)
                               SysTrayIconToolTip(#TrayIconMax, "Win")
       EndIf

EndProcedure

Procedure WaitForUser()
;----------------------
Protected    iEvent.i = 0
Protected     iExit.i = #False

          Repeat
                        iEvent = WaitWindowEvent(1)
                 Select iEvent

                          Case #PB_Event_MaximizeWindow

                                   SetWindowTitle(#Win,"Win Max")
                                   ChangeSysTrayIcon(#TrayIconMax, igIconMax)
                               SysTrayIconToolTip(#TrayIconMax, "Win Maximised")

                          Case #PB_Event_MinimizeWindow

                                   SetWindowTitle(#Win,"Win Min")
                                   ChangeSysTrayIcon(#TrayIconMax, igIconMin)
                               SysTrayIconToolTip(#TrayIconMin, "Win Minimised")

                          Case #PB_Event_RestoreWindow

                                   SetWindowTitle(#Win,"Win")
                                   ChangeSysTrayIcon(#TrayIconMax, igIconApp)
                               SysTrayIconToolTip(#TrayIconMax, "Win")

                          Case #PB_Event_SysTray

                                    Select EventGadget()

                                               Case #TrayIconMax : HideWindow(#Win,#False)
                                               Case #TrayIconMin : HideWindow(#Win,#False)
                                               Case #TrayIconApp : HideWindow(#Win,#False)
                                    EndSelect

                          Case #PB_Event_CloseWindow

                               iExit = #True

                 EndSelect

          Until iExit = #True

EndProcedure

;###Main Entry Point
Win()
WaitForUser()
End

DataSection
  IconMax:
  Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$6891900000000208,$5948700900000036
  Data.q $0E0000C40E000073,$00001B0E2B9501C4,$DD07454D49740700,$649BA5232D161009,$58457407000000E0
  Data.q $00726F6874754174,$0C00000048CCAEA9,$6373654474584574,$006E6F6974706972,$0A00000023210913
  Data.q $79706F4374584574,$0FAC007468676972,$45740E0000003ACC,$6974616572437458,$00656D6974206E6F
  Data.q $09000000090FF735,$74666F5374584574,$FF705D0065726177,$5845740B0000003A,$69616C6373694474
  Data.q $8FB4C0B70072656D,$7458457408000000,$00676E696E726157,$0700000087E61BC0,$72756F5374584574
  Data.q $00EB83FFF5006563,$4374584574080000,$F600746E656D6D6F,$7406000000BF96CC,$656C746954745845
  Data.q $00000027D2EEA800,$95912854414449EE,$F1C61041434A31D2,$02F00730B4298BDF,$2A4D828822ED1962
  Data.q $97606F3B439E3041,$A58289B10F784BCE,$978688D0B051B062,$0F366C799E2D6626,$F33FE76776298642
  Data.q $D390D59CB059B0CD,$260538A0CAF7945F,$47C8845F25C3B06C,$643A284E4EB16974,$55E16CC681E3D31C
  Data.q $878BD40D66D0DCFA,$7808ED9EE6F87E13,$554C28655A3399E2,$A47C1A6F4472184D,$38A33834F18107CD
  Data.q $982F7A7B1D9C4C44,$EC4E87FFB2AB7643,$149C172A5E0D1A8D,$7C4692A4F3249528,$5C02419C992EE9CE
  Data.q $7B29C87BA733A4D3,$654AA3340740255C,$9C5B390310707DE7,$E4D82E3B96B55B73,$E7D16565F816409D
  Data.q $8E7F652C017A98C3,$00E76F3A8EDE89FB,$AE444E4549000000,$0000000000826042
EndDataSection
DataSection
  IconMin:
  Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$6891900000000208,$5948700900000036
  Data.q $0E0000C40E000073,$00001B0E2B9501C4,$DD07454D49740700,$742CB8332D161009,$5845740700000084
  Data.q $00726F6874754174,$0C00000048CCAEA9,$6373654474584574,$006E6F6974706972,$0A00000023210913
  Data.q $79706F4374584574,$0FAC007468676972,$45740E0000003ACC,$6974616572437458,$00656D6974206E6F
  Data.q $09000000090FF735,$74666F5374584574,$FF705D0065726177,$5845740B0000003A,$69616C6373694474
  Data.q $8FB4C0B70072656D,$7458457408000000,$00676E696E726157,$0700000087E61BC0,$72756F5374584574
  Data.q $00EB83FFF5006563,$4374584574080000,$F600746E656D6D6F,$7406000000BF96CC,$656C746954745845
  Data.q $01000027D2EEA800,$63912854414449C1,$C4C0148188F55CD4,$EF3FD9E6FDF0C0C0,$EF9FEFFFF757E15F
  Data.q $3E4888B035402E77,$AA9C5BD3F7F25E9F,$B7DFE0A5367EFCFF,$291252C2AC0D50CF,$11FAFDFD16A6CFAD
  Data.q $15CA4D9F3FDFEA8B,$606065B3D6E58B74,$2FBBB3D7E1FB8460,$FD7EFE67FB0B3517,$E3E18181882EDF94
  Data.q $ADF61F7C5CCC75E1,$F8443554E2C80E14,$836DF994A4D80201,$220ABFD87E24771E,$79B213A7AADF61F2
  Data.q $30303451AAE03DCD,$E59991917BBF7C30,$F3FC7EBF7F538DFB,$793898276BB7C5EE,$2D1186AC8EBC3C7E
  Data.q $7EFCE5F3FDFFFF58,$DFBFA64646050936,$2232303218AA723E,$0B332322F341602B,$FE191FAFDFCBB1AF
  Data.q $EE8D5341101663FF,$76519F3DF7E72FA4,$FFFF6BC3E7F8CD3B,$E53BA4F2669DBDFE,$D761FFFF0C2DF1D3
  Data.q $3056FB0FFDF9EBF0,$8808B2596970B330,$C7EBBD3E7F682872,$270865088C0CCBBD,$C2E3D5DBF5F1FBFD
  Data.q $C25C437E7F0C3981,$D1F3F563A5CEE66B,$A0F27130BFDF7FF5,$E7274FCFB7DFFA78,$FBFF682870978689
  Data.q $E181818B9D898DF9,$1F3FAC2C8CDF9FFF,$0A7F2A5BA2BD78DD,$BF3F7F49D4273B13,$438ABA2C57313A7F
  Data.q $819AA20181819B41,$8181819585918181,$94D9E0A424434E5D,$78F86D417FBFFF82,$02849B21AAA73D78
  Data.q $2F5FD9E6FDF06E03,$4103C7A105DBF21F,$F631CABA49840000,$45490000000057ED,$0000826042AE444E
EndDataSection
DataSection
  IconApp:
  Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$6891900000000208,$5948700900000036
  Data.q $0E0000C40E000073,$00001B0E2B9501C4,$DD07454D49740700,$F1D3311105171009,$58457407000000FD
  Data.q $00726F6874754174,$0C00000048CCAEA9,$6373654474584574,$006E6F6974706972,$0A00000023210913
  Data.q $79706F4374584574,$0FAC007468676972,$45740E0000003ACC,$6974616572437458,$00656D6974206E6F
  Data.q $09000000090FF735,$74666F5374584574,$FF705D0065726177,$5845740B0000003A,$69616C6373694474
  Data.q $8FB4C0B70072656D,$7458457408000000,$00676E696E726157,$0700000087E61BC0,$72756F5374584574
  Data.q $00EB83FFF5006563,$4374584574080000,$F600746E656D6D6F,$7406000000BF96CC,$656C746954745845
  Data.q $01000027D2EEA800,$9591285441444955,$7FC61050C28A3F92,$60255213E2125659,$16F01795A27C0DE1
  Data.q $11586D884BC52936,$8DA0EF414EC6DAC4,$AF62424C01EA0895,$97644ACD122DBE96,$CCDE61FCC37818FD
  Data.q $43E67C2FF14A69F7,$6981A3402DDB2BD7,$2523DFB6654AD2E6,$5216581860618596,$17D7DE64D4BC3872
  Data.q $18486125CB252042,$E4183042252058B2,$8A25DBA0847BF61A,$9D1144451834E388,$A44A47D27364420E
  Data.q $D2D3972997288A24,$CB648FCA93649FA7,$09ECCB4D1F7E89D3,$7B76E274E3D7A34D,$4A218418615ABD2C
  Data.q $19F398E297D9C711,$31FAF5830C0208A5,$E22C539F33EF8121,$73E64D3071C46938,$85960B97ACF5E082
  Data.q $711CBF1E302851E7,$AE2CB0F3C050A234,$00D5AE984B429457,$1B7693669F7C77EE,$D254A86CD94E98A5
  Data.q $080E1DC41FBB764D,$3AE8DB616AD2EB81,$94BAE16AD36D8EBA,$948306E2398F1C4A,$C98CD98CD984C9B8
  Data.q $1DF0E18952956A84,$D5E5A1A53F9CC9D3,$88DFD7ABE2A5BB7A,$31EF06F8EFC34DEF,$00005593A3106FE5
  Data.q $42AE444E45490000,$0000000000008260
EndDataSection
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Switch between SysTray Icons?

Post by davido »

@Fred,

Thank you for a nice demo. :D

I find an error in line 45:
Should line 45, therefore, read: SysTrayIconToolTip(#TrayIconMax, "Win Minimised")
DE AA EB
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Switch between SysTray Icons?

Post by IdeasVacuum »

I don't understand, what's wrong with ChangeSystrayIcon() ?
...nothing at all if you know the function exists :mrgreen:
@Davido, see my corrected code above.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Switch between SysTray Icons?

Post by davido »

@IdeasVacuum,

Sorry. I should have re-read the whole thread, not relied upon my memory! :oops:
DE AA EB
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Switch between SysTray Icons?

Post by Thunder93 »

In Debugger mode only w/ PB 5.20 LTS (x86)
davido wrote:@Fred,

Thank you for a nice demo. :D

I find an error in line 45:
Should line 45, therefore, read: SysTrayIconToolTip(#TrayIconMax, "Win Minimised")
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: Switch between SysTray Icons?

Post by Mythros »

Yup, THAT works, Fred. Thanks alot guys for all the help! Btw, how do you turn an image into a data statement? :?:
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Switch between SysTray Icons?

Post by IdeasVacuum »

@Thunderbird, see my corrected code above.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Thunder93
Addict
Addict
Posts: 1788
Joined: Tue Mar 21, 2006 12:31 am
Location: Canada

Re: Switch between SysTray Icons?

Post by Thunder93 »

lol...

That corrected it. :)
ʽʽSuccess is almost totally dependent upon drive and persistence. The extra energy required to make another effort or try another approach is the secret of winning.ʾʾ --Dennis Waitley
Post Reply