?? windowdemo.dpr
字號:
////////////////////////////////////////////////////////////////////////////////
//
//
// FileName : WindowDemo.dpr
// Creator : Shen Min
// Date : 2002-3-2
// Comment : Create Window Demo for <<delphi after high hand>>
//
//
////////////////////////////////////////////////////////////////////////////////
program WindowDemo;
uses Windows, Messages;
function WindowProc(hwnd : HWND; uMsg : Cardinal; wParam : WPARAM; lParam : LPARAM) : LResult; stdcall;
begin
Result := 0;
case uMsg of
WM_CLOSE : PostMessage(hwnd, WM_QUIT, 0, 0);
WM_LBUTTONDOWN : MessageBox(hwnd, 'Hello!', '和您打個招呼', MB_ICONINFORMATION);
else
Result := DefWindowProc(hWnd, uMsg, wParam, lParam);
end;
end;
var
wndcls : WNDCLASS;
hWnd : THandle;
Msg : tagMSG;
begin
wndcls.style := CS_DBLCLKS;
wndcls.lpfnWndProc := @WindowProc;
wndcls.cbClsExtra := 0;
wndcls.cbWndExtra := 0;
wndcls.hInstance := hInstance;
wndcls.hIcon := 0;
wndcls.hCursor := LoadCursor(hInstance, 'IDC_ARROW');
wndcls.hbrBackground := COLOR_WINDOWFRAME;
wndcls.lpszMenuName := nil;
wndcls.lpszClassName := 'WindowClassDemo';
if RegisterClass(wndcls) = 0 then
Exit;
hWnd := CreateWindow(
'WindowClassDemo',
'WindowDemo',
WS_BORDER or WS_CAPTION or WS_SYSMENU,
Integer(CW_USEDEFAULT),
Integer(CW_USEDEFAULT),
Integer(CW_USEDEFAULT),
Integer(CW_USEDEFAULT),
0,
0,
hInstance,
nil
);
if hWnd = 0 then
Exit;
ShowWindow(hWnd, SW_SHOWNORMAL);
UpdateWindow(hWnd);
while GetMessage(Msg, hWnd, 0, 0) do
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -