Results 1 to 2 of 2

Thread: Problem calling another button function inside timer

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Problem calling another button function inside timer

    Hi all i am using the following timer to close a massage box whenever it pops up in external application. But i want to call another button command after closing that massage box. I placed the call inside the if statment but it never calls command button. could you guys tell me what might be wrong? Thanks


    2 Code:
    1. Private Sub Timer1_Timer()
    2. Dim X As Long, editx As Long
    3. Dim button As Long
    4.  
    5.  X = FindWindow("#32770", "Successful")
    6.    If X Then
    7.  SendMessage X, WM_CLOSE, 0&, 0&
    8. Command2_Click
    9.    End If
    10. End Sub
    11.  
    12. Private Sub Command2_Click()
    13. ......
    14. ......
    15. msgbox " i have been called ";
    16. .....
    17. .....
    18. End sub

  2. #2
    Discovering Life Siddharth Rout's Avatar
    Join Date
    Feb 2005
    Location
    Mumbai, India
    Posts
    12,001

    Re: Problem calling another button function inside timer

    I placed the call inside the if statment but it never calls command button. could you guys tell me what might be wrong?
    I tried it an it works just fine...

    1) Does it close the window?
    2) Try this

    vb Code:
    1. If X Then
    2.         MsgBox "Closing Window"
    3.         SendMessage X, WM_CLOSE, 0&, 0&
    4.         Command2_Click
    5.     End If

    Do you get to see the message box "Closing Window"??? If not you know where the error is
    A good exercise for the Heart is to bend down and help another up...
    Please Mark your Thread "Resolved", if the query is solved


    MyGear:
    ★ CPU ★ Ryzen 5 5800X
    ★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
    ★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
    ★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
    ★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
    ★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
    ★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
    ★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
    ★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
    ★ Keyboard ★ TVS Electronics Gold Keyboard
    ★ Mouse ★ Logitech G502 Hero

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width