{"id":777,"date":"2007-12-20T16:50:00","date_gmt":"2007-12-20T16:50:00","guid":{"rendered":"\/post\/1386\/09\/29\/db8cdaa9-d985d8abd8a7d984-d8afd8b1-d8a8d8a7d8a8-Win-API"},"modified":"2007-12-20T16:50:00","modified_gmt":"2007-12-20T16:50:00","slug":"%db%8c%da%a9-%d9%85%d8%ab%d8%a7%d9%84-%d8%af%d8%b1-%d8%a8%d8%a7%d8%a8-win-api","status":"publish","type":"post","link":"https:\/\/mesbahi.net\/fa\/blog\/1386\/09\/29\/%db%8c%da%a9-%d9%85%d8%ab%d8%a7%d9%84-%d8%af%d8%b1-%d8%a8%d8%a7%d8%a8-win-api\/","title":{"rendered":"\u06cc\u06a9 \u0645\u062b\u0627\u0644 \u062f\u0631 \u0628\u0627\u0628 Win API"},"content":{"rendered":"<p dir=\"rtl\" align=\"justify\"><img loading=\"lazy\" decoding=\"async\" style=\"border-right: 0px; border-top: 0px; margin: 0px 10px; border-left: 0px; border-bottom: 0px\" height=\"131\" alt=\"API\" src=\"http:\/\/mesbahi.net\/fa\/wp-content\/uploads\/sites\/3\/pictures\/migration\/WindowsLiveWriter\/WinAPI_ED19\/API_3.jpg\" width=\"128\" align=\"right\" border=\"0\">&nbsp;&nbsp; \u0628\u0631\u0627\u06cc \u062f\u0633\u062a\u0631\u0633\u06cc \u0648 \u06a9\u0646\u062a\u0631\u0644 \u0628\u0639\u0636\u06cc \u0627\u0632 \u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627 \u0648 \u0627\u0634\u06cc\u0627\u0621 \u06a9\u0647 \u0645\u0631\u0628\u0648\u0637 \u06cc\u0647 \u062e\u0648\u062f \u0648\u06cc\u0646\u062f\u0648\u0632 \u0645\u06cc \u0634\u0648\u0646\u062f \u060c \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 API \u0647\u0627\u06cc \u062e\u0648\u062f \u0648\u06cc\u0646\u062f\u0648\u0632 \u0627\u0633\u062a. \u062f\u0631 \u0645\u0628\u062d\u062b interoperation \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0634\u06cc\u0627\u0621 COM \u0628\u06cc\u0627\u0646 \u0645\u06cc \u0634\u0648\u062f \u0648\u0644\u06cc \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631 \u0647\u0645 \u0646\u0645\u0648\u0646\u0647 \u062e\u0648\u0628\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0645\u0628\u062d\u062b \u0627\u0633\u062a.<\/p>\n<p>\u062f\u0631 \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631 \u0645\u06cc \u0628\u06cc\u0646\u06cc\u062f \u0686\u0637\u0648\u0631 \u0645\u06cc\u0634\u0647 \u0627\u0632 user32.dll \u062c\u0647\u062a \u067e\u06cc\u0627\u062f\u0647 \u06a9\u0631\u062f\u0646 \u06cc\u06a9 \u067e\u0646\u062c\u0631\u0647 \u0628\u0627\u0632 \u062f\u0631 \u0648\u06cc\u0646\u062f\u0648\u0632 \u0648 \u0628\u0633\u062a\u0646 \u0622\u0646 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0631\u062f&#8230;<\/p>\n<pre class=\"code\" dir=\"ltr\">&nbsp;<\/pre>\n<div dir=\"ltr\" style=\"border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244,244,244)\" align=\"left\">\n<div style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\">\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   1:<\/span> <span style=\"color: rgb(0,0,255)\">using<\/span> Microsoft.Win32;<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   2:<\/span>&nbsp; <\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   3:<\/span> [DllImport(<span style=\"color: rgb(0,96,128)\">\"user32.dll\"<\/span>)]<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   4:<\/span>         <span style=\"color: rgb(0,0,255)\">public<\/span> <span style=\"color: rgb(0,0,255)\">static<\/span> <span style=\"color: rgb(0,0,255)\">extern<\/span> <span style=\"color: rgb(0,0,255)\">int<\/span> FindWindow(<span style=\"color: rgb(0,0,255)\">string<\/span> lpClassName,<span style=\"color: rgb(0,0,255)\">string<\/span> lpWindowName);<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   5:<\/span>         [DllImport(<span style=\"color: rgb(0,96,128)\">\"user32.dll\"<\/span>)]<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   6:<\/span>         <span style=\"color: rgb(0,0,255)\">public<\/span> <span style=\"color: rgb(0,0,255)\">static<\/span> <span style=\"color: rgb(0,0,255)\">extern<\/span> <span style=\"color: rgb(0,0,255)\">int<\/span> SendMessage(<span style=\"color: rgb(0,0,255)\">int<\/span> hWnd, <span style=\"color: rgb(0,0,255)\">uint<\/span> Msg, <span style=\"color: rgb(0,0,255)\">int<\/span> wParam, <span style=\"color: rgb(0,0,255)\">int<\/span> lParam);<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   7:<\/span>             <\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   8:<\/span>         <span style=\"color: rgb(0,0,255)\">public<\/span> <span style=\"color: rgb(0,0,255)\">const<\/span> <span style=\"color: rgb(0,0,255)\">int<\/span> WM_SYSCOMMAND = 0x0112;<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">   9:<\/span>         <span style=\"color: rgb(0,0,255)\">public<\/span> <span style=\"color: rgb(0,0,255)\">const<\/span> <span style=\"color: rgb(0,0,255)\">int<\/span> SC_CLOSE = 0xF060;<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  10:<\/span>&nbsp; <\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  11:<\/span>&nbsp; <\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  12:<\/span> <span style=\"color: rgb(0,0,255)\">private<\/span> <span style=\"color: rgb(0,0,255)\">void<\/span> closeWindow()<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  13:<\/span>         {<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  14:<\/span>             <span style=\"color: rgb(0,128,0)\">\/\/ \u062f\u0631 \u0627\u06cc\u0646\u062c\u0627 \u0622\u06cc \u062f\u06cc \u067e\u0646\u062c\u0631\u0647 \u0646\u0648\u062a \u067e\u062f \u0630\u062e\u06cc\u0631\u0647 \u0646\u0634\u062f\u0647 \u0631\u0627 \u0645\u06cc \u06cc\u0627\u0628\u06cc\u0645<\/span><\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  15:<\/span>             <span style=\"color: rgb(0,0,255)\">int<\/span> iHandle = FindWindow(<span style=\"color: rgb(0,96,128)\">\"Notepad\"<\/span>, <span style=\"color: rgb(0,96,128)\">\"Untitled - Notepad\"<\/span>);<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  16:<\/span>             <span style=\"color: rgb(0,0,255)\">if<\/span> (iHandle &gt; 0)<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  17:<\/span>             {<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  18:<\/span>                 <span style=\"color: rgb(0,128,0)\">\/\/ \u067e\u0646\u062c\u0631\u0647 \u0631\u0627 \u0645\u06cc \u0628\u0646\u062f\u06cc\u0645        <\/span><\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  19:<\/span>                 SendMessage(iHandle, WM_SYSCOMMAND, SC_CLOSE, 0);<\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: rgb(244,244,244); border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  20:<\/span>             }  <\/pre>\n<pre style=\"padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas,'Courier New',courier,monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none\"><span style=\"color: rgb(96,96,96)\">  21:<\/span>         }<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp; \u0628\u0631\u0627\u06cc \u062f\u0633\u062a\u0631\u0633\u06cc \u0648 \u06a9\u0646\u062a\u0631\u0644 \u0628\u0639\u0636\u06cc \u0627\u0632 \u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627 \u0648 \u0627\u0634\u06cc\u0627\u0621 \u06a9\u0647 \u0645\u0631\u0628\u0648\u0637 \u06cc\u0647 \u062e\u0648\u062f \u0648\u06cc\u0646\u062f\u0648\u0632 \u0645\u06cc \u0634\u0648\u0646\u062f \u060c \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 API \u0647\u0627\u06cc \u062e\u0648\u062f \u0648\u06cc\u0646\u062f\u0648\u0632 \u0627\u0633\u062a. \u062f\u0631 \u0645\u0628\u062d\u062b interoperation \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0634\u06cc\u0627\u0621 COM \u0628\u06cc\u0627\u0646 \u0645\u06cc \u0634\u0648\u062f \u0648\u0644\u06cc \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631 \u0647\u0645 \u0646\u0645\u0648\u0646\u0647 \u062e\u0648\u0628\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0645\u0628\u062d\u062b \u0627\u0633\u062a. \u062f\u0631 \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631 \u0645\u06cc \u0628\u06cc\u0646\u06cc\u062f \u0686\u0637\u0648\u0631 \u0645\u06cc\u0634\u0647 \u0627\u0632 &#8230; <a title=\"\u06cc\u06a9 \u0645\u062b\u0627\u0644 \u062f\u0631 \u0628\u0627\u0628 Win API\" class=\"read-more\" href=\"https:\/\/mesbahi.net\/fa\/blog\/1386\/09\/29\/%db%8c%da%a9-%d9%85%d8%ab%d8%a7%d9%84-%d8%af%d8%b1-%d8%a8%d8%a7%d8%a8-win-api\/\" aria-label=\"\u062f\u0631\u0628\u0627\u0631\u06c0 \u06cc\u06a9 \u0645\u062b\u0627\u0644 \u062f\u0631 \u0628\u0627\u0628 Win API \u0628\u06cc\u0634\u062a\u0631 \u0628\u062e\u0648\u0627\u0646\u06cc\u062f\">\u0627\u062f\u0627\u0645\u0647<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[2],"tags":[],"class_list":["post-777","post","type-post","status-publish","format-standard","hentry","category-net"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"\u0627\u0645\u06cc\u0646 \u0645\u0635\u0628\u0627\u062d\u06cc","author_link":"https:\/\/mesbahi.net\/fa\/blog\/author\/amin\/"},"uagb_comment_info":0,"uagb_excerpt":"&nbsp;&nbsp; \u0628\u0631\u0627\u06cc \u062f\u0633\u062a\u0631\u0633\u06cc \u0648 \u06a9\u0646\u062a\u0631\u0644 \u0628\u0639\u0636\u06cc \u0627\u0632 \u0631\u0648\u06cc\u062f\u0627\u062f\u0647\u0627 \u0648 \u0627\u0634\u06cc\u0627\u0621 \u06a9\u0647 \u0645\u0631\u0628\u0648\u0637 \u06cc\u0647 \u062e\u0648\u062f \u0648\u06cc\u0646\u062f\u0648\u0632 \u0645\u06cc \u0634\u0648\u0646\u062f \u060c \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 API \u0647\u0627\u06cc \u062e\u0648\u062f \u0648\u06cc\u0646\u062f\u0648\u0632 \u0627\u0633\u062a. \u062f\u0631 \u0645\u0628\u062d\u062b interoperation \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0627\u0634\u06cc\u0627\u0621 COM \u0628\u06cc\u0627\u0646 \u0645\u06cc \u0634\u0648\u062f \u0648\u0644\u06cc \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631 \u0647\u0645 \u0646\u0645\u0648\u0646\u0647 \u062e\u0648\u0628\u06cc \u0627\u0632 \u0627\u06cc\u0646 \u0645\u0628\u062d\u062b \u0627\u0633\u062a. \u062f\u0631 \u0645\u062b\u0627\u0644 \u0632\u06cc\u0631 \u0645\u06cc \u0628\u06cc\u0646\u06cc\u062f \u0686\u0637\u0648\u0631 \u0645\u06cc\u0634\u0647 \u0627\u0632&hellip;","_links":{"self":[{"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/posts\/777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/comments?post=777"}],"version-history":[{"count":0,"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/posts\/777\/revisions"}],"wp:attachment":[{"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/media?parent=777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/categories?post=777"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mesbahi.net\/fa\/wp-json\/wp\/v2\/tags?post=777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}