{"id":432,"date":"2008-05-03T17:22:02","date_gmt":"2008-05-03T17:22:02","guid":{"rendered":"http:\/\/6teen.ru\/?p=456"},"modified":"2008-05-03T17:22:02","modified_gmt":"2008-05-03T17:22:02","slug":"2591","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=432","title":{"rendered":"\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043a\u043d\u043e \u0431\u0435\u0437 VCL"},"content":{"rendered":"<p>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043a\u043d\u043e \u0431\u0435\u0437 VCL<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043a\u043d\u043e \u0431\u0435\u0437 VCL\n\nprogram Project1;\n\n{ Copyright (c) 1996 by Charlie Calvert\n\n  Standard Windows API application written in Object Pascal.\n  No VCL code included. This is all done on the Windows API\n  level.\n\n  Note that you need to include both Windows and Messages!}\n\nuses\n  Windows, Messages;\n\nconst\n  AppName = 'Window1';\n\nfunction WindowProc(Window: HWnd; AMessage, WParam,\n                    LParam: Longint): Longint; stdcall;\nbegin\n  WindowProc := 0;\n\n  case AMessage of\n    wm_Destroy: begin\n      PostQuitMessage(0);\n      Exit;\n    end;\n  end;\n\n  WindowProc := DefWindowProc(Window, AMessage, WParam, LParam);\nend;\n\n{ Register the Window Class }\nfunction WinRegister: Boolean;\nvar\n  WindowClass: TWndClass;\nbegin\n  WindowClass.Style := cs_hRedraw or cs_vRedraw;\n  WindowClass.lpfnWndProc := @WindowProc;\n  WindowClass.cbClsExtra := 0;\n  WindowClass.cbWndExtra := 0;\n  WindowClass.hInstance := HInstance;\n  WindowClass.hIcon := LoadIcon(0, idi_Application);\n  WindowClass.hCursor := LoadCursor(0, idc_Arrow);\n  WindowClass.hbrBackground := HBrush(Color_Window);\n  WindowClass.lpszMenuName := nil;\n  WindowClass.lpszClassName := AppName;\n\n  Result := RegisterClass(WindowClass) <> 0;\nend;\n\n{ Create the Window Class }\nfunction WinCreate: HWnd;\nvar\n  hWindow: HWnd;\nbegin\n  hWindow := CreateWindow(AppName, 'Object Pascal Window',\n              ws_OverlappedWindow, cw_UseDefault, cw_UseDefault,\n              cw_UseDefault, cw_UseDefault, 0, 0, HInstance, nil);\n\n  if hWindow <> 0 then begin\n    ShowWindow(hWindow, CmdShow);\n    UpdateWindow(hWindow);\n  end;\n\n  Result := hWindow;\nend;\n\nvar\n  AMessage: TMsg;\n  hWindow: HWnd;\nbegin\n  if not WinRegister then begin\n    MessageBox(0, 'Register failed', nil, mb_Ok);\n    Exit;\n  end;\n  hWindow := WinCreate;\n  if hWindow = 0 then begin\n    MessageBox(0, 'WinCreate failed', nil, mb_Ok);\n    Exit;\n  end;\n  while GetMessage(AMessage, 0, 0, 0) do begin\n    TranslateMessage(AMessage);\n    DispatchMessage(AMessage);\n  end;\n  Halt(AMessage.wParam);\nend.\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043a\u043d\u043e \u0431\u0435\u0437 VCL<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[431,454],"tags":[1206,873],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/432"}],"collection":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=432"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/432\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=432"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}