ExtractIconA failure

BlitzMax Forums/BlitzMax Programming/ExtractIconA failure

Grey Alien(Posted 2006) [#1]
OK, I'm trying to extract the icon from an icon file so I can set it in the top left of the app window. Problem is, in the following code, icon is always 0, so ExtractIconA is not working as it should. The icon file exists in the same folder as the app. This code totally works in Blitz Plus, what am I doing wrong? Help please ... thanks.

Extern "win32"
	Function FindWindowA:Int(nullstring%,WindowText$z)
	Function ExtractIconA:Int(hWnd%,File$z,Index%)
End Extern

AppTitle = "test"
Graphics 640,320,0
Cls
Local handle:Int = FindWindowA(0,"test")

Local icon:Int = ExtractIconA(handle, "framework.ico", 0)
DrawText handle,0,0
DrawText icon,0,20
Flip
WaitKey



Grey Alien(Posted 2006) [#2]
scrap that, seems it needed a non relative path. How lame is that... I tried the non-relative path about an hour ago before I found out about $z for C string ... arg!!