Is this windows style possible?

BlitzMax Forums/BlitzMax GUI Programming/Is this windows style possible?

Here's an example. I can only get the menu handle by querying the root menu. I can load the bitmap successfully. However, SetMenuItemBitmaps always fails. Everything I have read indicates that this should work, unless Blitz is doing something weird internally:

Extern "Win32"
	Function LoadImageA:Int(hInst%,filename$z,typ%,desiredX%,desiredY%,fuLoad%)
	Function LoadBitmap:Int(hInstance,lpBitmapName$)="LoadBitmapA@8"
	Function SetMenuItemBitmaps:Int(hMenu,uPosition,uFlags,hBitmapUnchecked,hBitmapChecked)="SetMenuItemBitmaps@20"
EndExtern

w=400
h=300
style=WINDOW_TITLEBAR+WINDOW_RESIZABLE+WINDOW_STATUS+WINDOW_MENU
window:tgadget=CreateWindow("Menu Icons",(ClientWidth(Desktop())-w)/2,(ClientHeight(Desktop())-h)/2,w,h,Null,style)

root:TGadget=WindowMenu(window)
menu:TGadget=CreateMenu("File",0,root)
menuitem:TGadget=CreateMenu("Open...",69,menu)

UpdateWindowMenu window

hbitmap=LoadImageA(Null,AppDir$+"\test.bmp",0,0,0,$10)

If hbitmap
	hmenu=QueryGadget(root,QUERY_HWND)
	If hmenu
		result=SetMenuItemBitmaps(hmenu,1,1024,hbitmap,hbitmap)
		If Not result Notify "SetMenuItemBitmaps() failed."
	Else
		Notify "Failed to retrieve menu handle."
	EndIf
Else
	Notify "LoadImageA() failed."
EndIf


Repeat
	Select WaitEvent()
		Case EVENT_WINDOWCLOSE
			End
	EndSelect
Forever