Size of taskbar
Blitz3D Forums/Blitz3D Programming/Size of taskbar
| ||
Hi Is it somehow possible to get the current size (width & height) of the taskbar from blitz3d, using some decls magic? |
| ||
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.) |
| ||
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! :) |
| ||
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 |
| ||
Desktop interactivity, I'll bet; let the player fight a war on his/her own computer front! 8) |
| ||
Nice. James, how do you get the colour? (If a Blitz program wanted to duplicate the task bar look) |
| ||
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. |
| ||
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. |
| ||
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); |