generic.pas 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {****************************************************************************
  2. Copyright (c) 1999-2000 by Florian Kl„mpfl
  3. ****************************************************************************}
  4. { Generisches OS/2-Programm }
  5. program generic;
  6. uses
  7. os2def,pmwin,bsedos;
  8. function clientwndproc(window : HWND;msg : longint;mp1,mp2 : MParam) :
  9. MResult;export;
  10. var
  11. ps : HPS;
  12. rcl : RECTL;
  13. begin
  14. clientwndproc:=nil;
  15. case msg of
  16. WM_CREATE : ;
  17. WM_PAINT : ;
  18. WM_COMMAND : ;
  19. else clientwndproc:=WinDefWindowProc(window,msg,mp1,mp2);
  20. end;
  21. end;
  22. var
  23. frame,client : HWND;
  24. ab : HAB;
  25. mq : HMQ;
  26. msg : QMSG;
  27. const
  28. frameflags : longint = FCF_TITLEBAR+
  29. FCF_SYSMENU+
  30. FCF_SIZEBORDER+
  31. FCF_MINBUTTON+
  32. FCF_MAXBUTTON+
  33. FCF_SHELLPOSITION+
  34. FCF_TASKLIST+
  35. FCF_MENU;
  36. winclass = 'GENERIC';
  37. wintitle = '';
  38. begin
  39. ab:=WinInitialize(0);
  40. mq:=WinCreateMsgQueue(ab,0);
  41. WinRegisterClass(ab,winclass,@clientwndproc,4,0);
  42. frame:=WinCreateStdWindow(HWND(1),WS_VISIBLE,@frameflags,winclass,
  43. wintitle,WS_VISIBLE,0,1,@client);
  44. while (WinGetMsg(ab,@msg,0,0,0)<>0) do
  45. WinDispatchMsg(ab,@msg);
  46. WinDestroyWindow(frame);
  47. WinDestroyMsgQueue(mq);
  48. WinTerminate(ab);
  49. end.