May 112012
 

It’s been a long time since anything’s hijacked my computer, thank goodness, but I had a recent adventure with Babylon and it’s toolbar and new tab hijack. I was out searching for a screen video capture application and stupidly downloaded one that had one of those website “installers” attached to it and it installed the Babylon toolbar, altered my homepage and wrote to the registry without notifying me first totally pissing me off.

So I set out removing the toolbar and did a search for everything else named “Babylon” on my computer and deleteing it from my system but the new tab in IE8 and google Chrome still kept coming up to the babylon search page. That really ticked me off so I did a search on google about how to fix it and found the solution here.

How To Restore about:Tabs (New Tab) Page in IE8 Hijacked by BigSeekPro/Babylon Toolbar

Pretty pitiful that they place their crap in the registry, I suppose they believe that most people get frustrated with it after a while and let it go.

So anyway that’s my rant about malware.

Also if anyone knows any decent video screen capture software I’d appreciate a link, I tryed Cam Studio but it won’t start because it says the configuration is incorrect so any pointers about that would nice too.

 

 

May 062012
 

Well, after my last attempt at making fire I decided that I wasn’t actually happy with the way it looked, so I set trying to find an example to convert that would look more realistic.

I ran across this program on Planet Source Code of fire using GDI+ .

I didn’t add any of the timer routines  or anything just rendered the fire.

There’s not a lot of examples out there using the flat API so I depended on José Roca’s excellent GDI+ Flat API reference website.

The GDI+ portion isn’t really very complicated at all using:

  • GdipCreateBitmapFromGraphics
  • GdipBitmapLockBits
  • GdipBitmapUnlockBits
  • GdipDrawImageRect

The only real hang up I had was rendering the colors properly until I realized that my aRGB macro wasn’t working as well as I thought, so I altered it using MiniBasics native RGB command and adding an alpha value to it.

func aRGB(int a,int r,int g,int b),int
return a<<24|RGB(r,g,b)
endf

Anyway, the zip file contains the source and _GDI+.mba file plus the executable.

Enjoy.

fire example MiniBasic

Apr 302012
 

I’ve been working on this on and off trying to get a passable fire in a window using SetPixelV, unfortunately this is the best I could do.

This is a conversion from a script written in FBSL by Mike LOBANOVSKY, I don’t know if his name has to be all in caps or not so I left it that way.

Anyway his method seems to work better than any of the others I’ve tried so here it is.

Source is in the zip.

 

Flames.

Apr 262012
 

Windows themes can be pretty easy on the eyes but they do have a tendency to limit simple ways to alter the look of of your application.

That’s where SetWindowTheme comes in handy to disable themes for specific controls.

You can basically pass the handle of the control that you wish to disable themes to and override it to use messages and styles that don’t apply when themes are enabled.

I’m by no means an expert with this API call but to disable the theme of a specific control in MiniBasic I use it like this.

/*Remove themes here*/

SetWindowTheme(hprogress,”",”")
SetWindowTheme(hbutton,”",”")

/*Remove themes here*/

The enclosed zip file contains a program that shows the memory percentage used with 2 progressbars and 2 buttons, one themed one not.

The buttons are non-functional.

Themes

Apr 232012
 

Who knows how long these will be around but I’ve neglected to put up my take on placing an icon in the “windows tray” or whatever anyone wants to call it.

This is the simplist that I have been able to boil it down to, I had to use the api to create the popup menu for it but MiniBasics menu commands work fine.

The program along with a little demo icon is in the zip.

enjoy.

TrayApp.

 

Apr 222012
 

Spent most of today re-installing WinXP pro on my computer today.

I forgot how nice and clean your system starts out before we muck it up with all kinds of garbage over time.

I’m re-evaluating the programs I’m going to download after I get all the essentials set-up, antivirus, music, Irfanview as my main picture viewer, google chrome and MiniBasic.

I’m looking for a good, free journal software program and another FTP client.

Hopefully I’ll be back up to full steam by tomorrow.

 

Apr 172012
 

Worked on something all night and you’re so close to getting it the way you wnat and one thing after the other keeps popping up?

I’m having one of those, I’ve always wanted to make a small practical application using the SysLink control, and creating it and getting the link seems to be working OK.

win.AddControlEx(“SysLink”,”<A HREF=\”http://www.codercreations.com\“>Coder Creations</A>”,20,30,300,30,WS_VISIBLE|WS_CHILD|WS_TABSTOP,0,100)
win.AddControlEx(“SysLink”,”<A HREF=\”http://patchlabs.net\“>Patch Labs</A>”,20,60,200,30,WS_VISIBLE|WS_CHILD|WS_TABSTOP,0,200)

I’ve even got the control executing the urls’ correctly.

case ID_CONTROL
IF win.controlid = 100
link = L”"
li.szUrl = L”http://www.codercreations.com\\
openlink(li.szUrl)
endif
IF win.controlid = 200
link = L”"
li.szUrl = L”http://patchlabs.net\\
openlink(li.szUrl)
endif

But it just refuses to behave the way I want it to.

The fun of hobby programming, I’m going to give it rest and go to bed so I can work on it tomorrow. Hopefully a solution will come to me.

Apr 152012
 

I’ve been working with GDI+ following the excellent examples by José Roca posted at his forum along with his very comprehensive flat GDI+ api website.

Great information there.

Here’s a screen shot of a program that creates and fills text using a path object.

 

 

 

 

 

##NOCONSOLE
##include “_GDI+.mba”
RECTF rcf
PointF ptf[3]
WINDOW win
int pStartup

win.Open(0,0,440,200,WS_OVERLAPPEDWINDOW|WS_VISIBLE|CENTERED,0,”Test Window”,NULL,&handler)
win.SetWindowColor(RGB(0,0,0))

do:processmessages():until win.GetHandle()=NULL

func handler(WINDOW wnd),int
select wnd.Message
case WM_PAINT
hdc = win.GetHDC()
_StringPath(hdc)

     case ID_CLOSE
wnd.ReleaseHDC(hdc)
GdiplusShutdown(pStartup)
          wnd.Close()
endselect
return 0

endf
func _StringPath(int hdc)
int hStatus,pPath,pFontFamily,pGraphics,pPen,pGradient
wstring strFontName,strText
pStartup = GDIBegin()
hStatus = GdipCreateFromHDC(hdc,pGraphics)
GdipCreatePath(FillModeAlternate,&pPath)

strFontName = L”Lucida Handwriting”
hStatus = GdipCreateFontFamilyFromName(strFontName,NULL,&pFontFamily)

strText = L”MiniBasic”
          rcf.x = 50 : rcf.y = 30 : rcf.Width = 350 : rcf.Height = 50
hStatus = GdipAddPathString(pPath,strText,-1,pFontFamily,FontStyleRegular,52,&rcf,NULL)
hStatus = GdipCreatePen1(aRGB(0,0,0,0),1,UnitWorld,&pPen)
hStatus = GdipDrawPath(pGraphics,pPen,pPath)
          ptf[1].x= 50:ptf[1].y = 30:ptf[2].x = 350:ptf[2].y = 30
hStatus = GdipCreateLineBrush(ptf[1],ptf[2],aRGB(255,255,255,128),aRGB(255,255,128,64),1,&pGradient)
GdipFillPath(pGraphics,pGradient,pPath)

GdipDeleteFontFamily(pFontFamily)
GdipDeletePen(pPen)
GdipDeleteBrush(pGradient)
GdipDeletePath(pPath)
GdipDeleteGraphics(pGraphics)
return
endf

func GDIBegin(),int
     int pToken=0
     GdiplusStartupInput gsi
     gsi.GdiplusVersion = 1
     gsi.DebugEventCallback = NULL
     gsi.SuppressBackgroundThread = FALSE
     gsi.SuppressExternalCodecs = FALSE
GdiplusStartup(pToken,gsi,NULL)
     Return pToken
endf

The _GDI+.mba file is available at the link to the right under MiniBasic Resources,.

Apr 132012
 

Friday the 13th always seems to sneak up on ya, so I decided to write a little program that will tell you what months contain the unlucky days.

Since any month that starts on a Sunday has a Friday that falls on a 13th then we’ll search for those months.

 This little program will return the months over the next decade.

If you need more than that it’s easy to modify.

Written in MiniBasic of course.

@CDECL EXTERN _system(pointer cmd)
_system("COLOR 4f")
string month[12]
month = "January ","February ","March ","April ","May ","June ",_
"July ","August ","September ","October ","November ","December "
print "Year   Months with Fri. 13"
print "---------------------------"
for y = 2012 to 2022
print y,
for i = 1 to 12
if FirstDayOfMonth(y,i) = 0
print " ",month[i - 1],
endif
next i
print "\n"
next y
DO:UNTIL INKEY$<>""
END
func FirstDayOfMonth(int year,int month),int
	'0 = Sunday
	int t[12]
	int y = year - (month < 3)
	t = 0,3,2,5,0,3,5,1,4,6,2,4
	return (y + y/4 - y/100 + y/400 + t[month-1] + 1) % 7
endf
Apr 102012
 

Way of the Dodo.Can’t say we weren’t warned. The messenger doesn’t matter, the reminder is real.

 

 

 

Death Watch: Microsoft to kill Windows XP in two years

The end is coming. Repent!

That’s the message from Microsoft as it reminded consumers that its support for Windows XP SP3 and Office 2003 will end on April 8, 2014.

According to Microsoft marketing director Stella Chernyak that means the software giant will nix security updates, non-security hot-fixes and technical support after that date. So let the countdown begin. You now have less than two years to get your affairs in order and hightail it to more current software.
Chernyak commented in a blog post that “Windows XP and Office 2003 were great software releases in their time, but the technology environment has shifted. Technology continues to evolve and so do people’s needs and expectations.” [How to Install Windows 8 Consumer Preview]

This should come as no surprise, since the announcement is consistent with Microsoft’s 2002 support lifestyle policy that offers a minimum of 10 years of support (at least five years of mainstream support and five additional years of extended support).
 

I’ve been using WinXp for years now and and will be sad to see it go, it’s been a stable and very reliable OS for me.

But, as they say, all things must change so I intend on getting me a new computer with a new OS later this summer.

Seeing as how this one is still very usable I can see a Linux install on it very soon, something I’ve been curious about for a while.