当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·高分100请高手,少了再加    »显示摘要«
    摘要: connect using sqlca; string errors,sql_syntax string presentation_str,dwsyntax_str //定义数据窗口的数据来源 sql_syntax="select * from jk order by jk_no" //定义数据窗口显示字符串 presentation_str="style(t......
 ·关键字的疑惑    »显示摘要«
    摘要: volatile int m_i;和去掉volatile好象运行的效果是一样的,到底加这个关键字有什么作用 ......


假如我用程序启动了一个word ,如何获得它的hWnd-窗口句柄

假如我用程序启动了一个word   ,如何获得它的hWnd-窗口句柄

NO.1   作者: reayi

findwindow(vbnullstring,窗口标题名),成功返回句柄,失败返回0

NO.2   作者: JennyVenus

theword   =   findwindow   (   "OpusApp",   vbnullstring   )  
   
  用timer可以做到,中间那个分割条好像不好做

NO.3   作者: jintianatxd

获得句柄后可以用timer   定时返回两个窗口的尺寸,使两个窗口的尺寸和等于指定的数值.  
  关注...

NO.4   作者: JennyVenus

针对两个记事本  
   
  Option   Explicit  
  Dim   b   As   Boolean  
  Private   Sub   Form_Load()  
          Timer1.Enabled   =   True  
          Timer1.Interval   =   100  
          n0   =   0  
          n1   =   0  
  End   Sub  
   
  Private   Sub   Timer1_Timer()  
          If   Not   b   Then  
                  b   =   True  
          Else  
                  If   n0   <>   0   And   n1   <>   0   Then  
                          Dim   r   As   RECT  
                          GetWindowRect   n0,   r  
                          SetWindowPos   n1,   0,   0,   r.Bottom,   Screen.Width   /   15,   Screen.Height   /   15   -   r.Bottom,   0  
                  Else  
                          n0   =   0  
                          n1   =   0  
                          EnumWindows   AddressOf   myenum,   ByVal   0&  
                  End   If  
          End   If  
  End   Sub  
   
  -----------------------------------------------  
   
  Option   Explicit  
  Public   Declare   Function   EnumWindows   Lib   "user32"   (ByVal   lpEnumFunc   As   Long,   ByVal   lParam   As   Long)   As   Long  
  Public   Declare   Function   GetClassName   Lib   "user32"   Alias   "GetClassNameA"   (ByVal   hwnd   As   Long,   ByVal   lpClassName   As   String,   ByVal   nMaxCount   As   Long)   As   Long  
  Public   Declare   Function   SetWindowPos   Lib   "user32"   (ByVal   hwnd   As   Long,   ByVal   hWndInsertAfter   As   Long,   ByVal   x   As   Long,   ByVal   y   As   Long,   ByVal   cx   As   Long,   ByVal   cy   As   Long,   ByVal   wFlags   As   Long)   As   Long  
  Public   Declare   Function   GetWindowRect   Lib   "user32"   (ByVal   hwnd   As   Long,   lpRect   As   RECT)   As   Long  
  Public   Declare   Function   MoveWindow   Lib   "user32"   (ByVal   hwnd   As   Long,   ByVal   x   As   Long,   ByVal   y   As   Long,   ByVal   nWidth   As   Long,   ByVal   nHeight   As   Long,   ByVal   bRepaint   As   Long)   As   Long  
  Public   Type   RECT  
                  Left   As   Long  
                    As   Long  
                  Right   As   Long  
                  Bottom   As   Long  
  End   Type  
   
  Public   n0   As   Long  
  Public   n1   As   Long  
  Public   Function   myenum(ByVal   hwnd   As   Long,   ByVal   lParam   As   Long)   As   Long  
          Dim   ss   As   String   *   255  
          GetClassName   hwnd,   ss,   255  
          If   remove0(ss)   =   "Notepad"   And   n0   =   0   Then  
                  n0   =   hwnd  
          End   If  
          If   remove0(ss)   =   "Notepad"   And   n1   =   0   And   n0   <>   0   And   hwnd   <>   n0   Then  
                  n1   =   hwnd  
          End   If  
          myenum   =   1  
  End   Function  
  Public   Function   remove0(ByVal   src   As   String)   As   String  
          Dim   i   As   Integer  
          Dim   s   As   String  
          For   i   =   1   To   Len(src)  
                  If   Mid(src,   i,   1)   <>   Chr(0)   Then  
                          s   =   s   &   Mid(src,   i,   1)  
                  Else  
                          Exit   For  
                  End   If  
          Next   i  
          remove0   =   s  
  End   Function  
 


    摘要: 有谁知道pb6.5中的o73 oracle 7.3能连上oracle817吗? 怎么提示说用户名密码不正确,很正确啊? 用pb7或pb8的oracle8以上的驱动 连接都很正常的! 迷惑?? ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE