Hello,
I want to write a lister plugin for displaying bayer-bmp images in color.
I looked at the listplugsample from ghisler.com. My problem is that I cannot use a registered window class because I want to display the bmp with StretchDIBits(...) So I have to make my own window for using in CreateWindow(); with RegisterClass.
But I do not know how to do this. Has someone an example?
Thanks - Robert
S: Example for displaying bmp
Moderators: Hacker, petermad, Stefan2, white
Maybe this sample lister plugin is of help. You might need to replace CreateDialog by CreateWindow, however.
tbeu
tbeu
TC plugins: Autodesk 3ds Max / Inventor / Revit Preview, FileInDir, ImageMetaData (JPG Comment/EXIF/IPTC/XMP), MATLAB MAT-file Viewer, Mover, SetFolderDate, Solid Edge Preview, Zip2Zero and more
Hello,
thanks. But it flickers.
Here is my WndProc:
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CSimpleDIB * dib=(CSimpleDIB*)GetWindowLong(hWnd, GWL_USERDATA);
switch (message)
{
case WM_PAINT:
HDC hDC;
PAINTSTRUCT ps;
hDC = BeginPaint(hWnd, &ps);
RECT rc;
GetClientRect(hWnd,&rc);
StretchBlt(hDC,
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top,
dib->GetHDC(), 0, 0,
dib->GetWidth(), dib->GetHeight(), SRCCOPY);
EndPaint(hWnd, &ps);
// MSDN: An application returns zero if it processes this message.
return 0;
case WM_ERASEBKGND :
// An application should return nonzero if it erases the background;
return 1;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
Where is the problem?
Thanks - Robert
thanks. But it flickers.

LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
CSimpleDIB * dib=(CSimpleDIB*)GetWindowLong(hWnd, GWL_USERDATA);
switch (message)
{
case WM_PAINT:
HDC hDC;
PAINTSTRUCT ps;
hDC = BeginPaint(hWnd, &ps);
RECT rc;
GetClientRect(hWnd,&rc);
StretchBlt(hDC,
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top,
dib->GetHDC(), 0, 0,
dib->GetWidth(), dib->GetHeight(), SRCCOPY);
EndPaint(hWnd, &ps);
// MSDN: An application returns zero if it processes this message.
return 0;
case WM_ERASEBKGND :
// An application should return nonzero if it erases the background;
return 1;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
Where is the problem?
Thanks - Robert
I just get the tip:
> Perhaps one of the owner windows does the update?
> You could try the add WS_CLIPCHILDREN to the style of the parent
> window.
I tried
LONG oldStyle = GetWindowLong(ParentWin, GWL_STYLE);
oldStyle &= WS_CLIPCHILDREN;
SetWindowLong(ParentWin, GWL_STYLE, oldStyle);
in the ListLoad function without luck.

> Perhaps one of the owner windows does the update?
> You could try the add WS_CLIPCHILDREN to the style of the parent
> window.
I tried
LONG oldStyle = GetWindowLong(ParentWin, GWL_STYLE);
oldStyle &= WS_CLIPCHILDREN;
SetWindowLong(ParentWin, GWL_STYLE, oldStyle);
in the ListLoad function without luck.
