On a Pocket PC device or emulator, gets the rectangular coordinates, in pixels, of the current window—which does not include the area occupied by the Soft Input Panel (SIP) when the latter is visible. On the desktop, GetDeskRect gets the coordinates of the desktop monitor.
int GetDeskRect (long left, long top, long right, long bottom)
Argument |
Description |
---|---|
left |
Leftmost value (typically 0) of the rectangular area occupied by the:
|
top |
Topmost value of the rectangular area occupied by the:
|
right |
Rightmost value of the rectangular area occupied by the:
|
bottom |
Bottommost value of the rectangular area occupied by:
|
Integer. Returns 1 for success and -1 for failure.
Typically it is useful to know the bottommost coordinate of the current window when the SIP is visible. That way you can adjust the positions and sizes of controls on the window to account for the smaller display size of the window when the SIP is being used.
The following example displays the coordinates for the current window in a multiline edit text box:
String strDisplay="" int rc long left = 0, top = 0, right = 0, bottom = 0
rc = GetDeskRect(left, top, right, bottom) strDisplay +=("Desk RECT:~r~n~t Left = " +string(left)& +"~r~n~t Top=" + String(top) + "~r~n~t Right = " & + String(right)+ "~r~n~t Bottom = " + String(bottom)) mle_1.text = strDisplay