News:

Function Finder  Find all the functions within source code files

Main Menu

using windows' window's

Started by monkeybot, December 16, 2008, 03:15:11 PM

Previous topic - Next topic

monkeybot

why wont it work!!!! aargghhh

please someone tell me what i am doing wrong
PlayBASIC Code: [Select]
; PROJECT : Project4
; AUTHOR : jpxp
; CREATED : 16/12/2008
; ---------------------------------------------------------------------



constant WS_EX_APPWINDOW = $00040000
constant WS_BORDER = $00800000

bank1=getfreebank()
createbank bank1,8
wndPntr=getbankptr(bank1)

bank2=getfreebank()
createbank bank2,8
ClassPntr=getbankptr(bank2)

pokestring wndPntr,"wName",4
pokestring ClassPntr,"",0

linkdll "user32.dll"
window(dwExStyle,lpClassName,lpWindowName,dwStyle,x,y,nWidth,nHeight,hWndParent,hMenu,lpParam) alias "CreateWindowExA" as integer
endlinkdll

wHnd=window (WS_EX_APPWINDOW,ClassPntr,wndPntr,WS_BORDER,50,50,100,100,0,0,0)
if wHnd=0 then print "failed"
waitkey








reno

Things I don't use with PBFX, sorry :/
More games ? Go to my website :)
http://www.thereeteam.com/

kevin

#2
monkeybot,

Quote
please someone tell me what i am doing wrong

   When an win API functions fail, they set the last error flag.  So in order to work out why the create window is failing, this the first thing you should add.


linkdll "kernel32.dll"
GetLastError() alias "GetLastError" as integer
endlinkdll


  You're getting a 1407 error, which is an unknown class.  Meaning that before you try and create a window, you must first register a class it for it.   See RegisterClass.


monkeybot