掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
XE3への移植時の問題 (ID:43248)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
牡蠣ソースはHalbowさんが昔書かれたものですが、 XE2では22,528 バイト(22.0 KB)です。 コンパイラと言うよりVCLの肥大化が原因だと思われます。 VCLと決別するか、サイズを気にしないかのどちらかだと思います。 また不要な機能はどんどん削るのも手です。 と言いつつ私は全く気にしてませんが。 program Project1; uses windows; const WM_DESTROY = $0002; procedure MainDestroy(hWindow: HWND); begin UnregisterHotKey(hWindow, 1); PostQuitMessage(0); end; //------------------------------------------------------------ // Main Window Procedure //------------------------------------------------------------ function MainWndProc(hWindow: HWND; Msg: UINT; WParam: WPARAM; LParam: LPARAM): LRESULT; stdcall; export; begin Result := 0; case Msg of WM_DESTROY: MainDestroy(hWindow); else begin result := DefWindowProc( hWindow, Msg, wParam, lParam ); exit; end; end; end; //------------------------------------------------------------ // Main Procedure //------------------------------------------------------------ var wc: tagWNDCLASS; hWindow: HWND; Msg: TMsg; begin wc.lpszClassName := 'AppClass'; wc.lpfnWndProc := @MainWndProc; wc.style := CS_VREDRAW or CS_HREDRAW; wc.hInstance := hInstance; wc.hIcon := LoadIcon(0,IDI_APPLICATION); wc.hCursor := LoadCursor(0,IDC_ARROW); wc.hbrBackground := (COLOR_WINDOW+1); wc.lpszMenuName := nil; wc.cbClsExtra := 0; wc.cbWndExtra := 0; RegisterClass(wc); hWindow := CreateWindowEx(0,'AppClass','',WS_OVERLAPPEDWINDOW,0,0,200,200,0,0,hInstance,nil); RegisterHotKey(hWindow, 1, 0, VK_F1); ShowWindow(hWindow,CmdShow); UpDateWindow(hWindow); //---- Message Loop --------------------- while GetMessage(Msg, 0, 0, 0) do begin TranslateMessage(Msg); DispatchMessage(Msg); end; Halt(Msg.wParam); end.
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.