From: Franz Bachler on
> This last part does not make sense as surely the button image is a bitmap
> and not an icon and therefore the call should fail. Are you sure the icon
> is actually in the resource file of the executable and not in a different
> rc file which might be part of your DLL for example ? This issue would be
> highlighted if you used hInstance in the LoadIcon call and not
> GetModuleHandle(NULL). Also while we are at it, LoadImage is now the
> preferred API from memory.
> Leslie

For test reason:

if (LoadIcon(hInstance, MAKEINTRESOURCE(ICO_NAME)) exit(0);

is !=NULL because the program exits. But

SendMessage(hWnd, WM_SETICON, (WPARAM) FALSE,
(LONG) LoadIcon(ghInst, MAKEINTRESOURCE(ICO_NAME)));

doesn't set the Icon in the window. Maybe the OpenCV-Window is so good
"boxed" that it's "unreachable" for commands?

SetClassLong( hWnd, GCL_HICON,
(LONG) LoadIcon( hInstance, MAKEINTRESOURCE(ICO_NAME ) );

works for the dialog box in the same program (same source file and exe
file). I've only one .RC and C-Source File and EXE-File. highgui100.dll,
cxcore100.dll and libguide40.dll are necessary for the program and directly
from OpenCV and not compiled from me.