This is a mirror of official site: http://jasper-net.blogspot.com/

Win32 Tips and Tricks

| Sunday, February 27, 2011
Introduction

In this article, I'm going to present a number of small tips and tricks when using the Win32 API. None of them are interesting enough to warrant a separate article, but together they make an interesting collection. Some are workarounds for shortcomings in Windows, some aim to improve usability for you as a developer and for your users, and some describe common gotchas in Win32.

Note: The code in this article is tested on Windows 2000 and Windows XP. Some of it may also apply to older or newer versions of the OS.

Contents

Common Dialogs

  • How to set the initial folder in SHBrowseForFolder
  • Browse for folder using GetOpenFileName
  • How to restore the size of the file dialog
  • How to restore the view settings of the file dialog
Common Controls
  • Reducing flicker in a group box
  • How to correctly resize a static control
  • Handling selection in a list view
  • Structure sizes
Resources
  • Support for multiple languages in one RC file
  • Database for all string resources
Wait, There's More
  • Control the tab order of MDI windows
  • Asserts in a GUI application
Sample Projects
History

Common Dialogs

How to set the initial folder in SHBrowseForFolder

The standard way to let the user select a folder is the SHBrowseForFolder function. It is very clunky, and hasn't been updated much since Windows 95. One problem is that, by default, it starts from the root of the file system. Imagine you have a path setting with a browse button [...] to pick a folder:

Read more: Codeproject

Posted via email from Jasper-net

0 comments: