Keep in mind, that on Windows top level window receives WM_GETMINMAXINFO message prior to WM_NCCREATE. Such behavior can be fatal for application that executes window initialization code in WM_NCCREATE message handler, since when receiving WM_GETMINMAXINFO window is not initialized yet.
Oh, that cruel, stupid world...
Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts
Nov 7, 2009
Oct 22, 2009
Another good reason not to run program by its name in Windows
When searching for executable by its name Windows always looks in:
If name does not contains file extension (for example notepad or attrib), Windows will use glob "name.*" to find file with extension that is listed in PATHEXT environment variable.
It's okay if you need just to run notepad or mspaint from command line. But what if you need to execute some program many times? Well, running it by its name is definitely not your choice. I'll try to explain why.
- Current working directory
- Windows system directory (use GetSystemDirectory() to obtain it)
- Windows directory (use GetWindowsDirectory() to obtain it)
- Directories listed in PATH environment variable
If name does not contains file extension (for example notepad or attrib), Windows will use glob "name.*" to find file with extension that is listed in PATHEXT environment variable.
It's okay if you need just to run notepad or mspaint from command line. But what if you need to execute some program many times? Well, running it by its name is definitely not your choice. I'll try to explain why.
Oct 5, 2009
Whether this windows binary is 32- or 64-bit?
The fastest way to answer on this question without using special software tools is:
- Open windows binary file in any text/hex editor (notepad is enough)
- Find first occurrence of "PE" string (it will be probably placed at offset 0xD0, 0xF0 or something like that after phrase "This program cannot be run in DOS mode")
- Skip 2 non-printable symbols (both '\0')
- Look on the symbol you are at:
- 'L' - i386 binary (x86)
- 'd' - amd64 binary (x64/x86-64)
- '\0' (zero) - ia64 binary
Subscribe to:
Posts (Atom)