{"id":2298,"date":"2022-04-26T20:05:15","date_gmt":"2022-04-26T12:05:15","guid":{"rendered":"https:\/\/www.citerp.com.tw\/citwordpress\/?p=2298"},"modified":"2022-04-26T20:05:54","modified_gmt":"2022-04-26T12:05:54","slug":"delphi-shellexecuteex","status":"publish","type":"post","link":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/","title":{"rendered":"Delphi-ShellExecuteEx"},"content":{"rendered":"\n<p>\u57f7\u884c\u5916\u90e8\u7a0b\u5f0f ShellExecuteEx<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>uses ShellAPI;\r\n\r\nprocedure pr_ShellExecuteEx(AFileName, AParam:String; AWaiting:Boolean=False);\r\nvar\r\n  SEInfo: TShellExecuteInfo;\r\n  ExitCode: DWORD;\r\n  ExecuteFile, ParamString, StartInString: string;\r\nbegin\r\n  ExecuteFile := AFileName;\r\n  ParamString := AParam;\r\n  FillChar(SEInfo, SizeOf(SEInfo), 0) ;\r\n  SEInfo.cbSize := SizeOf(TShellExecuteInfo) ;\r\n  with SEInfo do begin\r\n    fMask := SEE_MASK_NOCLOSEPROCESS;\r\n    Wnd := Application.Handle;\r\n    lpFile := PChar(ExecuteFile) ;\r\n    \/\/Exp: ParamString can contain the application parameters.\r\n    lpParameters := PChar(ParamString) ;\r\n    \/\/Exp: StartInString specifies the name of the working directory. If ommited, the current directory is used.\r\n    \/\/lpDirectory := PChar(StartInString) ;\r\n    nShow := SW_SHOWNORMAL;\r\n  end;\r\n  if ShellExecuteEx(@SEInfo) then begin\r\n    repeat\r\n      \/\/\u7b49\u5f85\u7a0b\u5f0f\u95dc\u9589\u5f8c, \u91cb\u56de\u63a7\u5236\u6b0a\r\n      if AWaiting then\r\n        WaitForSingleObject(SEInfo.hProcess, INFINITE);\r\n      \/\/\r\n      Application.ProcessMessages;\r\n      GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;\r\n    until (ExitCode &lt;> STILL_ACTIVE) or\r\n    Application.Terminated;\r\n  end;\r\nend;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Delphi-ShellExecuteEx<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"qubely_global_settings":"","qubely_interactions":"","footnotes":""},"categories":[89],"tags":[91],"class_list":["post-2298","post","type-post","status-publish","format-standard","hentry","category-delphi","tag-delphi"],"qubely_featured_image_url":null,"qubely_author":{"display_name":"\u5eb7\u6377Qoo","author_link":"https:\/\/www.citerp.com.tw\/citwordpress\/author\/cit001\/"},"qubely_comment":0,"qubely_category":"<a href=\"https:\/\/www.citerp.com.tw\/citwordpress\/category\/delphi\/\" rel=\"category tag\">Delphi<\/a>","qubely_excerpt":"Delphi-ShellExecuteEx","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Delphi-ShellExecuteEx - \u514d\u8cbb\u8cc7\u6e90\u5206\u4eab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Delphi-ShellExecuteEx - \u514d\u8cbb\u8cc7\u6e90\u5206\u4eab\" \/>\n<meta property=\"og:description\" content=\"Delphi-ShellExecuteEx\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/\" \/>\n<meta property=\"og:site_name\" content=\"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/citerptw\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-26T12:05:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-04-26T12:05:54+00:00\" \/>\n<meta name=\"author\" content=\"\u5eb7\u6377Qoo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5eb7\u6377Qoo\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/\"},\"author\":{\"name\":\"\u5eb7\u6377Qoo\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/person\/28cfdf2cec7315f2efe90573114fed37\"},\"headline\":\"Delphi-ShellExecuteEx\",\"datePublished\":\"2022-04-26T12:05:15+00:00\",\"dateModified\":\"2022-04-26T12:05:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/\"},\"wordCount\":2,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#organization\"},\"keywords\":[\"delphi\"],\"articleSection\":[\"Delphi\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/\",\"url\":\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/\",\"name\":\"Delphi-ShellExecuteEx - \u514d\u8cbb\u8cc7\u6e90\u5206\u4eab\",\"isPartOf\":{\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#website\"},\"datePublished\":\"2022-04-26T12:05:15+00:00\",\"dateModified\":\"2022-04-26T12:05:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\/\/www.citerp.com.tw\/citwordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Delphi-ShellExecuteEx\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#website\",\"url\":\"https:\/\/www.citerp.com.tw\/citwordpress\/\",\"name\":\"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab\",\"description\":\"\u514d\u8cbb\u8cc7\u6e90\u5171\u4eab\",\"publisher\":{\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.citerp.com.tw\/citwordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#organization\",\"name\":\"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab\",\"url\":\"https:\/\/www.citerp.com.tw\/citwordpress\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.citerp.com.tw\/citwordpress\/wp-content\/uploads\/2022\/06\/find2.png\",\"contentUrl\":\"https:\/\/www.citerp.com.tw\/citwordpress\/wp-content\/uploads\/2022\/06\/find2.png\",\"width\":128,\"height\":128,\"caption\":\"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab\"},\"image\":{\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/citerptw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/person\/28cfdf2cec7315f2efe90573114fed37\",\"name\":\"\u5eb7\u6377Qoo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/87fa59ff417f35a6d53f05479d9dd918615095cadddb02e447511edc4f8b6302?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/87fa59ff417f35a6d53f05479d9dd918615095cadddb02e447511edc4f8b6302?s=96&d=mm&r=g\",\"caption\":\"\u5eb7\u6377Qoo\"},\"url\":\"https:\/\/www.citerp.com.tw\/citwordpress\/author\/cit001\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Delphi-ShellExecuteEx - \u514d\u8cbb\u8cc7\u6e90\u5206\u4eab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/","og_locale":"zh_TW","og_type":"article","og_title":"Delphi-ShellExecuteEx - \u514d\u8cbb\u8cc7\u6e90\u5206\u4eab","og_description":"Delphi-ShellExecuteEx","og_url":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/","og_site_name":"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab","article_publisher":"https:\/\/www.facebook.com\/citerptw","article_published_time":"2022-04-26T12:05:15+00:00","article_modified_time":"2022-04-26T12:05:54+00:00","author":"\u5eb7\u6377Qoo","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005:":"\u5eb7\u6377Qoo","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"1 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#article","isPartOf":{"@id":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/"},"author":{"name":"\u5eb7\u6377Qoo","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/person\/28cfdf2cec7315f2efe90573114fed37"},"headline":"Delphi-ShellExecuteEx","datePublished":"2022-04-26T12:05:15+00:00","dateModified":"2022-04-26T12:05:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/"},"wordCount":2,"commentCount":0,"publisher":{"@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#organization"},"keywords":["delphi"],"articleSection":["Delphi"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/","url":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/","name":"Delphi-ShellExecuteEx - \u514d\u8cbb\u8cc7\u6e90\u5206\u4eab","isPartOf":{"@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#website"},"datePublished":"2022-04-26T12:05:15+00:00","dateModified":"2022-04-26T12:05:54+00:00","breadcrumb":{"@id":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/delphi-shellexecuteex\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/www.citerp.com.tw\/citwordpress\/"},{"@type":"ListItem","position":2,"name":"Delphi-ShellExecuteEx"}]},{"@type":"WebSite","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#website","url":"https:\/\/www.citerp.com.tw\/citwordpress\/","name":"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab","description":"\u514d\u8cbb\u8cc7\u6e90\u5171\u4eab","publisher":{"@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.citerp.com.tw\/citwordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":"Organization","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#organization","name":"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab","url":"https:\/\/www.citerp.com.tw\/citwordpress\/","logo":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/logo\/image\/","url":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-content\/uploads\/2022\/06\/find2.png","contentUrl":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-content\/uploads\/2022\/06\/find2.png","width":128,"height":128,"caption":"\u514d\u8cbb\u8cc7\u6e90\u5206\u4eab"},"image":{"@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/citerptw"]},{"@type":"Person","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/person\/28cfdf2cec7315f2efe90573114fed37","name":"\u5eb7\u6377Qoo","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/www.citerp.com.tw\/citwordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/87fa59ff417f35a6d53f05479d9dd918615095cadddb02e447511edc4f8b6302?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/87fa59ff417f35a6d53f05479d9dd918615095cadddb02e447511edc4f8b6302?s=96&d=mm&r=g","caption":"\u5eb7\u6377Qoo"},"url":"https:\/\/www.citerp.com.tw\/citwordpress\/author\/cit001\/"}]}},"_links":{"self":[{"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/posts\/2298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/comments?post=2298"}],"version-history":[{"count":0,"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/posts\/2298\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/media?parent=2298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/categories?post=2298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.citerp.com.tw\/citwordpress\/wp-json\/wp\/v2\/tags?post=2298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}