T
t365
Unregistered / Unconfirmed
GUEST, unregistred user!
uses
Windows,Messages;
var hinstanceword;
CommandLinechar;
ClassName,AppNamechar;
procedure WndProc(hwndWord;uMsg:Word;wParam:word;lParam:word);
begin
IF uMsg=WM_DESTROY then
PostQuitMessage(0)
else
DefWindowProc(hWnd,uMsg,wParam,lParam);
end;
function winMain(hInst,hPrevInstance:LongWord;
lpCmdLine:LPSTR;nCmdShow:integer)Word;
var wc:WNDCLASSEX;
hWndword;
msg:TMsg;
begin
ClassName := 'test';
AppName :='hehe';
wc.cbSize := SIZEOF(WNDCLASSEX);
wc.style := CS_HREDRAW or CS_VREDRAW;
wc.lpfnWndProc := @wndproc;
wc.cbClsExtra :=0;
wc.cbWndExtra :=0;
wc.hInstance := Hinstance;
wc.hbrBackground :=COLOR_WINDOW+1;
wc.lpszMenuName:=nil;
wc.lpszClassName:= ClassName;
wc.hIcon := LoadIcon(0,IDI_APPLICATION);
wc.hIconSm:= LoadIcon(0,IDI_APPLICATION);
wc.hCursor := LoadCursor(0,IDC_ARROW);
RegisterClassEx(wc);
hWnd := CreateWindowEx(0,ClassName,AppName,
WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,
hInst,nil);
ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd);
while TRUE do
IF not GetMessage(msg,0,0,0) then
begin
TranslateMessage(msg);
DispatchMessage(msg);
end;
Result:=0;
end;
begin
hInstance:=GetModuleHandle(Nil);
CommandLine := GetCommandLine;
WinMain(hInstance,0,CommandLine, SW_SHOWDEFAULT);
end.
学习中,在消息处理上好象有好题,但不得要领,请朋友们帮忙看看!
Windows,Messages;
var hinstanceword;
CommandLinechar;
ClassName,AppNamechar;
procedure WndProc(hwndWord;uMsg:Word;wParam:word;lParam:word);
begin
IF uMsg=WM_DESTROY then
PostQuitMessage(0)
else
DefWindowProc(hWnd,uMsg,wParam,lParam);
end;
function winMain(hInst,hPrevInstance:LongWord;
lpCmdLine:LPSTR;nCmdShow:integer)Word;
var wc:WNDCLASSEX;
hWndword;
msg:TMsg;
begin
ClassName := 'test';
AppName :='hehe';
wc.cbSize := SIZEOF(WNDCLASSEX);
wc.style := CS_HREDRAW or CS_VREDRAW;
wc.lpfnWndProc := @wndproc;
wc.cbClsExtra :=0;
wc.cbWndExtra :=0;
wc.hInstance := Hinstance;
wc.hbrBackground :=COLOR_WINDOW+1;
wc.lpszMenuName:=nil;
wc.lpszClassName:= ClassName;
wc.hIcon := LoadIcon(0,IDI_APPLICATION);
wc.hIconSm:= LoadIcon(0,IDI_APPLICATION);
wc.hCursor := LoadCursor(0,IDC_ARROW);
RegisterClassEx(wc);
hWnd := CreateWindowEx(0,ClassName,AppName,
WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,
hInst,nil);
ShowWindow(hwnd,SW_SHOWNORMAL);
UpdateWindow(hwnd);
while TRUE do
IF not GetMessage(msg,0,0,0) then
begin
TranslateMessage(msg);
DispatchMessage(msg);
end;
Result:=0;
end;
begin
hInstance:=GetModuleHandle(Nil);
CommandLine := GetCommandLine;
WinMain(hInstance,0,CommandLine, SW_SHOWDEFAULT);
end.
学习中,在消息处理上好象有好题,但不得要领,请朋友们帮忙看看!