User Profile

Collapse

Profile Sidebar

Collapse
MegaOctet
MegaOctet
Last Activity: Dec 25 '09, 09:39 PM
Joined: Oct 28 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • MegaOctet
    started a topic Send a text

    Send a text

    Hello,

    I'm trying to send some text in wordpad and here is my script:
    Code:
    import win32gui
    import win32api
    import win32con
    import time
    Notepad= win32gui.FindWindow(None,"Sans titre - Bloc-notes")
    win32gui.SetForegroundWindow(Notepad)
    editbox = win32gui.FindWindowEx(win32gui.GetDesktopWindow(),None,"Notepad",None)
    time.sleep(3)
    win32api.PostMessage(editbox,win32con.WM_KEYDOWN,ord("x"),0)
    ...
    See more | Go to post

  • MegaOctet
    replied to Need help with FindWindow()
    Thanks a lot for your answer. It works.
    See more | Go to post

    Leave a comment:


  • MegaOctet
    started a topic Need help with FindWindow()

    Need help with FindWindow()

    Hello,

    Here is my script

    Code:
    import win32gui as w
    HWND= w.FindWindow("Document - WordPad",None)
    and here is the traceback:
    Traceback (most recent call last):
    File "C:\Python26\es sai1.py", line 30, in <module>
    HWND2= w.FindWindow("D ocument - WordPad",None)
    error: (2, 'FindWindow', 'Le fichier sp\xe9cifi\xe9 est introuvable.')
    ...
    See more | Go to post
No activity results to display
Show More
Working...