Technically Impossible

Lets look at the weak link in your statement. Anything "Technically Impossible" basically means we haven't figured out how yet.

C#でのスクリーンショット - 画面全体、特定領域、そして最前面Windowのキャプチャ

Zoom Meetingsをはじめとするビデオ・コミュニケーションが、日常利用において何も例外的な存在ではない時代となった。それはオンライン・ミーティングに限らず、大人数が出席する、いわゆるカンファレンスでも用いられている。

このような時、あると便利なのが画面キャプチャ、スクリーンショットのためのツールだ。特にプレゼンテーション資料が配布されない場合、今まさに移っている画面をメモ代わりにキャプチャする。

Windows標準の操作では、スクリーンショットを取り、画像編集ソフトにコピーし、画像ファイルとして保存する、という手順を経る必要がある。これをボタン一つで、ファイル出力まで完結させたいと思い、とあるフリーウェアを使っていた。そして、これが気づかないうちに無反応になるときがあるのだ。
この現象があまりに頻発するので、ツールを自作することにした。そして作業をしているうちに気付くのだ。スクリーンキャプチャ・ツールは、イベントドリブンなライブラリ呼び出しで完結できるものではなく、Win32 API呼び出しが避けられないことに。それは次の場面で必要とされる。

  1. Active Window(最前面のWindow)を検出する。
  2. 特定キー押下のタイミングを検出する。

この投稿では、1の話題を含めたスクリーンショットを取得するためのコードを紹介する。
なお、ソースコード全体は投稿末尾に掲載している。

続きを読む

全包囲、全対応の多機能コントローラ、しかし色々と難あり - COWBOX S900

6月強化版についての更新

COWBOX S900の「6月強化版」がリリースされた。”強化版”と言うのだが、実際のところは、バグ修正版と呼ぶのが相応しいだろう。

6月強化版についての情報を反映した「全包囲、全対応の多機能コントローラ、しかし色々と難あり - COWBOX S900(6月強化版)」を投稿した。新しい投稿を参照してほしい。

impsbl.hatenablog.jp

本文

先日の投稿でXinput、DirectInputについて触れた*1。このように操作系APIだけでなく、接続形態からキー配置まで、何かと排他関係にある要素がPC用ゲーム・コントローラには存在している。

API Xinput or DirectInput
接続 USB or Bluetooth
キー配置 Xbox系:左右アナログスティック位置がズレている
Playstation系:左右アナログスティック位置が揃っている

これらすべての違いを包含し、1台で全対応できる。なおかつTURBO(連射)、アナログ感度調整、マクロ機能まで搭載している、いわゆる「全部入り」のコントローラが存在する。COWBOX S900だ。

スペックと機能だけを見ると魅力的ではあるのだが、コントローラの本質的なところで問題を感じるコントローラでもある。

今回の投稿では、このコントローラを紹介する。

  • 6月強化版についての更新
  • 本文
  • キー配置の切り替え
  • USB接続
  • Bluetooth接続
  • 操作系の違い
  • TURBO(連射)機能
  • 各種スイッチとスティック(トリガー)感度調整
続きを読む

What's the same and what's different? - Windows Forms App (.NET Framework), Windows Forms App (.NET) and WPF Application

f:id:espio999:20211207230232p:plain
In Visual Studio, there are 3 options as the screenshot at the top of this post. They are

Windows Forms App (.NET Framework) an application with a Windows Forms (WinForms) user interface
Windows Forms App (.NET) an application with a Windows Forms (WinForms) user interface
WPF Application .NET WPF Application

I wonder that a translator in Microsoft is really confident that users can understand and recognize difference of them, especially between 2 Windows Forms Apps.
An user select framework they use at the later step and they will be able to realize 2 options intends at that stage. But I think a translator should indicate information leading more clear understanding and recognition at the 1st stage.

I imagine that most users select "Windows Forms App (.NET Framework)" and only small part of users in advance of others try "WPF Application".

This post introduces how they are difference.

続きを読む