I modified this from some code on the forums to see if it was possible... And it works for me...
Code: Select all
Procedure.l WideStr(String$)
widelen.w = 2*Len(PeekS(String$))+2
widebuf.l = AllocateMemory(widelen)
longlen.w = MultiByteToWideChar_(#CP_ACP,0,String$,-1,widebuf,widelen)
ProcedureReturn widebuf
EndProcedure
hinst=GetModuleHandle_(0)
classname$="mywndclass"
Procedure mainwndproc(hwnd,msg,wparam,lparam)
Select msg
Case #WM_CREATE
ProcedureReturn 0
Case #WM_PAINT
ProcedureReturn 0
Case #WM_SIZE
ProcedureReturn 0
Case #WM_DESTROY
PostQuitMessage_(0)
ProcedureReturn 0
Default
ProcedureReturn DefWindowProc_(hwnd,msg,wparam,lparam)
EndSelect
EndProcedure
swc.WNDCLASSEX\cbSize=SizeOf(WNDCLASSEX)
swc\style=#CS_HREDRAW|#CS_VREDRAW
swc\lpfnWndProc=@mainwndproc()
swc\cbClsExtra=0
swc\cbWndExtra=0
swc\hInstance=hinst
swc\hIcon=0
swc\hCursor=LoadCursor_(#Null,#IDC_ARROW)
swc\hbrBackground=GetSysColorBrush_(#COLOR_MENU) ;#COLOR_WINDOW ; #COLOR_MENU
swc\lpszMenuName=#Null
swc\lpszClassName=@classname$
swc\hIconSm=0
RegisterClassEx_(@swc)
*WideClassname=WideStr(classname$)
*WideTitle=WideStr("title")
OpenLibrary(0,"USER32.dll")
hwmain=CallFunction(0,"CreateWindowExW",0,*WideClassname,*WideTitle,#WS_OVERLAPPEDWINDOW,100,100,600,400,0,#Null,hinst,0)
CloseLibrary(0)
FreeMemory(*WideClassname)
FreeMemory(*WideTitle)
Debug hwmain
ShowWindow_(hwmain,#SW_SHOWNORMAL)
UpdateWindow_(hwmain)
;message loop
While GetMessage_(@smsg.MSG,0,0,0)
TranslateMessage_(@smsg)
DispatchMessage_(@smsg)
Wend
DestroyWindow_(hwmain)
End