00=First you add MainFunction. You rename my function "flistsvc_lomain" with your "nameMAIN"
01=Before the DestroyWindow(, then you you add while...dispatchMessage..end
02=You add this procedure ,exactly this name "flistsvc_lbwndproc"
03=You search flistsvc_lbwndproc at Function flistsvc_lomain(h
Function flistsvc_lbwndproc(hWnd: HWND; message: UINT; wParam: WPARAM; lParam: LPARAM): LRESULT;
Begin
Assert_cxx(523);
mtjig_before:=nt_itoa(Message)+'=';
str_fileechoPASCAL(ktoolfini_flistsvc32ini,mtjig_before);
mtjig_before:='';
case Message of
WM_CREATE : Begin message_wm_create;
End;
// WM_CTLCOLORLISTBOX,
WM_SETFOCUS : Begin SetFocus (a14_getvar[04].handr) ;
result:=0;
exit;
End;
WM_KEYDOWN : ShowKey (hwnd, 0, 'WM_KEYDOWN', wParam, lParam) ;
WM_KEYUP : ShowKey (hwnd, 0, 'WM_KEYUP', wParam, lParam) ;
WM_CHAR : ShowKey (hwnd, 1, 'WM_CHAR', wParam, lParam) ;
WM_DEADCHAR : ShowKey (hwnd, 1, 'WM_DEADCHAR', wParam, lParam) ;
WM_SYSKEYDOWN :ShowKey (hwnd, 0, 'WM_SYSKEYDOWN', wParam, lParam) ;
WM_SYSKEYUP : ShowKey (hwnd, 0, 'WM_SYSKEYUP', wParam, lParam) ;
WM_SYSCHAR : ShowKey (hwnd, 1, 'WM_SYSCHAR', wParam, lParam) ;
WM_SYSDEADCHAR :ShowKey (hwnd, 1, 'WM_SYSDEADCHAR', wParam, lParam) ;
WM_COMMAND: result:=message_wmcommand(wParam,lParam);
WM_QUIT: Begin //ShowWindow(hWnd, SW_HIDE);
PostQuitMessage (0) ;
result:=0;
end;
WM_DESTROY : Begin //ShowWindow(hWnd, SW_HIDE);
result:=DefWindowProc(hwnd,0, 0, 0) ;
//PostQuitMessage (WM_DESTROY) ;
end;
else bootstat_dat;
end;
End;
Eu multumesc tie ArsenieBoca2025.
while(GetMessage(msg, 0, 0, 0)) do
begin
{$ifdef keyboard.inf}
if (PeekMessage (msg,0, 0, 0, PM_REMOVE)) then
if keyboard_inf_loc then break;
{$endif}
TranslateMessage(msg);
DispatchMessage(msg);
end;
result:=errorlevel+100;
DestroyWindow(hWnd);
end;
Function flistsvc_lomain(hInstance : HINST; hPrevInstance : HINST;lpCmdLine : PChar; nCmdShow : Integer;libraryTD_Db,pidonertf:strff) : Integer;
var
hWnd : THandle;
Msg : TMsg;
wndClass : TWndClass;
adcstate:boolean;
Function keyboard_inf_loc:boolean;
Begin result:=(msg.message = WM_QUIT);
writeln('(jey=',msg.message);
if (result) then exit;
if msg.message = WM_KEYDOWN then
case MapVirtualKey (msg.wparam, 0) of
13..255: writeln('*****');
end;
End;
begin
kscreensize.y:=GetSystemMetrics(SM_CYSCREEN);Assert_cxx(512);
kscreensize.x:=GetSystemMetrics(SM_CXSCREEN);
adcstate:=(HIWORD(nCmdShow)=WM_VSCROLL);
if adcstate then
Begin hwnd:=LOWORD(nCmdShow);
if (hwnd<1) then hwnd:=0;
if (hwnd>77) then hwnd:=77; //rem: 77.procente
with kscreensize do hwnd:=hwnd*y div 100;
End;
imagedef.h.resolutionunits:=if_int(adcstate,hwnd,0);
hwnd:=0;
wndClass.style := CS_HREDRAW or CS_VREDRAW;
wndClass.lpfnWndProc := @flistsvc_lbwndproc;
wndClass.cbClsExtra := 0;
wndClass.cbWndExtra := 0;
wndClass.hInstance := hInstance;
wndClass.hIcon := LoadIcon(0, IDI_APPLICATION);
wndClass.hCursor := LoadCursor(0, IDC_ARROW);
wndClass.hbrBackground := HBRUSH(GetStockObject(WHITE_BRUSH));
wndClass.lpszMenuName :=nil;
wndClass.lpszClassName :='GettingStarted';
RegisterClass(wndClass);
errorlevel:=0;
size3_rm_cur.y:=Integer(CW_USEDEFAULT);
size3_rm_cur.x:=Integer(CW_USEDEFAULT);
if (length(libraryTD_Db)<2) then libraryTD_Db:=kNsiMessageLength_i02 else
if (fileexists(libraryTD_Db)) then libraryTD_Db:=concat('(FListSVc "',ExtractFile2Name('',libraryTD_Db),'?>',pidonertf,'")'#0#0#0) else
if (pos('.',libraryTD_Db)>0) then libraryTD_Db:=concat('(FlisTSvc "',ExtractFile2Name('',libraryTD_Db),
'?=',pidonertf,'")'#0#0#0) else
libraryTD_Db:=kNsiMessageLength_i02;
Assert_cxx(513);
hWnd := CreateWindow(
'GettingStarted', // window class name
@A14_dwgtitled[1], // window caption
WS_CAPTION or WS_THICKFRAME or WS_MAXIMIZEBOX , // window style
Integer(CW_USEDEFAULT), // initial x position
Integer(CW_USEDEFAULT), // initial y position
size3_rm_cur.x, // initial x size width
size3_rm_cur.y, // initial y size
0, // parent window handle
0, // window menu handle
hInstance, // program instance handle
nil); // creation parameters
ShowWindow(hWnd, SW_SHOW);
UpdateWindow(hWnd);
while(GetMessage(msg, 0, 0, 0)) do
begin
{$ifdef keyboard.inf}
if (PeekMessage (msg,0, 0, 0, PM_REMOVE)) then
if keyboard_inf_loc then break;
{$endif}
TranslateMessage(msg);
DispatchMessage(msg);
end;
result:=errorlevel+100;
DestroyWindow(hWnd);
end;//off-flistsvc_lbmain("")