{"id":41713,"date":"2003-11-25T10:00:00","date_gmt":"2003-11-25T10:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2003\/11\/25\/what-do-the-letters-w-and-l-stand-for-in-wparam-and-lparam\/"},"modified":"2021-01-15T15:20:41","modified_gmt":"2021-01-15T23:20:41","slug":"20031125-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20031125-00\/?p=41713","title":{"rendered":"What do the letters W and L stand for in WPARAM and LPARAM?"},"content":{"rendered":"<p>Once upon a time, Windows was 16-bit. Each message could carry with it two pieces of data, called <code>WPARAM<\/code> and <code>LPARAM<\/code>. The first one was a 16-bit value (&#8220;word&#8221;), so it was called W. The second one was a 32-bit value (&#8220;long&#8221;), so it was called L.<\/p>\n<p>You used the W parameter to pass things like handles and integers. You used the L parameter to pass pointers.<\/p>\n<p>When Windows was converted to 32-bit, the <code>WPARAM<\/code> parameter grew to a 32-bit value as well. So even though the &#8220;W&#8221; stands for &#8220;word&#8221;, it isn&#8217;t a word any more. (And in 64-bit Windows, both parameters are 64-bit values!)<\/p>\n<p>It is helpful to understand the origin of the terms. If you look at the design of window messages, you will see that if the message takes a pointer, the pointer is usually passed in the <code>LPARAM<\/code>, whereas if the message takes a handle or an integer, then it is passed in the <code>WPARAM<\/code>. (And if a message takes both, the integer goes in the <code>WPARAM<\/code> and the pointer goes in the <code>LPARAM<\/code>.)<\/p>\n<p>Once you learn this, it makes remembering the parameters for window messages a little easier. Conversely, if a message breaks this rule, then it sort of makes your brain say, &#8220;No, that&#8217;s not right.&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once upon a time, Windows was 16-bit. Thus begins the story of where the letters came from.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[2],"class_list":["post-41713","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-history"],"acf":[],"blog_post_summary":"<p>Once upon a time, Windows was 16-bit. Thus begins the story of where the letters came from.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=41713"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41713\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=41713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=41713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=41713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}