请问用PB怎样写命令拷贝文件?,怎样把某一个窗口放到系统的最顶层?

jackygan 2002-01-26 04:46:45
请问用PB怎样写命令拷贝文件?,怎样把某一个窗口放到系统的最顶层?
...全文
202 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
rock_csdn 2002-02-03
  • 打赏
  • 举报
回复
给你一个查找WINDOW句柄的API,可能用得到
FindWindowEx

VB声明
Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
说明
在窗口列表中寻找与指定条件相符的第一个子窗口
返回值
Long,找到的窗口的句柄。如未找到相符窗口,则返回零。会设置GetLastError
参数表
参数 类型及说明
hWnd1 Long,在其中查找子的父窗口。如设为零,表示使用桌面窗口(通常说的顶级窗口都被认为是桌面的子窗口,所以也会对它们进行查找)
hWnd2 Long,从这个窗口后开始查找。这样便可利用对FindWindowEx的多次调用找到符合条件的所有子窗口。如设为零,表示从第一个子窗口开始搜索
lpsz1 String,欲搜索的类名。零表示忽略
lpsz2 String,欲搜索的类名。零表示忽略
zhanwei 2002-02-03
  • 打赏
  • 举报
回复
第二个问题:
在PB中使用SetPosition(TopMost!)是很好用的
如在窗口OPEN事件下:
This.SetPosition(TopMost!)
可以使窗口处于最顶层
jackygan 2002-02-03
  • 打赏
  • 举报
回复
问题已解决,多谢!
llitcwl 2002-02-02
  • 打赏
  • 举报
回复
第二个问题,用SetWindowPos是最准确的,如下:
FUNCTION BOOLean SetWindowPos( ulong hWnd,ulong hWndInsertAfter, int X,int Y, int cx, int cy,UINT uFlags ) LIBRARY "user32.dll"

ll_winhandle=handle(this)
if ll_winhandle >0 then
SetWindowPos(ll_winhandle,- 1,0,0,0,0,1)
end if
tiantianpb 2002-02-02
  • 打赏
  • 举报
回复
to :wzyun(空白)去看看我的问题吧
wzyun 2002-02-02
  • 打赏
  • 举报
回复
Boolean lb_rtn
ulong lu_handle
lu_handle = handle(w_test)//w_test就是你要放在前面的窗口
lb_rtn = BringWindowToTop(lu_handle)
jackygan 2002-02-02
  • 打赏
  • 举报
回复
sincerity(sincerity)兄:
你好第一个问题已解决,可是第二个问题未OK,请写详细一点,谢。
liulee 2002-01-26
  • 打赏
  • 举报
回复

来晚,揭帖吧。

sincerity 2002-01-26
  • 打赏
  • 举报
回复
1.FUNCTION boolean CopyFileA(ref string cfrom, ref string cto, boolean flag) LIBRARY "Kernel32.dll"

string l_from, l_to
boolean l_flag, rtn
l_flag = false // false means it will overwrite a file if it already exists.
l_from = string(sle_from.text)
l_to = string(sle_to.text)
rtn = CopyFileA(l_from, l_to, l_flag)
MessageBox("CopyFile", string(rtn))

2.Function boolean BringWindowToTop( ulong hwnd ) Library "User32.dll"
fzymr 2002-01-26
  • 打赏
  • 举报
回复
错了,应该是FileCopy函数
fzymr 2002-01-26
  • 打赏
  • 举报
回复
1、copyfile函数(pb8)

2、window.SetPosition(TopMost!)

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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