设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 1377|回复: 8
打印 上一主题 下一主题

[其它] 请教!如何获取当前窗口在屏幕上位置的参数

[复制链接]
跳转到指定楼层
1#
发表于 2003-4-29 23:58:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
及窗口左上角在屏幕上的位置
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅

点击这里给我发消息

2#
发表于 2003-4-30 00:15:00 | 只看该作者
查一下API。ACCESS不提供类似内置功能,这样的只能通过API获取。
3#
 楼主| 发表于 2003-4-30 02:47:00 | 只看该作者
可以用:DoCmd.MoveSize 1134, 1134 指定被打开窗体的位置,我想也可以找到已打开窗体的位置参数吧!
烦请高手赐教!!!
4#
发表于 2003-4-30 06:08:00 | 只看该作者
使用如下 api 获得指定窗口的位置,
请注意,你必须声明 rect,postionapi,windowplacement 三个结构.
Private Declare Function GetWindowPlacement Lib "user32" Alias "GetWindowPlacement" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
5#
 楼主| 发表于 2003-4-30 19:43:00 | 只看该作者

Roadbeg 谢谢您的回答


可我还是不太懂,你能给具体做一下吗?非常感谢,拜托了!!!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
6#
发表于 2003-4-30 23:42:00 | 只看该作者
GetWindowPlacement
The GetWindowPlacement function retrieves the show state and the restored, minimized, and maximized positions of the specified window.

BOOL GetWindowPlacement(
  HWND hWnd,               // handle to window
  WINDOWPLACEMENT *lpwndpl // address of structure for position data
);

Parameters
hWnd
Handle to the window.
lpwndpl
Pointer to the WINDOWPLACEMENT structure that receives the show state and position information.
Before calling GetWindowPlacement, set the length member of the WINDOWPLACEMENT structure to sizeof(WINDOWPLACEMENT). GetWindowPlacement fails if lpwndpl->length is not set correctly.

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, callGetLastError.

Remarks
The flags member of WINDOWPLACEMENT retrieved by this function is always zero. If the window identified by the hWnd parameter is maximized, the showCmd member is SW_SHOWMAXIMIZED. If the window is minimized, showCmd is SW_SHOWMINIMIZED. Otherwise, it is SW_SHOWNORMAL.

The length member of WINDOWPLACEMENT must be set to sizeof(WINDOWPLACEMENT). If this member is not set correctly, the function returns FALSE. For additional remarks on the proper use of window placement coordinates, see WINDOWPLACEMENT.

QuickInfo
  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also
Windows Overview, Window Functions, SetWindowPlacement, WINDOWPLACEMENT
7#
发表于 2003-5-1 01:24:00 | 只看该作者

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
8#
 楼主| 发表于 2003-5-1 02:28:00 | 只看该作者
非常感谢Roadbeg !!!
正是吾所需,谢谢!


9#
发表于 2008-8-13 09:40:41 | 只看该作者
学习[:30]
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-9-25 14:19 , Processed in 0.092868 second(s), 34 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表