Page 1 of 1

Opening windows using WinAPI

Posted: Fri Oct 10, 2003 11:35 am
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.

Posted: Fri Oct 10, 2003 11:47 am
by freak
to get the hInstance:

GetModuleHandle_(0)

Timo