Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

minimize other window


i work on project with wni 32 API in VC++6.0.
i have function that take an argument whose this is a HWND variable.
i want minimize window that have this handle.
this is source of my function

void min2(HWND hwnd){
typedef struct POINT{
long x;
long y;
}point;


typedef struct RECT{
long int top;
long int bottom;
long int left;
long int right;
}rect;
typedef struct tagWINDOWPLACEMENT {
UINT length;
UINT flags;
UINT showCmd;
POINT ptMinPosition;
POINT ptMaxPosition;
RECT rcNormalPosition;
} mn;
tagWINDOWPLACEMENT *PWINDOWPLACEMENT, *PWT;
tagWINDOWPLACEMENT myWP;

myWP.length = sizeof(WINDOWPLACEMENT);
myWP.showCmd = SW_SHOWMINIMIZED;
myWP.flags = WPF_SETMINPOSITION;

myWP.ptMinPosition.x = (long)0;
myWP.ptMinPosition.y = (long)0;
myWP.rcNormalPosition.left = (long)10;
myWP.rcNormalPosition.top = (long)100;
myWP.rcNormalPosition.right = (long)100;
myWP.rcNormalPosition.bottom = (long)100;



PWT = &myWP;

if (IsWindow(hwnd))
::SetWindowPlacement(hwnd ,*PWT);


return;
}

VC take an error in compiling that i do not understand it?
i do all work that i can do but .....

e:myspywinspy.cpp(402) : error C2664: 'SetWindowPlacement' : cannot convert parameter 2 from 'struct min2::tagWINDOWPLACEMENT' to 'const struct tagWINDOWPLACEMENT *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
Error executing cl.exe.

very thanks for any reply


Comments

Sign In or Register to comment.