News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

ARRRRGGHHH why doesn't this work

Started by monkeybot, May 31, 2008, 04:18:45 AM

Previous topic - Next topic

monkeybot

i am trying to create a window with the API,i can use quite a few other funcs from user32.dll but cant get  window up.does anyone know why,cos i dont....

Thanks

PlayBASIC Code: [Select]
explicit on
Constant WS_CHILD = 1073741824
Constant WS_VISIBLE = 268435456
constant WS_EX_APPWINDOW = 262144 ; 0x00040000L
global hWnd,user32
global Filename$=windowsdir$()+"system32\user32.dll"
If GetDllExist(Filename$) =0
Print "Loading DLL "+filename$
user32 = GetFreeDll()
LoadDll Filename$, user32
EndIf
getdll("CreateWindowExA",user32)
hwnd =calldll(user32,"CreateWindowExA",WS_EX_APPWINDOW,"","win",WS_VISIBLE,100,100,200,200,0,0,0,0)
if hwnd=0 then print"Window failed"
;HWND CreateWindowEx(
; DWORD dwExStyle,
; LPCTSTR lpClassName,
; LPCTSTR lpWindowName,
; DWORD dwStyle,
; int x,
; int y,
; int nWidth,
; int nHeight,
; HWND hWndParent,
; HMENU hMenu,
; HINSTANCE hInstance,
; LPVOID lpParam
Sync
WaitKey
deleteDLL user32
end

function getDLL(d$,dllname)
if getDllCallExist( dllname,d$)
print d$+" exists"
;calldll (dllname,d$)
;print var
Else
Print "Sorry the "+d$+ " doesn't exist in this dll"
EndIf
endfunction





    

monkeybot