2023-01-01から1年間の記事一覧

【音楽】好きなコード進行をまとめた

明るいコード進行 1.I(C)-III(D#)-V(F)-I(C) 使用されている例 Fairune無印の草原・メトロイドのRock Stage

【FindWindow関数】WPF外のウィンドウハンドルを取得する方法

WPF

private IntPtr hWnd; string windowTitle = "ウィンドウタイトル"; hWnd = FindWindow(null, windowTitle); 以下は、FindWindow 関数の主な引数と説明です:lpClassName (string):検索するウィンドウのクラス名を指定します。ウィンドウのクラス名は、ウィ…

WPF外のウィンドウを常に最前面にする方法

WPF

SetWindowPos(hWnd, new IntPtr(-1), 0, 0, window.width, window.height, 0); 第二引数に new IntPtr(-1) を指定することで常に最前面設定になる

【WPF】特定のウィンドウプロセスの座標を取得する

WPF

まず、クラス内に定義している変数や構造体、WindousAPIからusingして使っている関数達の定義を載せておきます。 //ウィンドウ名からウィンドウハンドルを取得(WindowsAPIの関数) [DllImport("user32.dll")] public static extern IntPtr FindWindow(string …

【WPF】Bitmap、Graphics間の転送の書き方、ややこしい

WPF

//widthHeight=ウィンドウの縦横の長さ Bitmap screenshot = new Bitmap(width, height); using (Graphics graphics = Graphics.FromImage(screenshot)) { graphics.CopyFromScreen(windowRect.Left, windowRect.Top, 0, 0, new System.Drawing.Size(width, …