Почему не создается окно?
Code
#Include "windows.bi"
Declare Function WP(h As Long, m As Long,w As Long, l As Long) As Integer
Dim h As Long
Dim m As MSG
Dim wc As WNDCLASS
Dim CW As String = "window"
Dim TIT As String = "WINDOW"
Dim GM As Long = GetModuleHandle(0)
wc.style = CS_HREDRAW Or CS_VREDRAW
wc.lpfnWndProc=@WP
wc.hInstance = GM
wc.hbrBackground = COLOR_WINDOW
wc.lpszClassName = @CW
RegisterClass(@wc)
h = CreateWindow("window",TIT,WS_TILEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,GM,0)
ShowWindow(h,SW_SHOWNORMAL)
While TRUE
GetMessage(@m,0,0,0)
DispatchMessage(@m)
Wend
Function WP(h As Long, m As Long,w As Long, l As Long) As Integer
If m = WM_CLOSE Then
ExitProcess(0)
EndIf
Return DefWindowProc(h,m,w,l)
End Function
Добавлено (03.12.2012, 15:18)
---------------------------------------------
Уже не надо, я сам нашел. Вот эту строку надо записать так:
у меня
wc.lpszClassName = @CW
надо
wc.lpszClassName = strptr(CW)
Не знаю правда почему так вроде определяю указатель настроку...