{"id":242,"date":"2008-05-06T21:04:17","date_gmt":"2008-05-06T21:04:17","guid":{"rendered":"http:\/\/6teen.ru\/?p=199"},"modified":"2008-05-06T21:04:17","modified_gmt":"2008-05-06T21:04:17","slug":"5412","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=242","title":{"rendered":"\u041a\u0430\u043a \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 ShellExecute"},"content":{"rendered":"<p>\u041a\u0430\u043a \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 ShellExecute<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 \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 ShellExecute\n\nuses\n  ShellAPI;\n\nprocedure TForm1.Button1Click(Sender: TObject);\nvar\n  ProcInfo: PShellExecuteInfo;\nbegin\n  (Sender as TControl).Enabled := False;\n  GetMem(ProcInfo, SizeOf(ProcInfo^));\n  ZeroMemory(ProcInfo, SizeOf(ProcInfo^));\n  with ProcInfo^ do begin\n    Wnd := Handle;\n    cbSize := SizeOf(ProcInfo^);\n    lpFile := PChar('notepad.exe');\n\/\/    lpParameters := nil;\n    lpVerb := 'open';\n    nShow := SW_SHOW;\n    fMask := SEE_MASK_DOENVSUBST or SEE_MASK_NOCLOSEPROCESS;\n  end;\n  try\n    Win32check(ShellExecuteEx(ProcInfo));\n    while not Application.Terminated and\n      (WaitForSingleObject(ProcInfo.hProcess, 100)=WAIT_TIMEOUT) do\n      Application.ProcessMessages;\n  finally\n    if ProcInfo.hProcess <> 0 then CloseHandle(ProcInfo.hProcess);\n    Dispose(ProcInfo);\n    (Sender as TControl).Enabled := True;\n  end;\nend;\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0434\u043e\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u043e\u0439 ShellExecute<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[431,440],"tags":[563,706,722,745,937],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/242"}],"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=242"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/242\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=242"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}