Ch 19 §ó¦h³]³Æ¤º®eªºª¾ÃÑ(2)

¤p¤ì°¸¦b³o¤@³¹ùØ¡A§Q¥Î Windows ´£¨Ñªº GDI ªA°È°Æµ{¦¡¡A²Ê²L¦a¤¶²Ð°Êµeªº§Þ¥©¡A¨Ã¥B¥Ü½d¤@­Óµ{¦¡¡ABALL.ASM¡A³o­Óµ{¦¡µøµ¡ùئ³¤@Áû²y¤£°±¦a°µµ¥³t«×¹B°Ê¡Aª½¨ì¸IIJ¨ìµøµ¡Ãä®Ø®É¡A·|¥H¼u©Ê¸I¼²ªº¤è¦¡¤Ï¼u¡C¦¹¥~¡A³o­Óµøµ¡¨S¦³¿ï³æ¡B©ñ¤j²°¡BÁY¤p²°¡A°£«D­«·s²ÕĶ¡A¨Ï¥ÎªÌ¤]µLªk§ïÅܵøµ¡¤j¤p¡A¨ä°õ¦æµe­±¦p¤U¡G

ball.exe °õ¦æµe­±

¤p¤ì°¸§â ball.asm ¥H¤Î©Ò»Ý¦ì¤¸¹Ï¡B¸ê·½´y­zÀɳ£À£ÁY¦¨¤@­ÓÀɮסAball.rar¡AÁ¿¥¦¸Ñ¶}¦Ü¦P¤@¤l¥Ø¿ý¡AµM«á¶}±Ò¡y©R¥O´£¥Ü¦r¤¸¡z¡A¤Á´«¨ì¸ÑÀ£ÁYªº¤l¥Ø¿ý¡A¿é¤J¤U­±«ü¥O´N¥i¥H±o¨ì ball.exe ¥i°õ¦æÀÉ¡C

E:\HomePage\SOURCE>cd ball [Enter]

E:\HomePage\SOURCE\BALL>rc ball.rc [Enter]

E:\HomePage\SOURCE\BALL>ml ball.asm /link ball.res [Enter]
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997.  All rights reserved.

 Assembling: ball.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/SUBSYSTEM:WINDOWS
"ball.obj"
"/OUT:ball.exe"
"ball.res"

E:\HomePage\SOURCE\BALL>

­ì²z

¸Ñ¨M°{Ã{ªº°ÝÃD

¦b«e¤@³¹ùØ¡A¤p¤ì°¸¤]®i¥Ü¤F°Êµe¡A®É°w¡B¤À°w¡B¬í°wªº¨«°Ê¡A·íµM¤]¬O°Êµe¡C¤£¹L¦b¨º­Ó¨Ò¤lùØ¡A©Ò²¾°Êªºª«Åé«Ü¤p¡A©Ò¥H¤p¤ì°¸¬OÅý CLOCK µøµ¡¨C¦¸¦¬¨ì WM_PAINT °T®§®É¡A§â­I´º¹Ï¿ï¤J¨ì³o­Ó°O¾ÐÅé³]³Æ¤º®e¡A¦A§Q¥Î BitBlt API §â³o­Ó°O¾ÐÅé³]³Æ¤º®eªº­I´º¹Ï«þ¨©¨ì¤u§@°Ï¤W­±¡A³Ì«á¦Aµe¤W®É°w¡B¤À°w¡B¬í°w¡C¦]¬°¦b¤u§@°Ïªº³]³Æ¤º®e¤W°µ¤F¦n´X­Ó°Ê§@¡G§â°O¾ÐÅé³]³Æ¤º®eªº­I´º¹Ï«þ¨©¨ì¤u§@°Ï¡B¦b¤u§@°Ïµe¥X®É°w¡B¤À°w¡B¬í°wµ¥¥|­Ó°Ê§@¡A©Ò¥H¦bºC³tªº¹q¸£¤W¡A©Î³\·|¬Ý¨ì°{Ã{ªº²{¶H¡A¦ý¦]²¾°Êª«Åé¤p©Î¤u§@°Ï¤p¡A³oºØ²{¶H¨Ã¤£©úÅã¡C°²¦p­n³]­p¹q°Êª±¨ã¡A´N·|»Ý­n¤jªº¤u§@°Ï¡A¤]»Ý­n²¾°Ê¤jªºª«Åé¡A¨º»ò¥H³oºØ¤è¦¡©Ò°µ¥X¨Óªºµ{¦¡¡A°{Ã{ªº°ÝÃD´N·|«ÜÄY­«¤F¡C

­n¸Ñ¨M³o­Ó°ÝÃD¡A¥i¥H¥Î CreateCompatibleDC ¥ý·Ç³Æ¦n¤@­Ó½w½Äªº³]³Æ¤º®e¡A³o­Ó½w½Ä°Ï³]³Æ¤º®e¬O«Ø¥ß¦b°O¾ÐÅéùØ¡A¨Ã¤£ª½±µ¿é¥X©ó¿Ã¹õ¤Wªº¤u§@°Ï¡C§Ú­Ì§â©Ò¦³ªº­I´º¡B°Êµe¾Þ§@³£¥ý¦b³o­Ó½w½Ä°Ïªº³]³Æ¤º®eùئw±Æ¦n¡AµM«á§â½w½Ä°Ïªº³]³Æ¤º®eùتº¹Ï®×¤@¦¸«þ¨©¨ì¤u§@°Ïªº³]³Æ¤º®e¤W¡A¤§«á´N¤£¦A¹ï¤u§@°Ïªº³]³Æ¤º®e¶i¦æø»s¹Ï¤ù¡C³o¼Ë¦b¨Ï¥ÎªÌªº²´¤¤¬Ý¨Ó¡A¤u§@°Ï¥u¦³¤@¦¸ªºÅܤơA´N¤£·|¦³°{Ã{ªº±¡ªp¤F¡C

PatBlt API µe¥X­I´º¹Ï

BALL ªº­I´º¬O¥Î¤@­Ó¸û¤pªº¦ì¤¸¹Ï¡A¥HÃþ¦ü²¡¿j¤è¦¡«÷´ê¦Ó¦¨¤@­Ó¸û¤jªº­I´º¹Ï®×¡A³oºØ¸û¤pªº¦ì¤¸¹Ï¤]¥i¥HºÙ¬°¹Ï¼Ë ( pattern )¡C¨Æ¹ê¤W³\¦hºô­¶ªº­I´º¹Ï¡A¬Æ¦Ü¦³®É­Ô Windows ªº®à­±¦³®É¤]¬O¥H³oºØ¤è¦¡«÷´êªº¡A³oºØ¤è¦¡ªº¦n³B¬O©Ò»Ý­I´º¹Ï¤£»Ý­n«Ü¤j¡A´N¥i¥HÅý¥¦¶ñ¥R¾ã­Óµe­±¡C·íµM°Õ¡I³oºØ­I´º¹Ï¬O·|¤@ª½­«½Æªº¡A¤ñ¸û³æ½Õ¬O¨ä¯ÊÂI¡CBALL µ{¦¡¬O§Q¥Î¤U¹Ï¥ªÃ䪺 pattern.bmp ·í°µ¹Ï¼Ë¡A«÷´ê¦¨­I´º¹Ï¡Cpattern.bmp ¬Oªø¼e¦U 300 ¹Ï¯À ( pixel ) ªº¦ì¤¸¹Ï¡A¦Ó BALL ¤u§@°Ï¬Oªø 300 ¹Ï¯À¡B¼e 600 ¹Ï¯À¡A©Ò¥H­«½Æ¤@¦¸¡A½Ð°Ñ¦Ò¤U¹Ï¤Î¤W¹Ï¡G

©Ò»Ý BMP ¹Ï

­n¨Ï¹Ï¼Ë«÷´~¦¨¾ã­Ó­I´º¹Ï¡A¥i¥H¨Ï¥Î PatBlt API¡A·N¸q¬°¡yPattern Block Transfer¡z¡A¨ä­ì«¬¬O¡G

BOOL PatBlt(
    HDC hdc,    // handle to device context 
    int nXLeft, // x-coord. of upper-left corner of rect. to be filled 
    int nYLeft, // y-coord. of upper-left corner of rect. to be filled 
    int nWidth, // width of rectangle to be filled 
    int nHeight,// height of rectangle to be filled 
    DWORD dwRop // raster operation code 
   );

PatBlt ·|§â hdc ¥Ø«eªºµ§¨ê§@¬°¹Ï¼Ë¡A±q®y¼Ð ( nXLeft¡AnYLeft ) ¶}©l¶ñ¥R¡A¶ñ¥R°Ï°ìªº¼e«×»P°ª«×¤À§O¬O nWidth¡BnHeight¡C¶ñ¥R¤è¦¡¥i¥H¥Ñ dwRop «ü©w¡AdwRop ¥u¥i¥H¬O¤U­±¤­ºØ±¡§Î¡G

dwRop·N¡@¡@¸q
PATCOPY¶ñ¥Rµ§¨ê
PATINVERTµ§¨ê XOR ¥Ø¦a
DSTINVERTNOT ¥Øªº
BLACKNESS¥þ³¡¶ñ¥R¶Â¦â
WHITENESS¥þ³¡¶ñ¥R¥Õ¦â

¥Ñ¦¹¥iª¾¡A°²¦p­n¥Î¦ì¤¸¹Ï¬°¹Ï¼Ë¡A¶ñ¥R­I´º¡A¥i¥H¥Î LoadBitmap ¥Ñ¸ê·½¸ü¤J¦ì¤¸¹Ï¡AµM«á¥Î CreatePatternBrush §â³o­Ó¦ì¤¸¹ÏÅܦ¨µ§¨ê¡A³Ì«áÁÙ­n¥H SelectObject §â³o­Óµ§¨ê¿ï¤J¨ì³]³Æ¤º®e¤~¥i¥H¹F¨ì¥Øªº¡C¦¹³BÁÙ¶·ª`·N¤@­ÓÆ[©À¡A¨C·í§Ú­Ì¥Î GDI ªA°Èµ{¦¡Ã¸¹Ï ( ¦pµe½u¡Bµe¯x§Îµ¥ ) ©Î¨ä¥L¾Þ§@ ( ¦p¿ï¾Ü GDI ª«¥ó®É )¡A¨ä¹ï¶H³£¬O³]³Æ¤º®e¦Ó«D¦ì¤¸¹Ï¡C©Ò¥H­n§â GDI ªA°Èµ{¦¡§@¥Î©ó¦ì¤¸¹Ï®É¡A¥²¶·¥ý¥Î CreateCompatibleDC «Ø¥ß¤@­Ó¬Û®eªº³]³Æ¤º®e¡A¦A§â¦ì¤¸¹Ï¿ï¤J³o­Ó¬Û®eªº³]³Æ¤º®e¡A¤§«áªº GDI ªA°Èµ{¦¡¤~·|§@¥Î¦b¦ì¤¸¹Ï¤W¡C¤@¯ë¦Ó¨¥¡A­n¾Þ§@¤@­Ó¦ì¤¸¹Ï¡A´N±o«Ø¥ß¤@­Ó³]³Æ¤º®e¡C¦ì¤¸¹Ï¤j¦h¦s©ñ©ó¸ê·½ùØ¡A»Ý­n®É¥Ñ¸ê·½¸ü¤J§Y¥i¡A³o®Éªº¦ì¤¸¹Ï¬O¤w¸gªì©l¤Æ¤Fªº¡F¦ý¬O¤]¦³¥¼ªì©l¤Æªº¦ì¤¸¹Ï¡A¨Ò¦p­n§â¹Ï¼Ë¶ñ¥R¨ì½w½Äªº³]³Æ¤º®e·í°µ­I´º¹Ï®É¡A³o­Ó­I´º¹Ï´N¬O¥¼ªì©l¤Æªº¡A¦]¬°­I´º¹Ï³£©|¥¼¶ñ¥R§¹¦¨¡A·íµMÁÙ¨Sªì©l¤Æ¡A§Ú­Ì¤]´NµLªk¥Î SelectObject ¿ï¤J¬Y¤@­Ó¦ì¤¸¹Ï¡C³o®É­Ô¥i¥H¥Î CreateCompatibleBitmap «Ø¥ß¥¼ªì©l¤Æªº¦ì¤¸¹Ï¡AµM«á¦A¥Î SelectObject ¿ï¤J¨ì½w½Äªº³]³Æ¤º®e¡A³Ì«á¦A¥H PatBlt µe¥X­I´º¹Ï¡A¤~ºâ¬O§¹¦¨ªì©l¤Æ¡A³o®É´N¥i¥HÅã¥X­I´º¹Ï®×¤F¡C

CreateCompatibleBitmap API

CreateCompatibleBitmap ªº­ì«¬¬O

HBITMAP CreateCompatibleBitmap(
    HDC hdc,    // handle to device context 
    int nWidth, // width of bitmap, in pixels  
    int nHeight // height of bitmap, in pixels  
   );

CreateCompatibleBitmap «Ø¥ß»P hdc ¬Û®eªº¦ì¤¸¹Ï¡A©Ò¿×¬Û®eªº¦ì¤¸¹Ï·N«ä¬O«ü³o­Ó¦ì¤¸¹ÏÃC¦â¦h¹è»P hdc ¤@¼Ë¡A¨Ã¤£¬O§â¦ì¤¸¹Ï¿ï¤J¨ì hdc ùØ¡CnWidth¡BnHeight ¬O¦ì¤¸¹Ïªº¼e«×»P°ª«×¡A¥H¹Ï¯À¬°³æ¦ì¡C¦pªG¦¨¥\«Ø¥ß¦ì¤¸¹Ï¡A«h¶Ç¦^¦ì¤¸¹Ï¥N½X¡F§_«h¶Ç¦^ NULL¡C

CreatePatternBrush API

CreatePatternBrush ¬O§â¯S©wªº¦ì¤¸¹Ï»s¦¨µ§¨ê¡A¨ä»yªk¬O

HBRUSH CreatePatternBrush(
    HBITMAP hbmp    // handle to bitmap 
   );

hbmp ¬O·Q­n»s§@¦¨µ§¨êªº¦ì¤¸¹Ï¥N½X¡C¦pªG¦¨¥\¡ACreatePatternBrush ·|¶Ç¦^µ§¨ê¥N½X¡F§_«h¶Ç¦^ NULL¡C

Á¿¤F³o»ò¦h¡A²{¦b§Ú­Ì¥i¥H¦Û¸ê·½ùبú¥X¦ì¤¸¹Ï§@¬°¹Ï¼Ë¡AµM«á§â¥¦¶ñ¥R¦b½w½Ä³]³Æ¤º®eùØ¡A³Ì«á¦A¶Ç¨ì¤u§@°Ïªº³]³Æ¤º®eùØ¡A¨ä¹Lµ{¤j¬ù¬O¹³©³¤U³o¼Ë¡G

        INVOKE  LoadBitmap,hInstance,OFFSET szBkGround      ;¸ü¤J pattern.bmp ¦ì¤¸¹Ï
        mov     hBmpBk,eax                                  ;°O¿ý¦ì¤¸¹Ï¥N½X©ó hBmpBk ÅܼÆùØ
        INVOKE  CreatePatternBrush,hBmpBk                   ;§â pattern.bmp »s§@¦¨µ§¨ê
        mov     hBrushBk,eax                                ;§â³o­Óµ§¨ê¥N½X°O¿ý¦b hBrushBk ÅܼÆùØ
        ... ... ... ...                                     ;¨ä¥Lµ{¦¡¤ù¬q
        INVOKE  GetDC,hWnd                                  ;¨ú±oµøµ¡¤u§@°Ïªº³]³Æ¤º®e
        mov     hdc,eax                                     ;°O¿ý©ó hdc ÅܼÆùØ
        INVOKE  CreateCompatibleDC,hdc                      ;«Ø¥ß½w½Ä°Ïªº°O¾ÐÅé³]³Æ¤º®e
        mov     hdcbuffer,eax                               ;½w½Ä°Ïªº°O¾ÐÅé³]³Æ¤º®e¥N½X¦s©ó hdcbuffer ÅܼÆùØ
        INVOKE  CreateCompatibleBitmap,hdc,xClient,yClient  ;¥H hdc ¬°¥»¡A«Ø¥ß¥¼ªì©l¤Æªº¦ì¤¸¹Ï
        INVOKE  SelectObject,hdcbuffer,eax                  ;§â¦ì¤¸¹Ï¿ï¤J½w½Ä°Ïªº°O¾ÐÅé³]³Æ¤º®e
        INVOKE  SelectObject,hdcbuffer,hBrushBk             ;¿ï¤Jµ§¨ê
        INVOKE  PatBlt,hdcbuffer,0,0,xClient,yClient,PATCOPY;¶ñ¥Rµ§¨ê

¨ì¦¹¡A­I´º¹Ï´N¤w¸g¥þ³¡§¹¦¨¤F¡C

°Êµe­ì²z

·í²y²¾°Ê®É¡Aµ{¦¡¥²¶·¥ý§âªº²yÅé¹Ï®×À¿±¼Åܦ¨­I´º¡A¦A§â²yÅé¹Ï®×µe¦b·sªº¦ì¸m¤W¡A¨C¹j¤@¦¸·¥µuªº®É¶¡³£­«½Æ³o­Ó¹Lµ{°µ¡A¨º»ò¦b¨Ï¥ÎªÌ¬Ý¨Ó¡A´N¦n¹³²yÅé·|²¾°Ê¤@¼Ë¡C¤p¤ì°¸¦b³B²z WM_CREATE °T®§®É¡A«Ø¥ß¤F¤@­Ó­p®É¾¹¡G

                INVOKE  SetTimer,hWnd,TimerID,time,NULL

³o­Ó­p®É¾¹¨C¹j time ²@¬íµo¥X¤@­Ó WM_TIMER °T®§¡A¤p¤ì°¸¦b¦¹°T®§¤¤­pºâ²yÅé¹Ï®×·sªº¥ª¤W¨¤®y¼Ð¡A¨Ã°O¿ý©ó ( x¡Ay )¡C

¦b§âªº²yÅé¹Ï®×À¿±¼ªº¹Lµ{¤¤¡A§Ú­Ì¥i¥H§â¾ã­Ó¤u§@°Ï³£­«·sø»s¡A¦ý¬O³o¼Ë°µ¨Æ¤ñ¸û¯Ó¶O¸ê·½¡C¥t¤@ºØ°µªk¬O¡A¥u¦bªº²yÅé¹Ï®×ªº¨º¤@³¡¥÷¦ì¸m¡A¥H­I´º¹Ï¬Û¹ïÀ³ªº¦ì¸mµe¤W¥h¡C¦b ball µ{¦¡ùØ¡A¤p¤ì°¸±Ä¥Î«áºØ°µªk¡C©Ò¥H¤p¤ì°¸·Ç³Æ¤F¨â­Ó³]³Æ¤º®e¡Ghdcbk »P hdcbuffer¡A³o¨â­Ó³]³Æ¤º®e³£¬O°O¾ÐÅé³]³Æ¤º®e¡A¨âªÌ¤]³£¦s¦³­I´º¹Ï¡A¦ý¬O«eªÌ¶î¤W­I´º¹Ï«á¡A´N¤£·|¦AÅÜ°Ê¡F¦Ó«áªÌ«h·|µe¤W¹B°Êªº²yÅé¡A¨C¤@¦¸²¾°Ê²yÅé­n¦bªº²yÅé¦ì¸mÀ¿±¼²yÅé¹Ï®×®É¡Aµ{¦¡´N±q hdcbk ¬Û¹ïÀ³Âªº²yÅé¦ì¸m¨ú¥X­I´º¹ÏÂл\¤W¡Cµ{¦¡

                INVOKE  BitBlt,hdcbuffer,x0,y0,BallSize,BallSize,hdcbk,x0,y0,SRCCOPY

´N¬O¦b°õ¦æ³o¼Î¤u§@¡Ax0¡By0 ¬O²yÅé¹Ï®×ªºÂ¦ì¸mªº¥ª¤W¨¤®y¼Ð¡C±µ¤U¨Ó´N¬O§â·sªº²yÅé¦ì¸m¡A( x¡Ay )¡Aµe¤W²yÅé¹Ï®×¡C²yÅé¹Ï®×ªº¼Ë¤l¦p¹Ï¤@¤¤¶¡ªº ball.bmp¡A¥¦¬Oªø¼e¦U 80 ¹Ï¯Àªº¦ì¤¸¹Ï¡C°²¦p¥u¥Î³æ¯Âªº¥H SRCCOPY ¬°¾Þ§@°Ñ¼Æ©I¥s BitBlt §â²yÅé«þ¨©¨ì hdcbuffer¡A¨º»ò²yÅé©P³ò·|¦³¶Â®Ø¡F°²¦p·Q§â¶Â®Ø¥h±¼¡A±o©M­I´º¹Ï¶i¦æ OR ¹Bºâ ( ¦]¬°¶Â¦âªºÃC¦â¬° 0¡A»P­I´º¹Ï§@ OR ¹Bºâ«á¡A¤´·|±o¨ì­I´º¹Ï )¡A¬d MSDN¡A±oª¾À³¥Î SRCPAINT ¬°¾Þ§@°Ñ¼Æ©I¥s BitBlt¡C¦ý¦p¦¹¤@¨Ó¡A²yÅ骺³¡¥÷¤]·|»P­I´º¹Ï§@ OR ¹Bºâ¡A¦ý¬O°²¦p¯à¥ýÅý­I´º¹Ïªº²yÅ鳡¥÷Åܦ¨¶Â¦â¤S¤£¼vÅT¨ì²yÅé©P³òªº³¡¥÷¡A´N¥i¥H¸Ñ¨M³o­Ó°ÝÃD¤F¡C¤@¯ëªº°µªk¬O¦A«Ø¥ß¤@±i¹Ï¤ù¡A³o±i¹Ï¤ù¤@¯ëºÙ¬°¾B¸n¹Ï¡A¤]´N¬O¹Ï¤@³Ì¥kÃ䪺 mask.bmp¡A¹Ï®×ªº¥D­n³¡¥÷¡A¤]´N¬O²yÅé¡A¬°¶Â¦â¡A¦Ó­I´º¬°¥Õ¦â¡A¥ýÅý¾B¸n¹Ï»P­I´º¹Ï§@ AND ¹Bºâ¡A¦A¨Ï¦ì¤¸¹Ï»P­I´º¹Ï§@ OR ¹Bºâ§Y¥i¡G

                INVOKE  BitBlt,hdcbuffer,x,y,BallSize,BallSize,hdcmask,0,0,SRCAND
                INVOKE  BitBlt,hdcbuffer,x,y,BallSize,BallSize,hdcball,0,0,SRCPAINT

¥H¤Wªº¨BÆJ¥i¥H¥Î¤U¹Ï¨Ó»¡©ú¡G

¤W¹Ï¥ªªº­I´º¹Ï¤Wªº¥Õ®Ø¥Nªí¦¹³B±Nµe¤W²yÅ骺¹Ï®×¡A­º¥ý¬O±o·Ç³Æ¦n¤@±i¾B¸n¹Ï¡A¦¹¾B¸n¹Ï¬O§â­nµe¥Xªº¹Ï®×³¡¥÷¥H¶Â¦âªí¥Ü¡A¦Ó¨ä¥L¤´¬°­I´ºªº³¡¥÷¥H¥Õ¦âªí¥Ü¡A±µµÛ§â­I´º¹Ï¥Õ®Ø³¡¥÷»P¾B¸n¹Ï§@ AND ¹Bºâ¡A³Ì«á¦A§â­è­èªºµ²ªG»P²yÅé§@ OR ¹Bºâ¡A´N¥i¥H¥u§â²yÅéµe¤W¥h¡A¦Ó¦b¥Õ®Ø¤º¥B¦b²yÅé¥H¥~ªº³¡¥÷¤´¬°­I´º¹Ï¡C

¦b WM_TIMER ³Ì«á¡A©I¥s InvalidateRect ¨Ï¤u§@°ÏÅܬ°µL®Ä¡C¦Ó¦b WM_PAINT °T®§¤¤¡A¶È¦³¤@±ø«ü¥O¡A´N¬O§â½w½Ä°Ïªº³]³Æ¤º®e«þ¨©¨ì¤u§@°Ï¡G

                INVOKE  BitBlt,ps.hdc,0,0,xClient,yClient,hdcbuffer,0,0,SRCCOPY

µLªk½Õ¾ã¤j¤pªºµøµ¡

BALL µ{¦¡µLªk½Õ¾ãµøµ¡¤j¤p¡A¥D­n¬O¦b©I¥s CreateWindowEx ®É¡Aµøµ¡­·®æ¶È¥Î WS_CAPTION or WS_SYSMENU¡A¤£¨Ï¥Î±`¨£ªº WS_OVERLAPPEDWINDOW¡G

                INVOKE  CreateWindowEx,NULL,OFFSET szClassName,OFFSET szAppName,\
                        WS_CAPTION or WS_SYSMENU,0,0,xClient,yClient,0,NULL,hInstance,\
                        NULL

¨ì²Ä¤Q¤K³¹¡A ¦^¨ì­º­¶¡A ¨ì²Ä¤G¤Q³¹