0

I want to show/hide tabtip.exe on demand. I was able to toggle it using code given to me here.

import win32gui
from ctypes import HRESULT
from ctypes.wintypes import HWND
from comtypes import IUnknown, GUID, COMMETHOD
import comtypes.client

class ITipInvocation(IUnknown):
    _iid_ = GUID("{37c994e7-432b-4834-a2f7-dce1f13b834b}")
    _methods_ = [
        COMMETHOD([], HRESULT, "Toggle",
                  ( ['in'], HWND, "hwndDesktop" )
                  )
        ]

dtwin = win32gui.GetDesktopWindow();
ctsdk = comtypes.client.CreateObject("{4ce576fa-83dc-4F88-951c-9d0782b4e376}", interface=ITipInvocation)
ctsdk.Toggle(dtwin);
comtypes.CoUninitialize()

But it toggle the keyboard, I want show and hide functions separate. I am trying to use this method but can't understand how can I implement it in python. Any guide would be appreciated.

Side Note: I am new to COM and win32Api. I have been reading a lot MSDN documentation and posts on it. But there are very few available regarding these topic. If you know any good tutorial on "Using COM interface in python", it would be grateful.

abdulsamad
  • 158
  • 1
  • 10
  • It has very little to do with Python. The commands would be the same if you issued them from another language. Every COM server is different and has its own API so the general tutorial you are looking for can't really exist. – BoarGules Apr 05 '21 at 07:33
  • What should I be looking for this case ? How can I use **ITextInputPanel** interface – abdulsamad Apr 05 '21 at 14:31

0 Answers0