SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Mar 2008
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    EmptyClipboard Using QTP

    Hi i want to clear my MSword clipboard through QTP. (Using API).

    I have searched in net and found the below code


    Private Declare Function apiOpenClipboard Lib "user32" Alias "OpenClipboard" _
    (ByVal hwnd As Long) As Long
    Private Declare Function apiEmptyClipboard Lib "user32" Alias "EmptyClipboard" _
    () As Long
    Private Declare Function apiCloseClipboard Lib "user32" Alias "CloseClipboard" _
    () As Long

    Public Sub sClearClipboard()
    ' Procedure to clear the contents of the Windows clipboard
    On Error GoTo E_Handle
    Dim lngReturn As Long
    lngReturn = apiOpenClipboard(Application.hWndAccessApp)
    lngReturn = apiEmptyClipboard
    lngReturn = apiCloseClipboard
    sExit:
    On Error Resume Next
    Exit Sub
    E_Handle:
    MsgBox Err.Description & vbCrLf & "sClearClipboard", vbOKOnly + vbCritical, "Error: " & Err.Number
    Resume sExit
    End Sub


    and i made the necessary changes.(Thanks to Tarun's API converter!)


    i just want to know what value we have to pass in the below parameter 'Application.hWndAccessApp',

    apiOpenClipboard(Application.hWndAccessApp)

    I have tried to pass the 'MsWord' 's hwnd value , then clipboard's hwnd value.. but it doesnt work.

    Can anyone tell what value we have to pass for that parameter?

    Also if we have anyother method to clear the clipboard please tell me.

  2. #2
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: EmptyClipboard Using QTP

    CreateObject("Mercury.Clipboard").Clear

  3. #3
    Senior Member
    Join Date
    Mar 2008
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: EmptyClipboard Using QTP

    So tarun if we clear the mercury's clipboard , it will clear the window's clipboard also ?

  4. #4
    Moderator
    Join Date
    Jul 2005
    Location
    Delhi
    Posts
    15,575
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    7 Thread(s)
    Total Downloaded
    0

    Re: EmptyClipboard Using QTP

    Clipboard is common to the system.

  5. #5
    Senior Member
    Join Date
    Mar 2008
    Posts
    126
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: EmptyClipboard Using QTP

    Thank You tarun ! Its working fine!

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 12.50%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:53 PM.

Copyright BetaSoft Inc.