jintajak
asked on
To rwilson....again
To rwilson In Question Q.10177440
in frist convert C++ to Delphi it not work.
Now I'm to past it agian. Can you help me again please??
************************** ********** ********** ********** *******
int buffsize;
UINT x;
RGNDATA *buff;
POINT TopLeft;
// Get the size of buffer required
buffsize = GetRegionData(region, 0, 0);
if (buffsize != 0)
{
buff = (RGNDATA *) new BYTE [buffsize];
// Now get the region data
if(GetRegionData(region, buffsize, buff))
{
for (x=0; x<(buff->rdh.nCount); x++)
{
// Obtain the rectangles from the list
RECT *urect = (RECT *) (((BYTE *) buff) + sizeof(RGNDATAHEADER) + (x * sizeof(RECT)));
}
delete [] buff;
}
}
************************** ********** ********** ********** *******
in frist convert C++ to Delphi it not work.
Now I'm to past it agian. Can you help me again please??
**************************
int buffsize;
UINT x;
RGNDATA *buff;
POINT TopLeft;
// Get the size of buffer required
buffsize = GetRegionData(region, 0, 0);
if (buffsize != 0)
{
buff = (RGNDATA *) new BYTE [buffsize];
// Now get the region data
if(GetRegionData(region, buffsize, buff))
{
for (x=0; x<(buff->rdh.nCount); x++)
{
// Obtain the rectangles from the list
RECT *urect = (RECT *) (((BYTE *) buff) + sizeof(RGNDATAHEADER) + (x * sizeof(RECT)));
}
delete [] buff;
}
}
**************************
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Um...,agian What is PRECT?? and Now I increase points +10= 50 to rwilson again. with ask last problem??
WPARAM wParam
HANDLE prop = GetProp(hWnd, (LPCTSTR) MAKELONG(MYATOM, 0));
if (prop != (HANDLE) wParam)
{
........
}
WPARAM wParam
HANDLE prop = GetProp(hWnd, (LPCTSTR) MAKELONG(MYATOM, 0));
if (prop != (HANDLE) wParam)
{
........
}
This line:
urect := PRect (integer(pointer(buff)) + sizeof(RGNDATAHEADER) + (x * sizeof(TRECT)));
is probably OK, but you could change it like this:
urect := PRect (cardinal(pointer(buff)) + sizeof(RGNDATAHEADER) + (x * sizeof(TRECT)));
2. PRect is a pointer to TRect (Type PRect = ^TRect). It's in windows.pas...
3. WPARAM wParam
HANDLE prop = GetProp(hWnd, (LPCTSTR) MAKELONG(MYATOM, 0));
if (prop != (HANDLE) wParam)
{
........
}
Should become:
wParam : WPARAM;
prop : THANDLE;
prop := GetProp(hWnd, MAKELONG(MYATOM, 0));
if (prop <> THandle(wParam)) then
begin
........
end;
(Assuming hWnd is aome var containing the window handle)
Cheers,
Raymond.
urect := PRect (integer(pointer(buff)) + sizeof(RGNDATAHEADER) + (x * sizeof(TRECT)));
is probably OK, but you could change it like this:
urect := PRect (cardinal(pointer(buff)) + sizeof(RGNDATAHEADER) + (x * sizeof(TRECT)));
2. PRect is a pointer to TRect (Type PRect = ^TRect). It's in windows.pas...
3. WPARAM wParam
HANDLE prop = GetProp(hWnd, (LPCTSTR) MAKELONG(MYATOM, 0));
if (prop != (HANDLE) wParam)
{
........
}
Should become:
wParam : WPARAM;
prop : THANDLE;
prop := GetProp(hWnd, MAKELONG(MYATOM, 0));
if (prop <> THandle(wParam)) then
begin
........
end;
(Assuming hWnd is aome var containing the window handle)
Cheers,
Raymond.
ASKER
This Line:
--->prop := GetProp(hWnd, MAKELONG(MYATOM, 0))
it compile error, but use
--->prop := GetProp(hWnd, PCHAR(MYATOM));
it compile pass.......sorry I don't to tell you.
--->prop := GetProp(hWnd, MAKELONG(MYATOM, 0))
it compile error, but use
--->prop := GetProp(hWnd, PCHAR(MYATOM));
it compile pass.......sorry I don't to tell you.
jintajak:
Sorry, I was thinking of Atom in terms of the TAtom type (a word) - which is hows it looks in your C++ code.
Does it work correctly with the PChar cast?
Cheers,
Raymond.
Sorry, I was thinking of Atom in terms of the TAtom type (a word) - which is hows it looks in your C++ code.
Does it work correctly with the PChar cast?
Cheers,
Raymond.
ASKER
Sorry rwilson.......last again
Now!! in problem I forget some line of source code have problem. I want to you help me again with increase 10+ = 60. Old problem I to clear ready with Excellent and good Idea and some knowledge. C++ is easy I think but I don't know it something.
************************** ********** ********** **
WPARAM wParam
LPARAM lParam
MSG *msg = (MSG *) lParam;
if (wParam & PM_REMOVE)
{
MyHandle(msg->message, msg->hwnd, msg->wParam, msg->lParam);
}
************************** ********** ********** ***
Now!! in problem I forget some line of source code have problem. I want to you help me again with increase 10+ = 60. Old problem I to clear ready with Excellent and good Idea and some knowledge. C++ is easy I think but I don't know it something.
**************************
WPARAM wParam
LPARAM lParam
MSG *msg = (MSG *) lParam;
if (wParam & PM_REMOVE)
{
MyHandle(msg->message, msg->hwnd, msg->wParam, msg->lParam);
}
**************************
This should look something like this:
wParam :WPARAM ;
lParam :LPARAM ;
msg : PMSG; // Defined as ^TMSG in windows.pas
msg := PMSG(LParam);
if (wParam AND PM_REMOVE) <> 0 then
MyHandle(msg^.message, msf^.hwnd, msg^.wParam, msg^.lParam);
Cheers,
Raymond.
wParam :WPARAM ;
lParam :LPARAM ;
msg : PMSG; // Defined as ^TMSG in windows.pas
msg := PMSG(LParam);
if (wParam AND PM_REMOVE) <> 0 then
MyHandle(msg^.message, msf^.hwnd, msg^.wParam, msg^.lParam);
Cheers,
Raymond.
ASKER
Thak you so much. rwilson see you next time
ASKER
/ Obtain the rectangles from the list
urect := PRect (integer(pointer(buff)) + sizeof(RGNDATAHEADER) + (x * sizeof(TRECT)));
<<<is line [Warning] Comparing signed and unsigned types - widened both operands>>>
I think it not problem to use it. or you comment or suggest about it.