Hi,
I have a small utility that when executed is placed in the Systray. The program has 2 systray icons that can change depending on the if statement below, ie:
The problem is that when the Shell_Notifyicon command is executed, the systray refreshes but takes focus from any other application in the foreground, meaning, the a user must click they're own application to bring it back to the foreground.Code:If p1 = True Or p2 = True Or p5 = True Or p6 = True Then prstatus = "Running : " + prstat & Chr(0) With tTrayIcon .hIcon = press1go.Picture .szTip = prstatus End With Else prstatus = Trim("Not Running!") With tTrayIcon .hIcon = press1stop.Picture .szTip = prstatus & Chr(0) End With End If Shell_NotifyIcon &H1, tTrayIcon
I should also mention that I've made the application "Allows on Top" using
Can anyone tell me how I can get the program to refresh in background stoping the program from taking focus?Code:res& = SetWindowPos(Form1.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
Thanks
Craig.




Reply With Quote