我想使GetFileSaveName()打开的文件框居中显示,有什么办法?

李海峡 2004-11-16 05:19:33
如题?
...全文
249 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
a109788522 2005-02-24
  • 打赏
  • 举报
回复
我也是觉得奇怪呀,你的打开窗口难道不是居中吗?
看了再说,

记住,可要结贴呀
WorldMobile 2004-11-19
  • 打赏
  • 举报
回复
balloonman2002说的对,先用FindwindowA函数找到Handle,然后用GetWindowRect取位置,再用MoveWindow移动对话框位置即可,不麻烦,写写试试吧
balloonman2002 2004-11-17
  • 打赏
  • 举报
回复
是的,需要自己定义一个结构

Type stc_rect
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
李海峡 2004-11-17
  • 打赏
  • 举报
回复
是不是自己先要定义这样一个类型
李海峡 2004-11-17
  • 打赏
  • 举报
回复
Function Boolean GetWindowRect ( Ulong hWnd ,ref stc_rect lpRect ) Library "user32.dll" 添加外部函数时提示"stc_rect"是非法的数据类型,这是怎么回事啊?
逍遥的心 2004-11-16
  • 打赏
  • 举报
回复
Function Ulong FindWindowA ( String lpClassName ,String lpWindowName ) Library "user32.dll"

Function Boolean GetWindowRect ( Ulong hWnd ,ref stc_rect lpRect ) Library "user32.dll"

Function Boolean MoveWindow ( Ulong hWnd ,int X ,int Y ,int nWidth ,int nHeight ,Boolean bRepaint ) Library "user32.dll"
balloonman2002 2004-11-16
  • 打赏
  • 举报
回复
简单的说,就是利用下面几个API:

Function Ulong FindWindowA ( String lpClassName ,String lpWindowName ) Library "user32.dll"

Function Boolean GetWindowRect ( Ulong hWnd ,ref stc_rect lpRect ) Library "user32.dll"

Function Boolean MoveWindow ( Ulong hWnd ,int X ,int Y ,int nWidth ,int nHeight ,Boolean bRepaint ) Library "user32.dll"

同时对于messagebox和getfilesavename所弹出的对话框类名都是 #32770,因此基本可以通用,只要修改:

lccuo_thread.Post of_center (‘#32770’ ,‘Demostration’ ,2000 )

一句当中的‘Demostration’ 为你的getfilesavename参数即可

mnsiii 2004-11-16
  • 打赏
  • 举报
回复
难道你用GetFileSaveName()打开的窗口不是居中的?太奇怪了!要不你试试FindWindowA()
据说这个函数只适用于pb自己的窗口!
balloonman2002 2004-11-16
  • 打赏
  • 举报
回复
跟 http://www.sybase.com.cn/cn/content/developer/exp_kfzly_jqhz_PB_dialog_center_show.htm
一文方法一样

680

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder API 调用
社区管理员
  • API 调用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧