Matmaus / LnkParse3

Windows Shortcut file (LNK) parser
MIT License
63 stars 13 forks source link

bugfix: WINDOW_STYLES[1] must be SW_SHOWNORMAL, not SW_NORMAL #10

Closed ernix closed 3 years ago

ernix commented 3 years ago

Both SW_* and nCmdShow values don't correspond to each other exactly. For example, SW_MAXIMIZE and SW_SHOWMAXIMIZE have same value 3.

[MS-SHLLINK].pdf p.12 states that:

ShowCommand (4 bytes): A 32-bit unsigned integer that specifies the expected window state of an application launched by the link. This value SHOULD be one of the following.

  • SW_SHOWNORMAL 0x00000001 The application is open and its window is open in a normal fashion.

  • SW_SHOWMAXIMIZED 0x00000003 The application is open, and keyboard focus is given to the application, but its window is not shown.

  • SW_SHOWMINNOACTIVE 0x00000007 The application is open, but its window is not shown. It is not given the keyboard focus.

All other values MUST be treated as SW_SHOWNORMAL.

SEE ALSO: https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SHLLINK/%5bMS-SHLLINK%5d.pdf https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow

Matmaus commented 3 years ago

Thank you for the provided links. Good point :+1: