LoginSignup
6
4

More than 3 years have passed since last update.

僕のwin32gui(Python)

Last updated at Posted at 2019-12-13

自分用のまとめ
随時更新

自分がわかればいいからところどころ用語が間違ってるかも

!見方

#コマンド
    #引数のオプションの説明

win32guiって何に使うの?

ウィンドウ取得の時によく使うかなぁ


モジュール読み込み

import win32gui

頻出操作

#ウィンドウタイトルでウィンドウハンドルを取得
win32gui.FindWindow()
    #第一引数はクラス名、なければNone
    #第二引数はタイトル名

#最前面のウィンドウのウィンドウハンドルを取得
win32gui.GetForegroundWindow()

#ウィンドウの位置を取得
rect = win32gui.GetWindowRect()
    #引数ウィンドウハンドル
  #返り値は
  #rect[0]画面左上x座標
  #rect[1]画面左上y座標
  #rect[2]画面右下x座標
  #rect[3]画面右下y座標
6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4