{"id":528,"date":"2008-05-10T09:05:06","date_gmt":"2008-05-10T09:05:06","guid":{"rendered":"http:\/\/6teen.ru\/?p=741"},"modified":"2008-05-10T09:05:06","modified_gmt":"2008-05-10T09:05:06","slug":"6439-2","status":"publish","type":"post","link":"http:\/\/pblog.ru\/lab\/?p=528","title":{"rendered":"\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b Windows"},"content":{"rendered":"<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b Windows<br \/>\n<!--more--><\/p>\n<pre class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; width:580px; height:320px; overflow:auto\"><div>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b Windows\n\n\u041a\u0430\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0441\u0435\u0430\u043d\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0444\u0443\u043d\u043a\u0446\u0438\u044e eject cd, \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430 \u0438 \u0442. \u0434.?\n\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:\n\nprocedure tform1.button1click(sender: tobject);\nbegin\npowercontrol1.action := actcdeject; \/\/ \u0418\u043b\u0438... actlogoff, actshutdown...\npowercontrol1.execute;\nend;\n\nunit powercontrol;\n\ninterface\n\nuses\nwindows, messages, sysutils, classes, controls, forms, graphics, mmsystem;\n\ntype\ntaction = (actlogoff, actshutdown, actreboot, actforce,\nactpoweroff, actforceifhung, actmonitoroff,\nactmonitoron, actcdeject, actcduneject);\n\ntpowercontrol = class(tcomponent)\nprivate\nfaction: taction;\nprocedure setaction(value: taction);\npublic\nfunction execute: boolean;\npublished\nproperty action: taction read faction write setaction;\nend;\n\nprocedure register;\n\nimplementation\n\nprocedure register;\nbegin\nregistercomponents('k2', [tpowercontrol]);\nend;\n\nprocedure tpowercontrol.setaction(value: taction);\nbegin\nfaction := value;\nend;\n\nfunction tpowercontrol.execute: boolean;\nbegin\nwith (owner as tform) do\ncase faction of\nactlogoff: exitwindowsex(ewx_logoff,1);\nactshutdown: exitwindowsex(ewx_shutdown,1);\nactreboot: exitwindowsex(ewx_reboot,1);\nactforce: exitwindowsex(ewx_force,1);\nactpoweroff: exitwindowsex(ewx_poweroff,1);\nactforceifhung: exitwindowsex(ewx_forceifhung,1);\nactmonitoroff: sendmessage(application.handle, wm_syscommand,\nsc_monitorpower, 0);\nactmonitoron: sendmessage(application.handle, wm_syscommand,\nsc_monitorpower, -1);\nactcdeject: mcisendstring('set cdaudio door open wait',\nnil, 0, handle);\nactcduneject: mcisendstring('set cdaudio door closed wait',\nnil, 0, handle);\nend; {case}\nresult := true;\nend;\n\nend.\n<\/div><\/pre>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u044b Windows<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[448,453],"tags":[603,1323,340],"_links":{"self":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/528"}],"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=528"}],"version-history":[{"count":0,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=\/wp\/v2\/posts\/528\/revisions"}],"wp:attachment":[{"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=528"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pblog.ru\/lab\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}