{"id":112,"date":"2010-04-17T22:55:54","date_gmt":"2010-04-18T07:55:54","guid":{"rendered":"\/blog\/?p=112"},"modified":"2023-09-21T09:41:14","modified_gmt":"2023-09-21T00:41:14","slug":"%eb%a7%81%ed%81%ac%ed%8c%8c%ec%9d%bc-lnk%ec%9d%98-%eb%8c%80%ec%83%81-%ec%b6%94%ec%b6%9c%ed%95%98%ea%b8%b0","status":"publish","type":"post","link":"https:\/\/hasu0707.duckdns.org\/blog\/?p=112","title":{"rendered":"\ub9c1\ud06c\ud30c\uc77c(*.lnk)\uc758 \ub300\uc0c1 \ucd94\ucd9c\ud558\uae30"},"content":{"rendered":"\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\ub9c1\ud06c\ud30c\uc77c(*.lnk)\uc758 \ub300\uc0c1 \ucd94\ucd9c\ud558\uae30<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\ub9c1\ud06c\ud30c\uc77c\uc5d0\uc11c \ub300\uc0c1 \ud30c\uc77c\uc758 Full Path\ub97c \ucc3e\ub294 \ubc29\ubc95\uc774\ub2e4....<\/SPAN><\/P>\n<P>&nbsp;<\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; HRESULT hres; <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; IShellLink* psl; <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; char szGotPath[MAX_PATH]; <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; char szDescription[MAX_PATH]; <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; WIN32_FIND_DATA wfd; <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp;<\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Get a pointer to the IShellLink interface. <\/SPAN><\/FONT><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IID_IShellLink, (LPVOID*)&amp;psl); <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; if (SUCCEEDED(hres)) <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; { <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; IPersistFile* ppf; <\/SPAN><br \/><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Get a pointer to the IPersistFile interface. <\/SPAN><\/FONT><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; hres = psl-&gt;QueryInterface(IID_IPersistFile, (void**)&amp;ppf); <\/SPAN><br \/><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; if (SUCCEEDED(hres)) <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; { <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WCHAR wsz[MAX_PATH]; <\/SPAN><br \/><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Ensure that the string is Unicode<\/SPAN><\/FONT><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">. lpszLinkFile \ub294 Link file \uc758 full path\uc774\ub2e4.<\/SPAN><\/FONT><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MultiByteToWideChar(CP_ACP, 0, lpszLinkFile, -1, wsz, MAX_PATH); <\/SPAN><br \/><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Add code here to check return value from MultiByteWideChar <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ for success.<\/SPAN><br \/><\/FONT><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Load the shortcut. <\/SPAN><br \/><\/FONT><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hres = ppf-&gt;Load(wsz, STGM_READ); <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (SUCCEEDED(hres)) <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Resolve the link. <\/SPAN><\/FONT><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hres = psl-&gt;Resolve(hwnd, 0); <\/SPAN><br \/><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (SUCCEEDED(hres)) <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Get the path to the link target.<\/SPAN><\/FONT><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\"> <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hres = psl-&gt;GetPath(szGotPath, MAX_PATH, (WIN32_FIND_DATA*)&amp;wfd, SLGP_SHORTPATH); <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Release the pointer to the IPersistFile interface. <\/SPAN><br \/><\/FONT><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ppf-&gt;Release(); <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; } <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; <\/SPAN><FONT color=#008000><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\/\/ Release the pointer to the IShellLink interface. <\/SPAN><\/FONT><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; &nbsp; &nbsp; psl-&gt;Release(); <\/SPAN><br \/><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">&nbsp; &nbsp; } <\/SPAN><br \/><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">szGotPath\ub85c lnk\ud30c\uc77c\uc758 \ub300\uc0c1\uc758 Full Path\uac00 \uad6c\ud574\uc9c4\ub2e4.<\/SPAN><\/P>\n<P><SPAN style=\"FONT-FAMILY: \ub3cb\uc6c0\uccb4\">\uc774\uc678 ShellLinkObject \ub97c MSDN\uc73c\ub85c \ucc3e\uc544 \ubcf4\uba74 \ub2e4\ub978 \uc815\ubcf4\ub97c \uc54c\ub0bc\uc218 \uc788\uace0 \ud639\uc740 lnk\ud30c\uc77c\uc744 \ub9cc\ub4e4\uc218\ub3c4 \uc788\ub2e4.&nbsp; <\/SPAN><\/P>\n","protected":false},"excerpt":{"rendered":"<p>\ub9c1\ud06c\ud30c\uc77c(*.lnk)\uc758 \ub300\uc0c1 \ucd94\ucd9c\ud558\uae30 &nbsp; \ub9c1\ud06c\ud30c\uc77c\uc5d0\uc11c \ub300\uc0c1 \ud30c\uc77c\uc758 Full Path\ub97c \ucc3e\ub294 \ubc29\ubc95\uc774\ub2e4&#8230;. &nbsp; &nbsp; &nbsp; HRESULT hres; &nbsp; &nbsp; IShellLink* psl; &nbsp; &nbsp; char szGotPath[MAX_PATH]; &nbsp; &nbsp; char szDescription[MAX_PATH]; &nbsp; &nbsp; WIN32_FIND_DATA wfd; &nbsp;&nbsp; &nbsp; \/\/ Get a pointer to the IShellLink interface. &nbsp; &nbsp; hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[18],"tags":[],"class_list":["post-112","post","type-post","status-publish","format-standard","hentry","category-development_language"],"_links":{"self":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/112","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=112"}],"version-history":[{"count":0,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/112\/revisions"}],"wp:attachment":[{"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hasu0707.duckdns.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}