{"id":74628,"date":"2023-12-28T10:50:23","date_gmt":"2023-12-28T02:50:23","guid":{"rendered":"https:\/\/www.techphant.cn\/?p=74628"},"modified":"2023-12-28T10:50:23","modified_gmt":"2023-12-28T02:50:23","slug":"srljs","status":"publish","type":"post","link":"https:\/\/www.techphant.cn\/blog\/74628.html","title":{"rendered":"\u6df1\u5165\u4e86\u89e3setwindowlong win32"},"content":{"rendered":"
setwindowlong win32\u662f\u4e00\u4e2a\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u7684\u5173\u952e\u51fd\u6570\u3002\u672c\u6587\u5c06\u5e26\u60a8\u6df1\u5165\u4e86\u89e3setwindowlong win32\uff0c\u5e76\u63a2\u8ba8\u5176\u5728Windows\u7f16\u7a0b\u4e2d\u7684\u91cd\u8981\u6027\u548c\u5e94\u7528\u3002<\/p>\n
setwindowlong win32\u662f\u4e00\u4e2a\u7528\u4e8e\u6307\u5b9a\u4e00\u4e2a\u7279\u5b9a\u7a97\u53e3\u7684\u957f\u6574\u578b\u503c\u6570\u636e\u7684\u51fd\u6570\u3002\u5b83\u7684\u4f5c\u7528\u662f\u6539\u53d8\u7279\u5b9a\u7a97\u53e3\u7684\u6269\u5c55\u98ce\u683c\uff0c\u5e76\u4e14\u4f1a\u5237\u65b0\u8be5\u7a97\u53e3\u7684\u5ba2\u6237\u533a\uff0c\u4ece\u800c\u7a97\u53e3\u4ea7\u751f\u89c6\u89c9\u4e0a\u7684\u53d8\u5316\u3002<\/p>\n
setwindowlong win32\u51fd\u6570\u7684\u8bed\u6cd5\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n
LONG_PTR SetWindowLongPtr(<\/p>\n
\u00a0\u00a0\u00a0\u00a0HWND hWnd, \/\/ \u7a97\u53e3\u53e5\u67c4<\/p>\n
\u00a0\u00a0\u00a0\u00a0int nIndex, \/\/ \u7a97\u53e3\u7c7b\u522b<\/p>\n
\u00a0\u00a0\u00a0\u00a0LONG_PTR dwNewLong \/\/ \u65b0\u7684\u957f\u6574\u578b\u6570\u503c<\/p>\n
);<\/p>\n
\u5176\u4e2d\uff0c\u53c2\u6570hWnd\u662f\u76ee\u6807\u7a97\u53e3\u7684\u53e5\u67c4\uff0c\u800c\u53c2\u6570nIndex\u5219\u5bf9\u5e94\u7740\u8981\u8bbe\u7f6e\u7684\u7a97\u53e3\u5c5e\u6027\u3002\u6700\u540e\u4e00\u4e2a\u53c2\u6570dwNewLong\u662f\u671f\u671b\u8bbe\u7f6e\u7684\u65b0\u7684\u957f\u6574\u578b\u6570\u503c\u3002<\/p>\n
\u5728Windows\u56fe\u5f62\u7528\u6237\u754c\u9762\u7f16\u7a0b\u4e2d\uff0csetwindowlong win32\u51fd\u6570\u88ab\u5e7f\u6cdb\u5e94\u7528\u4e8e\u81ea\u5b9a\u4e49\u7a97\u53e3\u6837\u5f0f\u548c\u884c\u4e3a\u3002\u4f8b\u5982\uff0c\u901a\u8fc7\u8c03\u7528\u8be5\u51fd\u6570\u53ef\u4ee5\u4fee\u6539\u7a97\u53e3\u7684\u6269\u5c55\u98ce\u683c\uff0c\u4ece\u800c\u5b9e\u73b0\u7279\u5b9a\u7684UI\u6548\u679c\uff0c\u6bd4\u5982\u6dfb\u52a0\u9634\u5f71\u6548\u679c\u3001\u4fee\u6539\u8fb9\u6846\u6837\u5f0f\u7b49\u3002<\/p>\n
\u9664\u4e86\u81ea\u5b9a\u4e49\u7a97\u53e3\u5916\u89c2\uff0csetwindowlong win32\u51fd\u6570\u8fd8\u53ef\u4ee5\u7528\u4e8e\u5411\u7a97\u53e3\u6dfb\u52a0\u989d\u5916\u7684\u6570\u636e\u4fe1\u606f\uff0c\u4ee5\u4fbf\u5728\u7a97\u53e3\u6d88\u606f\u5904\u7406\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u3002\u901a\u8fc7\u5c06\u81ea\u5b9a\u4e49\u6570\u636e\u4e0e\u7a97\u53e3\u5173\u8054\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u66f4\u52a0\u7075\u6d3b\u5730\u5904\u7406\u7a97\u53e3\u6d88\u606f\uff0c\u5b9e\u73b0\u66f4\u590d\u6742\u7684\u4ea4\u4e92\u903b\u8f91\u3002<\/p>\n
\u901a\u8fc7\u672c\u6587\u7684\u4ecb\u7ecd\uff0c\u6211\u4eec\u6df1\u5165\u4e86\u89e3\u4e86setwindowlong win32\u51fd\u6570\uff0c\u63a2\u8ba8\u4e86\u5176\u5728Windows\u7f16\u7a0b\u4e2d\u7684\u91cd\u8981\u6027\u548c\u5e94\u7528\u3002<\/strong>\u8fd9\u4e2a\u51fd\u6570\u4e0d\u4ec5\u53ef\u4ee5\u7528\u4e8e\u81ea\u5b9a\u4e49\u7a97\u53e3\u6837\u5f0f\u548c\u884c\u4e3a\uff0c\u8fd8\u53ef\u4ee5\u4e0e\u6d88\u606f\u5904\u7406\u76f8\u7ed3\u5408\uff0c\u4e3aWindows\u56fe\u5f62\u7528\u6237\u754c\u9762\u7f16\u7a0b\u63d0\u4f9b\u66f4\u591a\u7684\u53ef\u80fd\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" setwindowlongwin32\u662f\u4e00\u4e2a\u5728Windows\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u88ab\u5e7f\u6cdb\u4f7f\u7528\u7684\u5173\u952e\u51fd\u6570\u3002\u672c\u6587\u5c06\u5e26\u60a8\u6df1\u5165\u4e86\u89e3setwindowlongwin32\uff0c\u5e76\u63a2\u8ba8\u5176\u5728Windo<\/p>\n","protected":false},"author":1,"featured_media":64183,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","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":"","footnotes":""},"categories":[36],"tags":[52],"class_list":["post-74628","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-wxtx"],"_links":{"self":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/74628","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/comments?post=74628"}],"version-history":[{"count":0,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/posts\/74628\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media\/64183"}],"wp:attachment":[{"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/media?parent=74628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/categories?post=74628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techphant.cn\/wp-json\/wp\/v2\/tags?post=74628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}