Article ID: 151257
Article Last Modified on 2/12/2007
#include "stdafx.h"
#include "Disable.h"
#define IDS_MEMVIEWCLASS 11005
BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID
lpReserved)
{
return 1;
UNREFERENCED_PARAMETER(hInst);
UNREFERENCED_PARAMETER(ul_reason_being_called);
UNREFERENCED_PARAMETER(lpReserved);
}
void DISABLE_API disable(char *title, char *header) {
// This line is a handle for parent window.
HWND hWnd,
// This line is a handle for child window.
hChild;
// Try to find the parent window of the Report Preview window.
hWnd = FindWindow(NULL, title);
char title1[75];
// Try to find the first child window.
hChild = GetWindow(hWnd,GW_CHILD);
while (hChild != 0)
{
hWnd = hChild;
// Try to find the first sibling of the child window.
hChild = GetWindow(hWnd,GW_HWNDNEXT);
while (hChild != 0)
{
hWnd = hChild;
GetWindowText(hWnd,title1,75);
if (strcmp(title1,header) == 0) {
DWORD L;
// Disable the Minimize button and the Maximize button of the Report Preview window.
L = GetWindowLong(hChild, GWL_STYLE);
L = L & ~(WS_MINIMIZEBOX);
L = L & ~(WS_MAXIMIZEBOX);
SetWindowLong(hChild,GWL_STYLE,L);
// Redraw the Report Preview window.
SetWindowPos(hChild,NULL,0,0,0,0,
SWP_DRAWFRAME|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE);
return;
}
hChild = GetWindow(hWnd,GW_HWNDNEXT);
}
hChild = GetWindow(hWnd,GW_CHILD);
}
return;
}extern "C" DISABLE_API void disable(char *, char *);
REPORT FORM HOME(2)+"tastrade\reports\salessum.frx" PREVIEW nowait
DECLARE integer disable IN KBTest.DLL string, string
=disable("Microsoft Visual FoxPro",;
"Report Designer - salessum.frx - Page 1")Use the following code sample for Visual FoxPro 8.0 and for Visual FoxPro 9.0.REPORT FORM HOME(2)+"solution\reports\colors.frx" PREVIEW nowait
DECLARE integer disable IN KBTest.DLL string, string
=disable("Microsoft Visual FoxPro",;
"Report Designer - colors.frx - Page 1")
Additional query words: VFoxWin akz
Keywords: KB151257