Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WPFで実践アプリ開発! 第一章 Windowsアプリの歴史
Search
Ryosuke Uchiyama
January 27, 2021
Programming
420
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WPFで実践アプリ開発! 第一章 Windowsアプリの歴史
Ryosuke Uchiyama
January 27, 2021
More Decks by Ryosuke Uchiyama
See All by Ryosuke Uchiyama
AWSでサーバレスな書籍管理アプリを作る
step63r
0
68
PythonでSlack通知botを作る
step63r
0
23
ChatGPT実践
step63r
1
400
IoT実践! 行先予定表を電子ペーパーで作る
step63r
0
49
React x Socket.ioで人狼サーバを作る 第一章 フロントエンド実装
step63r
0
33
深層強化学習で東方AI 第一章 DQNの基本
step63r
0
390
Build 2021 プレイバック
step63r
0
44
WPFで実践アプリ開発! 第四章 機能の実装 Part 2
step63r
0
62
WPFで実践アプリ開発! 第三章 機能の実装 Part 1
step63r
0
140
Other Decks in Programming
See All in Programming
Go × SIMDで高速化するベクトル検索 ~ルーフラインモデルでSIMDが効く境界を探れ! ~
po3rin
1
4.5k
カツオ、ご期待ください
suneo3476
0
110
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
290
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
150
Turning Architecture into Unit Tests in the AI Era (NSSpain XIV)
steliosf
PRO
1
110
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
550
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
140
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
19k
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
240
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
180
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
330
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
980
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
530
Tell your own story through comics
letsgokoyo
1
1.1k
A better future with KSS
kneath
240
18k
The browser strikes back
jonoalderson
0
1.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
540
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
270
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
700
Transcript
WPFで実践アプリ開発! 第一章 Windowsアプリの歴史 Ryosuke Uchiyama step63r
"PC操作を監視するツール" をかいくぐるツール
こういうアプリを 簡単に作りたくない……?
Windowsプログラミング
Windowsプログラミングの変遷 • Win32 API • C/C++向けのWindows GUI開発ライブラリ • 大規模なアプリケーション開発は大変で、難易度も高い •
Microsoft Foundation Class(MFC) • C++向けのWin32 APIラッパークラス群 • 依然として仕様が難解で、あんまり知名度が上がらなかった(らしい) • Microsoft .NET Framework • WindowsアプリやWebアプリの開発・実行環境 • 共通言語基盤(Common Language Interface: CLI)の、MS自身の実装(Common Language Runtime: CLR)を保証 • WinForms, WPF, UWP(WinRT)など多くのUIライブラリ、プログラミングモデルを確立 • .NET Core • クロスプラットフォームマネージソフトウェアフレームワーク(長い) C++ C++ VB C# VB C# 時代はネイティブからマネージへ
Win32 APIは もういらないの?
Windowsアプリの歴史はWin APIと共に――
これからどうなる?Windowsプログラミング
これからどうなる?Windowsプログラミング
今からWindowsプログラミングするなら? 37591 12157 91365 160208 20053 44835 0 20000 40000
60000 80000 100000 120000 140000 160000 180000 winapi mfc winforms wpf uwp xamarin Stack Overflowのタグ別QA数 (2021年1月24日時点)
Win32 API
アプリケーション エントリポイント • すべてのアプリケーションにはスタート地点(エントリポイント)がある • C/C++でいう main 関数 • Windowsアプリにおけるエントリポイントは
WinMain 関数 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow); hInstance インスタンスハンドル hPrevInstance 他のインスタンスハンドル lpCmdLine コマンドライン引数 nCmdShow ウィンドウの初期表示方法
ウィンドウ プロシージャ • Windowsアプリは、ユーザやプログラムが発生させたイベントを契機として処理を行うイベント 駆動型プログラムである • イベントを処理する専用の関数をイベントハンドラと呼ぶ • Windowsアプリにおけるイベントハンドラをウィンドウプロシージャという •
ウィンドウプロシージャはウィンドウクラスを生成する時にコールバックとして設定する LRESULT CALLBACK WndProc(HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam); hWnd ウィンドウハンドル uMessage ウィンドウメッセージ wParam パラメータその1 lParam パラメータその2
メッセージ ループ • Windowsアプリはそのメインスレッド内でメッセージの受け取り待ちを無限に行うことになる • while句でメッセージを受け取る処理をメッセージループという • メッセージループにはウィンドウを維持する役割とメッセージをディスパッチする役割がある while (::GetMessage(&msg,
NULL, 0, 0) != 0) { ::TranslateMessage(&msg); ::DispatchMessage(&msg); }
Demo Win32 APIでウィンドウを表示させてみる
ソースコード step63r/CreateWindowSample https://github.com/step63r/CreateWindowSample
Demo Spy++でウィンドウメッセージを監視する
Spy++のインストール方法
Spy++の起動方法 ※表示されないときは「外部ツール」から設定するか %ProgramFiles(x86)%¥Microsoft Visual Studio¥2019¥Professional¥Common7¥Tools¥spyxx.exe を直接起動する
MFC (Microsoft Foundation Class)
Document/Viewアーキテクチャ • MFCが既定で採用している、データと見た目を分離する設計モデル • Documentオブジェクトが永続データを管理、Viewオブジェクトがデータの表示方法を管理 • スプレッドシートとグラフビューなど、同じデータに複数の見た目が紐付く場合に適している
None
None
None
Demo MFCではじめてのアプリを作ろう!
None
None
None
None
Windows Forms
デスクトップアプリのUIフレームワーク フォームデザイナー コードビハインド ←Buttonのプロパティ
WPF (Windows Presentation Foundation)
データバインドに特化したUIフレームワーク XAMLデザイナー コードビハインド
Demo WPFではじめてのアプリを作ろう!
None
None
None
Appendix
参考文献 • API Index - Win32 apps | Microsoft Docs
• [Microsoft] Windowsデスクトップ向け業務アプリ開発には何を採用すべきか? - 2018年9月版 – Qiita • 「.NET Core 3.0」の後継は「.NET 5」 ~2020年11月にリリースへ - 窓の杜 • What's new in .NET 5 | Microsoft Docs • ウィンドウプロシージャ - Windows API 入門 • MFCから.NETへの実践的移行計画(2/5) - @IT • 階層図 | Microsoft Docs • MVCの流れを簡単にまとめてみる - Qiita