Size of taskbar

Blitz3D Forums/Blitz3D Programming/Size of taskbar

Virtech(Posted 2009) [#1]
Hi

Is it somehow possible to get the current size (width & height) of the taskbar from blitz3d, using some decls magic?


BlitzSupport(Posted 2009) [#2]
Here you go...



Run the demo after adding the .decls stuff to your userlibs, and try dragging the taskbar around to different locations -- it updates in real time. (You might have to unlock the taskbar first of course.)


Virtech(Posted 2009) [#3]
This is exactly what I was looking for + the missing bits I forgot about...x,y coords ;)

Works great on xp, havent had a chance to try vista. Maybe someone else can confirm?

Thanks! :)


Nate the Great(Posted 2009) [#4]
wow a nifty little program! maybe it will be of some use some day... although im not sure why you would ever need to know where the task bar is for a game :D


Adam Novagen(Posted 2009) [#5]
Desktop interactivity, I'll bet; let the player fight a war on his/her own computer front! 8)


John Blackledge(Posted 2009) [#6]
Nice.
James, how do you get the colour? (If a Blitz program wanted to duplicate the task bar look)


Virtech(Posted 2009) [#7]
The reason I needed this is that I want to start my blitz application in widowed mode=desktop size, but I still want the taskbar to be visible.


BlitzSupport(Posted 2009) [#8]
John, that would be trickier, since most people will have a themed taskbar (XP/Vista), so it's not just one colour. (I tried getting the list of system colours for non-themed desktops, but it was failing for some reason.)

I just found the XP Theme functions, though, which apparently should let me retrieve the bitmaps for each part of a window, menu, taskbar, etc, so I'll be fiddling with that anyway.


John Blackledge(Posted 2009) [#9]
James,

I dug out some very old C code of mine - might useful to someone:
	crBackClr = GetSysColor(COLOR_ACTIVECAPTION);
	crTextClr = GetSysColor(COLOR_CAPTIONTEXT);
	backr = GetRValue(crBackClr);
	backg = GetGValue(crBackClr);
	backb = GetBValue(crBackClr);
	highr = min(255,backr*1.5);
	highg = min(255,backg*1.5);
	highb = min(255,backb*1.5);
	shadr = backr*.5;
	shadg = backg*.5;
	shadb = backb*.5;
	textr = GetRValue(crTextClr);
	textg = GetGValue(crTextClr);
	textb = GetBValue(crTextClr);