Opening windows using WinAPI

Everything else that doesn't fall into one of the other PB categories.
Seldon
Enthusiast
Enthusiast
Posts: 405
Joined: Fri Aug 22, 2003 7:12 am
Location: Italia

Opening windows using WinAPI

Post by Seldon »

Hi,

I need some more control over windows (I need a skin interface... btw, I tried the skin lib, it's good but it's a bit slow as you can't pass an already calculated region, besides it has problems with 3.80) , so I'm trying to open a window through the Win API. Someone knows how to get the hIstance of our running PB application ? Another thing I can't understand is that the CreateWindow API call seems not to be recognized (?!?).

Here it is the code:

Code: Select all

t$="MZ"
wc.WNDCLASS

wc\cbClsExtra = 0
wc\cbWndExtra = 0
wc\hbrBackground = #COLOR_BACKGROUND
wc\hInstance = hInstance
wc\hIcon = LoadIcon_(0,#IDI_APPLICATION)
wc\hCursor = LoadCursor_(0, #IDC_ARROW)
wc\lpszMenuName = 0
wc\lpszClassName = @t$
wc\lpfnWndProc = WndProc
wc\style = #CS_HREDRAW | #CS_VREDRAW

RegisterClass_(wc);
hMainWnd = CreateWindow_("MZ","Finestra",WS_VISIBLE,150,150,50,50,0,0,hInstance,0)
Thanks in advance to alls who can help. Regards.
freak
PureBasic Team
PureBasic Team
Posts: 5946
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

to get the hInstance:

GetModuleHandle_(0)

Timo
quidquid Latine dictum sit altum videtur
Post Reply