Saturday, February 21, 2009

Visual C++ and MFC Tips Index

General Programming

How can I get debug information from my program in the field ?

What is "Hungarian" notation?

Dialogs and Controls

Why don't all my controls appear in ClassWizard?

How do I draw a bitmap in the background of a dialog?

Why doesn't my combo box dropdown appear when I click the down arrow?

How do I create one of those neato expanding dialogs?

How do I change the background colour of an edit field on a dialog?

My dialog closes when the user hits the Enter/Return or Esc key. Why?

How do I change the colour or background of a static text item on a dialog?

How Do I Create Controls on the Fly?

My application sometimes hangs when I hit an accelerator key. Why?

How do put a clickable URL in a dialog?

How do I change the font(s) in an MFC application dialog?

Microsoft Foundation Classes

I've added a menu to my dialog. Why don't the UPDATE_COMMAND_UI handlers get called?

How do I make an invisible dialog-based application?

How do I change the displayed icon of my MFC app on the fly?

I've disabled a menu item on my MFC program using EnableMenuItem, but it won't go gray. Why?

What's the best way to send myself a message in MFC?

How do I Create >16 Colour Toolbars?

Processes Threads and Files

How do I recurse through a directory tree?
How do I extract the version of an EXE or DLL?
How do I ensure that only one instance of my program runs?
What are the pros and cons of the different IPC methods?
Given a PID, how do I find the name of the process executable?
How do I delete a directory tree that isn't empty?
How do I get started working with threads?
I start another app and try and wait synchronously on its process handle, but both processes hang. Why?
How do I get the name of the EXE associated with a given window?

How do I run another program from my program?

I can't make CreateProcess launch my process or handle its parameters. Why?
How do I determine the full path to my own executable file at run-time?

How do I start another process and wait for it to complete before continuing?

Interacting with the Shell

How do I place an icon in the system tray?
How do I find the default web browser application name?
How do I stop my application appearing on the taskbar?
Why doesn't my context menu dismiss properly when I click elsewhere?
How do I start, detect and stop screen savers?
How do I get the handle of the taskbar?

How do I stop my application appearing on the taskbar?

How do I get back the OLD SetForegroundWindow behaviour?

My app leaves a phantom gray button on the taskbar when it exits. Why?

SHFileOperation gives file system error 1026. Why?

My app sometimes crashes when the user clicks on a tree control. Why?

How do I programmatically dismiss a menu?

How do I find out which edge the Windows Taskbar is on?

How do I open SHBrowseForFolder at a pre-determined location ?

How do I add a manifest to a VC6 application?

Users Groups and the Registry

How do I put new entries in the registry?

How do I grab the users password under NT4/2000/XP?

How do I determine if a given user is in a given group?

Compiler Issues

I keep getting "undeclared identifier" compilation failures, even though I've included all necessary headers as far as I can see. Why?

My app works in debug build, but crashes in release. What's the difference between the two?

Why won't the compiler let me use a class member function as a callback?

What do I need to compile a 16 bit DOS or Windows 3.1 program?

Miscellaneous Win32

Why doesn't my system wide hook capture all processes ?

How do I let the user drag a window which has no titlebar?

Is there a way to redirect stdout to my application window?

How do I find out which version of NT (server or workstation) I'm running on?

How do I stop the user resizing my window?

How do I programmatically dismiss a menu?

How do I make a window "Topmost"?

How do I find the default web browser application name?

How do I find the current IP address(es) of my machine?

I've created a 16×16 icon for my app. Why does Windows insist on squishing up the 32×32 version?

How do I constrain window resizing to always be square?

How do I enumerate the drives on my hosting machine?

Why does QueryPerformanceFrequency fail with error 998?

How do I determine that another machine is present on the network?

How do I find out the drive letters in use on a given system?

How do I allow the user to cancel a time-consuming operation?

When I use a big (> 1MB) automatic-declared array my app crashes. Why?

How do I make accurate timings under Win32?

How do I determine if the user can see my window?

How do I grab events for all applications? An example system-wide hook.


0 nhận xét:

Post a Comment