Icon on the quicklaunch toolbar

Blitz3D Forums/Blitz3D Programming/Icon on the quicklaunch toolbar

splinux(Posted 2005) [#1]
In wich way could i put the icon of the minimized program(written in BlitzBasic and running) on the quicklaunch bar?


Neochrome(Posted 2005) [#2]
you would probably better off putting the icon in the system tray when you minimize the program, there is code to do this but the search function is off!


splinux(Posted 2005) [#3]
Could you help me to search?


Damien Sturdy(Posted 2005) [#4]
You can't put it in the quicklaunch bar, this is basically another folder with a bunch o' shortcuts :)

Search is brokendiddly broken so no help at the mo i'm afraid :(


ozak(Posted 2005) [#5]
Yep. You've probably go them mixed up.
Quicklaunch is a toolbar with shortcuts whereas the system tray is the small icons on your lower right.
You'll need a dll with system calls for that one.
Try this one http://www.blitzbasic.com/codearcs/codearcs.php?code=1140


splinux(Posted 2005) [#6]
So, using this dll i can put my program on the quicklaunch bar, and i'll see only that icon for my program?


Damien Sturdy(Posted 2005) [#7]
this DLL will allow you to place the icon for your program in the "SYSTEM TRAY", while your main app is actually invisible :)


splinux(Posted 2005) [#8]
where can i get the FindWindowUltimate() function?


ozak(Posted 2005) [#9]
There are plenty of libraries for blitz that can do this.
Try a google search as this was how I found the article above :)


splinux(Posted 2005) [#10]
In the example source there was a link to this site, but it says internel error.
Could anyone copy it on the next post, please?


splinux(Posted 2005) [#11]
FindWindowUltimate() it's used to find the window hwnd.
So, this user32.dll function works too:

api_FindWindow("Blitz Runtime Class", "test")


Now, the problem is, given this example program, in wich way could i only keep the program icon on the system tray as minimized but running?

example progra:


; !*! this demo is for Blitz3D only. please use trayexamp.bb for BlitzPlus

; TODO: you will need to place the ggTray.dll and ggTray.decls files in a folder called userlibs under your B3D directory
; TODO: ggTray.dll will need to be in the same directory that your EXE resides in if you compile
; TODO: you need to include the FindWindowUltimate() function or something similar. it requires some entries in user32.decls and
; is located at http://www.blitzbasic.com/Community/posts.php?topic=18287
;

; TODO: either compile and run the EXE or change cAppDir$ to the hard location of the ICOs. if you choose to compile, be
; sure to put the ggTray.dll in the same directory as your EXE
;Local cAppDir$=SystemProperty("appdir")
Local cAppDir$=""

AppTitle "test"

Global cIconStop$=cAppDir$+"stop.ico"
Global cIconStart$=cAppDir$+"usergrp.ico"

; set the graphics
Graphics 400,100,16,2

If FileType(cIconStop$)<>1
Cls
Text 110,10,"you must set the icon path",True
Else

; TODO: you will need to include the FindWindowUltimate() function and its requirements
; or something similar To get the main window handle

; show the initial icon
ggTrayCreate(api_FindWindow("Blitz Runtime Class", "test"))

; set the icon
ggTraySetIconFromFile(cIconStop$)

; set the tooltip
ggTraySetToolTip("Tray Example Stopped")

; show the icon with the updated text
ggTrayShowIcon()

; main loop to handle events
Repeat

; check for a right click
If ggTrayPeekRightClick()>0
; check the tooltip to see what status we are currently at
If Instr(ggTrayGetToolTip(),"Stopped")>0
; set the icon and a new tip
ggTraySetIconFromFile(cIconStart$)
ggTraySetToolTip("Tray Example Started")
Else
; set the icon and a new tip
ggTraySetIconFromFile(cIconStop$)
ggTraySetToolTip("Tray Example Stopped")
EndIf

; TODO: show your menu here at the event mousex,mousey
Cls
Text 110,10,"click occurred at: "+ggTrayEventMouseX(ggTrayPeekRightClick())+","+ggTrayEventMouseY(ggTrayPeekRightClick()),True

; clear out the events
ggTrayClearEvents()
EndIf

; check for a left doubleclick
If ggTrayPeekLeftDblClick()>0
Exit
EndIf
Forever

; clean up the tray
ggTrayDestroy()
EndIf




Picklesworth(Posted 2005) [#12]
Somehow, it seems that only myself and the person who told me this actually know this...

To find the Blitz window handle:
SystemProperty$("apphWnd") ;This is a native Blitz function


Please try to pass this knowledge along. It's a very sad and lonely function.
http://www.blitzbasic.com/b3ddocs/command.php?name=SystemProperty&ref=2d_cat


splinux(Posted 2005) [#13]
Thanks. But now, in wich way could i keep the program icon only on the system tray as minimized but running?


Damien Sturdy(Posted 2005) [#14]
Narr. Mr Picklesworth, See, I know it too :)


splinux(Posted 2005) [#15]
So?
Please, i need help.


Damien Sturdy(Posted 2005) [#16]
Sorry SP, i posted a pointless post.

What you need to do with what Pickles just posted, is add it to the above code-
And in the code, instead of FindWindowUltimate, use this instead :)


splinux(Posted 2005) [#17]
Do you know how to do it?


Damien Sturdy(Posted 2005) [#18]
I'm not at a system where i can try. :/


splinux(Posted 2005) [#19]
Yes, but do you have any ideas wich i can try?


Damien Sturdy(Posted 2005) [#20]
try what i wrote in the post before last...


splinux(Posted 2005) [#21]
Yes, applied. But the problem wasn't it.
The problem is that i don't want that the window is visible: if an user minimizes the window, on the bottom bar there is its icon and its name. I don't want them. I want that the program runs on the system tray: so, its minimized but running and don't disturb the user.


Damien Sturdy(Posted 2005) [#22]
Oh, I see. Sorry for wasting your time... There was a blitz hack to do that somewhere- Search isnt working though so godknows where.

Besides.. with that aspect, someone else should be able to help other than me.


splinux(Posted 2005) [#23]
If anyone would help me, please post.


splinux(Posted 2005) [#24]
I FOUND THE SOLUTION. It was in an old old old post.

Look at this code. It doesn't do anything, only store a number onto i, for 11 times(i did it to verify if the program was running) and make the windows invisible but active.
If you press ctrl-alt-del, you won't see anything. It's great!


api_ShowWindow(SystemProperty$("apphWnd"),0)

For i=0 To 10
Delay 1000
Next

WaitKey()
End




asdfasdf(Posted 2005) [#25]
You could use my CreateShortcut DLL and the take the .ink file and move it to the quicklauch which is located in an Internet Explorer folder.


splinux(Posted 2005) [#26]
i mean another thing, and the previous program is the best for what i want.


Picklesworth(Posted 2005) [#27]
Why does it have delay 1000 in it every loop?


splinux(Posted 2005) [#28]
In this way i can, stopping the program from the debugger, see if the program works seeing the "i" value. I can't print because the window come visible...