Code: Select all
createwindow_("WindowClass","Window",#WS_VISIBLE | #WS_BORDER,1,1,200,200,0,0,0,1)
Repeat
AnEvent=0
Until AnEvent=1
Code: Select all
createwindow_("WindowClass","Window",#WS_VISIBLE | #WS_BORDER,1,1,200,200,0,0,0,1)
Repeat
AnEvent=0
Until AnEvent=1
Code: Select all
Procedure WindowCallback(Window, Message, wParam, lParam)
Select Message
Case #WM_CLOSE
DestroyWindow_(Window)
Case #WM_DESTROY
PostQuitMessage_(0)
Result = 0
Default
Result = DefWindowProc_(Window, Message, wParam, lParam)
EndSelect
ProcedureReturn Result
EndProcedure
#Style = #WS_VISIBLE | #WS_CAPTION | #WS_SYSMENU
WindowClass.s = "WindowClass_227B"
wc.WNDCLASSEX
wc\cbSize = SizeOf(WNDCLASSEX)
wc\hbrBackground = CreateSolidBrush_(GetSysColor_(#COLOR_BTNFACE))
wc\hCursor = LoadCursor_(0, #IDC_ARROW)
wc\lpfnWndProc = @WindowCallback()
wc\lpszClassName = @WindowClass
RegisterClassEx_(@wc)
screenx = GetSystemMetrics_(#SM_CXSCREEN)/2-320/2
screeny = GetSystemMetrics_(#SM_CYSCREEN)/2-240/2
hWndMain = CreateWindow_( WindowClass, "Test Window", #Style, screenx, screeny, 320, 240, 0, 0, 0, 0)
While GetMessage_(msg.MSG, #Null, 0, 0 )
TranslateMessage_(msg)
DispatchMessage_(msg)
Wend
Yes. I shall stab it. That'll learn it to be complicated!Fred wrote:API is complicated. Often very complicated.
Code: Select all
#include <windows.h>
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);
HWND hWnd;
const HBRUSH hCouleur_Jaune = CreateSolidBrush(RGB(255,255,0));
HBRUSH hBackground = hCouleur_Jaune;
static char szClassName[ ] = "Fenêtre Windows simple";
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpcmdLine, int nCmdShow){
WNDCLASSEX wincl;
wincl.hInstance = hThisInstance;
wincl.lpfnWndProc = WindowProcedure;
wincl.hbrBackground = hBackground;
wincl.style = CS_HREDRAW | CS_VREDRAW;
wincl.lpszClassName = szClassName;
wincl.cbSize = sizeof (WNDCLASSEX);
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
if (RegisterClassEx (&wincl) == false) // On enregistre la classe déclarée avec WNDCLASSEX
return 0 ; // et en cas d'erreur on quitte le programme
hWnd = CreateWindowEx (0, szClassName, "Fenetre simple", WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 644, 475, HWND_DESKTOP, NULL, hThisInstance, NULL);
ShowWindow(hWnd, nCmdShow);
MSG messages;
while (GetMessage (&messages, NULL, 0, 0)){
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){
switch (message){
case WM_DESTROY:
PostQuitMessage (0); // envoie un message WM_QUIT dans la file d'attente
break;
default:
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
It's a pity, because there is so much people in this forum who know the COTOH that convertor isn't something I would like to write
Think it's now done with Visual Studio.A question i ask to me....but never my GOD FRED answer me....
The PB compiler is made in C....but whith what compiler and IDE ?? :roll:
Visual studioIDLE wrote:Think it's now done with Visual Studio.