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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ryosuke Uchiyama
January 27, 2021
Programming
430
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
75
PythonでSlack通知botを作る
step63r
0
24
ChatGPT実践
step63r
1
410
IoT実践! 行先予定表を電子ペーパーで作る
step63r
0
54
React x Socket.ioで人狼サーバを作る 第一章 フロントエンド実装
step63r
0
36
深層強化学習で東方AI 第一章 DQNの基本
step63r
0
430
Build 2021 プレイバック
step63r
0
45
WPFで実践アプリ開発! 第四章 機能の実装 Part 2
step63r
0
63
WPFで実践アプリ開発! 第三章 機能の実装 Part 1
step63r
0
140
Other Decks in Programming
See All in Programming
残高管理から台帳サービスへの進化
artoy
1
210
Railsバージョンを4倍にした話
optim
0
540
contenteditable と日本語入力に向き合う
colorful12
0
210
なぜCTOを降りてFDEを選んだのか?〜なぜプロダクト企業がFDEで顧客の現場に踏み込むのか〜
gonta
1
230
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
170
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
200
Jetpack Compose Mechanisms
skydoves
3
860
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
120
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
1.1k
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
900
Seven New Principles of Software Engineering
yegor256
0
230
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
How to train your dragon (web standard)
notwaldorf
96
6.9k
The Cult of Friendly URLs
andyhume
79
7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
280
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
540
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
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