Retour à la page MA62

Code-source asm32 partiel de TAQUIN


;------------------ ASSEMBLAGE

 intro     = 1                 ; 1 avec intro  ... sinon  0 pour essais prgm rapide
 final     = 1                 ; 1 avec son de fin

 chien     = 1                 ; runnig chien
 ball      = 0
 FocusDLG  = 1

 PosMouse  = 0                 ; Position dela Mouse

 BALL_caption_Cadre = 1        ; COLOR balle dans cadre_1   ou normale_0

 BG_GORKY  = 0
 BG_BABY   = 0
 BG_SAVANT = 1
 BG_SABABY = 0                 ; include     VK_ADD   VK_F4     384x208       NESTOR_ANIMATION_ASY.asm

;------------------        avmi
.data

Ps  PAINTSTRUCT  <>      ; WM_PAINT

Goofyflag DWORD  00      ; yeux DLG  1_ouverts   2_fermes
hwndDlg   DWORD  00      ; Handle to the dialog box
hwndDlg2  DWORD  00      ; Handle to the dialog box
hBmp1     DWORD  00      ; AVMI logo
hBmp2     DWORD  00      ; ClindOeil Gorky
hBmp3     DWORD  00      ; Clind'Oeil brun
hBmp4     DWORD  00      ; BALL_CAISSE_200x40.bmp    Balle .. caisse  et divers
hBmp5     DWORD  00      ; CHIEN_RUNNING_340x34.bmp  Running  at left and right
hBmp6     DWORD  00      ; COMPOSANT_COUNTRY.jpg     Commande system
hBmp7     DWORD  00      ;
hBmp8     DWORD  00      ;

hBmp507   DWORD  00      ; NESTOR_PAUSE_ANI_600x75.bmp     Animation NESTOR  15_Ko
hBmp508   DWORD  00      ; PANO_TAQUIN.bmp   14_Ko           // Pano de commande
hBmp509   DWORD  00      ; COMPOSANT_TAQUIN.bmp  59_Ko   Les Chiffrages et marquages.

hBmp530   DWORD  00      ; Handle de selection de tuiles
hBmp531   DWORD  00      ; TUILE_1344x42_BLEU.jpg    Les 30 tuiles 42x42  BLEU  1 à 30
hBmp532   DWORD  00      ; TUILE_1344x42
hBmp533   DWORD  00      ; TUILE_1344x42
hBmp534   DWORD  00      ; TUILE_1344x42
hBmp535   DWORD  00      ; TUILE_1344x42
hBmp536   DWORD  00      ; TUILE_1344x42
hBmp537   DWORD  00      ; TUILE_1344x42
hBmp538   DWORD  00      ; TUILE_1344x42

memDC     DWORD  00      ; CreateCompatibleDC
hDC       DWORD  00      ; GetDC
hWDC      DWORD  00      ; GET_WINDOW_DC

; rule         0        1         2         3         4         5         6         7         8         9
;              123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890

Flg0      BYTE   07       ; Flg   selection alternative etc..
Flg1      BYTE   00       ; Flg   clind'oeil de Gorky Droite
Flg2      BYTE   00       ; Flg   YEUX fermes/ouverts de Gorky GAUCHE
Flg3      BYTE   00       ; Flg   clind'oeil de Gorky GAUCHE
Flg4      BYTE   00       ; Flg   YEUX fermes/ouverts de Gorky DROITE

FlgClose   BYTE  00      ; Cle  CLOSE prgm
FlgMini    BYTE  00      ; Cle  Minimize

;----------------------------------------------------------------------------------------------------------------------   MUSIQUE
Flg_Music   BYTE 01      ;  Flag 1 OUI NON 0 via Cmd Barre .. DEFAULT pour Affichage  Music OUI au start du prgm
Flg_Vol    DWORD 61      ;  Flag SON 0 à 99  Volume SonMidi de 0 à 100 %
Vol_Org    DWORD 00      ;  Volme Origine
FlgStopM    BYTE 00      ;  Flag Cmd music via touche de fonctions  F4 à F8
Flg_Tmp1    BYTE 01      ;  Tempo d'Affichage d'une bulle 'inforamtion son level

Flg_NoRAND  BYTE 01

Flg_Direct  BYTE 00      ;  Flag de direction des fleches  D G H b
Flg_Jeton   BYTE 01      ;  Flag de selection des jetons-tuiles
Flg_Tempo   BYTE 00      ;  Temporisation appres la RAZ

CF_Cnt     BYTE 99      ;  Affichage du Nombre d'ouverture

;------ SOUND

Snd_Exit    DWORD  607        ;  Exit du JEU ou avortement
Snd_Style   DWORD  607
Snd_Level   DWORD  607
Snd_Heure   DWORD  607
;------------------------
;Caption_Mouse  PROTO :DWORD,:DWORD ; hWnd,lParam
.code
WndProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM

.IF      uMsg == WM_CREATE

    invoke BitmapFromResource, hInstance, 501     ; avmi_LOGO GIF             Procedure via JMM_GIF.lib
       mov hBmp1,eax
    invoke LoadImage, hInstance,503,IMAGE_BITMAP,0,0,LR_LOADTRANSPARENT or LR_LOADMAP3DCOLORS  ; Clind'Oeil brun
       mov hBmp3,eax
    invoke LoadBitmap,hInstance,504               ; BALL_CAISSE_200x40.bmp    Balle .. caisse  et divers
       mov hBmp4,eax
    invoke LoadBitmap,hInstance,505               ; CHIEN_RUNNING_340x34.bmp  Running at left and right
       mov hBmp5,eax
    invoke LoadBitmap,hInstance,506               ; COMPOSANT_COUNTRY.bmp          Commande system
       mov hBmp6,eax
    invoke LoadBitmap,hInstance,507               ; NESTOR_PAUSE_ANI_600x75.bmp    Animation NESTOR  15_Ko
       mov hBmp507, eax
    invoke LoadBitmap,hInstance,508               ; PANO_TAQUIN.bmp  14_Ko         BG du Pano de commande
       mov hBmp508, eax
    invoke LoadBitmap,hInstance,509               ; COMPOSANT_TAQUIN.bmp  59_Ko   Les Chiffrages et marquages.
      mov hBmp509, eax

    invoke BitmapFromResource, hInstance, 531     ; TUILE_1344x42_BLEU.jpg    Les 30 tuiles 42x42  BLEU  1 à 30
       mov hBmp531, eax
    invoke BitmapFromResource, hInstance, 532      ;
       mov hBmp532, eax

    invoke LoadCursor,hInstance,405               ; line 416
       mov hCurs1,eax

;   invoke SetTimer,hWnd,001,  60,NULL            ; Action generale       voir ci-dessous
;   invoke SetTimer,hWnd,003, 800,NULL
    invoke SetTimer,hWnd,002, 200,NULL            ; chien running
    invoke SetTimer,hWnd,004,1420,NULL            ; yeux ouverts DLG
    invoke SetTimer,hWnd,005, 310,NULL            ;   -   fermes DLG
    invoke SetTimer,hWnd,006, 120,NULL            ; Clind'oeil tempo ferme
    invoke SetTimer,hWnd,060,1000,NULL            ; SECONDE pour le tempo

    invoke SetTimer,hWnd,090,  80,NULL            ; Animation du titre JUKE-BOX
    invoke SetTimer,hWnd,099,  68,NULL            ; INTRO
    invoke SetTimer,hWnd,080,2300,NULL            ; Clind'oeil GORKY
    invoke SetTimer,hWnd,081,2700,NULL            ; Clind'oeil GORKY


    invoke GetDC,hWnd
       mov hDC, eax
    invoke CreateCompatibleDC,hDC
       mov memDC,eax

    invoke GetWindowDC,hWnd
       mov hWDC,  eax

.data
     hPano DWORD 00      ;  PANO    600x220      hPano <-> hPano
; hdcBarre DWORD 00      ;  Barre   560x34
  hBitmap1 DWORD 00      ;
  hBitmap2 DWORD 00      ;
.code

    invoke CreateCompatibleDC,hDC
       mov hPano,eax
    invoke CreateCompatibleBitmap,hDC,600,220                              ; PANO 600x210
       mov hBitmap1 ,eax
    invoke SelectObject,hPano,hBitmap1                                     ; Une seule fois pour tout le prgm

;   invoke CreateCompatibleDC,hDC
;      mov hdcBarre,eax
;   invoke CreateCompatibleBitmap,hDC,600,34                               ; BARRE
;      mov hBitmap2 ,eax
;   invoke SelectObject,hdcBarre,hBitmap2                                  ; Une seule fois pour tout le prgm

    invoke SelectObject,memDC,hBmp508
    invoke StretchBlt,hPano, 0, 0,600,220,memDC, 0, 0,600,220,0CC0020h     ; WHITE via BMP 501  du PANO

;   invoke StretchBlt,hdcBarre, 0, 0,600,034,memDC, 0, 0,695,034,0CC0020h  ; WHITE      -

comment¤ ;*****************************************************
.data
 hDCW   DWORD 00 ; la window
 hDCS   DWORD 00 ; le screen
 Pilote    db "DISPLAY",0
.code
       invoke CreateDC,addr Pilote,NULL,NULL,NULL
          mov hDCS,eax
       invoke GetWindowDC,hWnd
          mov hDCW,eax
ccccccc¤ ;*****************************************************


;----------------------------------------------------------------------------------------------------------------------   Les EXRAS

     push  hBmp532
     pop   hBmp530             ; hBmp530  Handle de selection

;   invoke CreatePen,PS_SOLID,1,0E0D0D0h                                    ; COLOR Grill
;   invoke SelectObject,hDC,eax

    invoke Aleatorize

    invoke  SetTimer,hWnd,040,  250,NULL     ; Action et Animation  NESTOR

    include A_REGISTRY_TAQUIN.asm



.ELSEIF  uMsg == WM_TIMER && wParam == 090  ; --------------------------------- ANIMATION du TITRE

 include .\Ani_TITRE.asm


.if      CF_Cnt == 0    ;  Affichage du Nombre d'ouverture
.data
 FormatC    db  "Nmb = %.6i",0
    msgq    db   16 DUP(?),0
 Buf_efC    db   28 DUP(' '),0
.code
      inc  CF_Cnt
   invoke  TextOut,hDC,810,90,addr Buf_efC,28    ; Effacement
   invoke  wsprintf,addr msgq,addr FormatC,DecValue
   invoke  TextOut,hDC,810,90,addr msgq,eax
  .elseif  CF_Cnt < 10
      inc  CF_Cnt
  .elseif  CF_Cnt == 10
      mov  CF_Cnt,99
   invoke  TextOut,hDC,810,90,addr Buf_efC,28    ; Effacement
  .endif
;----------------------------------------------------------------------------------------------------------------------   MUSIQUE
.ELSEIF    uMsg == MM_MCINOTIFY
    invoke CloseMidiFile
       mov Flg_Music,0


.ELSEIF  uMsg == WM_TIMER && wParam == 099  ; ================================= STARTING
 invoke KillTimer,hWnd,99


;----------------------------------------------------------------------------------------------------------------------   MUSIQUE
    invoke GetMasterVolume               ; Save OLD value origine value  et le restaure dans WM_DESTROY
       mov Vol_Org,eax
;-------------------------- Musique
.data
     FlgSelt DWORD 00      ; Flag  default de selection d'une des 4 musiques via les touches de fonction  F5 F6 F7 et F8
        hRes DWORD 00      ; Handle de la ressourec file.mid du RC
        hmem DWORD 00
      Hfile1 DWORD 00      ; Handle de createFile() pour Mus_Classic.mid  fichier tampon.
     Nb_char DWORD 00      ; Size en octets du file.mid selectionne.
        ptxt    db   "TEXT",0
          M1    db   "C:\RC_champagn.mid",0
          M2    db   "C:\RC_honymoon.mid",0
          M3    db   "C:\RC_sunflower.mid",0
          M4    db   "C:\RC_Winapi3.mid",0
          M5    db   "C:\RC_Invention_BWV785.mid",0   ;< PLACER en dernier
          M0 DWORD   M1,M2,M3,M4,M5
.code
         mov FlgSelt,00
     @@: mov eax,1001
         add eax,FlgSelt

      invoke FindResource,NULL,eax,addr ptxt
         mov hRes,eax
      invoke SizeofResource,hInstance,hRes
         mov Nb_char,eax
      invoke LoadResource,NULL,hRes
         mov hmem,eax
         mov esi,offset M0
         mov ecx,FlgSelt
         mov eax,[esi+ecx*4]
      invoke CreateFile,eax,GENERIC_WRITE,FILE_SHARE_WRITE,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL
         mov Hfile1,eax
.if     Hfile1 == INVALID_HANDLE_VALUE
.else
 invoke WriteFile,Hfile1,hmem,Nb_char,addr Nb_char,NULL
 invoke CloseHandle,Hfile1                               ;< CLOSE .. sinon le file ne peut etre Play par MCI
.endif
         inc FlgSelt
         cmp FlgSelt,5     ;< Number de music.mid a copier
         jnz @B
;-------------------------- End musique


IF intro
;   invoke Sleep,200
   invoke PlaySoundA,600,00,40005h         ; Chien
   invoke Sleep,400
   invoke PlaySoundA,600,00,40005h         ; Chien
   invoke Sleep,200
;; invoke PlaySoundA,610,00,40005h         ; U_Sortie
   invoke PlayMidiFile,hWnd,addr M5        ; Musique  intro .. MIDI
ENDIF

   invoke  SendMessage,hWnd,WM_KEYDOWN,VK_SUBTRACT,NULL

   invoke  SetTimer,hWnd,001, 36,NULL      ; Action generale
;; invoke  SetTimer,hWnd,040,300,NULL      ; Action et Animation  NESTOR

.ELSEIF  uMsg == WM_TIMER && wParam == 040

include NESTOR_ANIMATION_ASY.asm

include Clock_Digital.asm

.ELSEIF  uMsg == WM_TIMER && wParam == 060  &&  Flg_JEU == 4  &&  Flg_Try > 0

     inc Flg_Sec

.ELSEIF  uMsg == WM_TIMER && wParam == 001  ; ========================================================================== ANIMATION GENERALE

;------------------------------------------  Affichage du OUI NON musique                                                 MUSIQUE
.data
 CF_repA  BYTE 00                                                       ; Clef anti-repette   A REVOIR  pour no repette
 CF_repB  BYTE 00
 CF_repC  BYTE 01  ; Clrf d'affichage du Nivo LEVEL du jeu
.code

   .if      Flg_Music == 1  &&  CF_repA == 0
       mov  CF_repA,1
    invoke  SelectObject,memDC,hBmp509                                          ;< Composant
    invoke  StretchBlt,hPano,076,155,20,12,memDC,320,0176,20,12,0CC0020h        ;  oui_144   OUI_176
   .elseif  Flg_Music == 0  &&  CF_repA == 1
       mov  CF_repA,0
    invoke  SelectObject,memDC,hBmp509
    invoke  StretchBlt,hPano,076,155,20,12,memDC,320,0192,20,12,0CC0020h        ;  non_160   NON_192
   .endif

   ;------------------------------------------ Affichage du STYLE

   .if      Flg_Jeton == 1 &&  CF_repB == 0
       mov  CF_repB,1
    invoke  SelectObject,memDC,hBmp509
    invoke  StretchBlt,hPano,540,118,021,021,memDC,320,208,021,021,0CC0020h     ;  SHOWN dela tuile selectionnee
   .elseif  Flg_Jeton == 2 &&  CF_repB == 1
       mov  CF_repB,0
    invoke  SelectObject,memDC,hBmp509
    invoke  StretchBlt,hPano,540,118,021,021,memDC,320,240,021,021,0CC0020h     ;  SHOWN dela tuile selectionnee
   .endif
   ;------------------------------------------ Affichage du  LEVEL du jeu

.if  CF_repC == 1
 mov CF_repC,0
 invoke  SelectObject,memDC,hBmp509

   .if       Flg_Niveau ==  1
    invoke  StretchBlt,hPano,536,153,030,012,memDC,352,144,030,012,0CC0020h
   .elseif   Flg_Niveau ==  2
    invoke  StretchBlt,hPano,536,153,030,012,memDC,384,144,030,012,0CC0020h
   .elseif   Flg_Niveau ==  3
    invoke  StretchBlt,hPano,536,153,030,012,memDC,417,144,030,012,0CC0020h
   .elseif   Flg_Niveau ==  4
    invoke  StretchBlt,hPano,536,153,030,012,memDC,449,144,030,012,0CC0020h
   .elseif   Flg_Niveau ==  5
    invoke  StretchBlt,hPano,536,153,030,012,memDC,480,144,030,012,0CC0020h
   .elseif   Flg_Niveau ==  6
    invoke  StretchBlt,hPano,536,153,030,012,memDC,512,144,030,012,0CC0020h
   .endif
.endif
   include  JEU_ACTION.asm

;-- En derniere ligne et dans WM_PAINT ---------------------------------  hPano
    invoke  StretchBlt,hDC,220,210,600,220,hPano,0,0,600,220,0CC0020h
;---------------------------------------------------------------------------------
 .ELSEIF uMsg==WM_COMMAND
;------------------------------------------------------------  MENU POPUP
.const
IDM_F1  EQU  1101
IDM_F5  EQU  1105
IDM_F6  EQU  1106
IDM_F7  EQU  1107
IDM_F8  EQU  1108
IDM_M   EQU  1109
.code
            mov eax,wParam
        .if     ax == IDM_F5
         invoke SendMessage,hWnd,WM_KEYDOWN,VK_F5,NULL
        .elseif ax == IDM_F6
         invoke SendMessage,hWnd,WM_KEYDOWN,VK_F6,NULL
        .elseif ax == IDM_F7
         invoke SendMessage,hWnd,WM_KEYDOWN,VK_F7,NULL
        .elseif ax == IDM_F8
         invoke SendMessage,hWnd,WM_KEYDOWN,VK_F8,NULL
        .elseif ax == IDM_M
         invoke SendMessage,hWnd,WM_KEYDOWN,VK_M,NULL
        .elseif ax == IDM_F1
         invoke SendMessage,hWnd,WM_KEYDOWN,VK_F1,NULL
        .endif
         invoke SetTimer,hWnd,28,122,NULL


 ; .ELSEIF  uMsg == WM_LBUTTONUP                 ;;   ICI le send WM_KEYUP   avec WM_KEYUP  moins efficace et avec BUG.
 ;  invoke SendMessage,hWnd,WM_KEYUP,NULL,NULL   ;;

    invoke SetTimer,hWnd,57, 100,NULL            ;;   ICI le send WM_KEYUP   avec WM_TIMER  de 100 millisec.
   .ELSEIF  uMsg == WM_TIMER && wParam == 57     ;;
    invoke SendMessage,hWnd,WM_KEYUP,VK_F5,NULL  ;;

;------------------------------------------------------------  MENU POPUP

;;.ELSEIF  uMsg == WM_RBUTTONDOWN    &&   hwndDlg==0

;;     invoke CreateDialogParam,hInstance, addr DlgName,hWnd,OFFSET DlgProc,NULL
;;        mov hwndDlg,eax
;;        mov Goofyflag,1

;------------------------------------------------------------  MENU POPUP
.ELSEIF  uMsg == WM_RBUTTONDOWN
.data
 Menu1   byte  "PopupMenu",0
 hMenu   DWORD  00
   hTP   DWORD  00
 ptM     POINT <>
 Norect  RECT  <0,0,1200,900>
.code
    push lParam
     pop word PTR ptM.x
     pop word PTR ptM.y
  invoke LoadMenu,hInstance, addr Menu1
     mov hMenu,eax
  invoke GetSubMenu,hMenu, NULL
     mov hTP,eax

;    mov ptM.x,1220                            ; Position du menu  ala MOUSE
;    mov ptM.y,640                             ;     -

     mov ptM.x,900                             ; Position du menu IMPOSe
     mov ptM.y,430                             ;     -

  invoke ClientToScreen,hWnd, addr ptM
;    sub ptM.y,140
;    sub ptM.x,60
;    mov ptM.x,10
;    mov ptM.y,40
  invoke TrackPopupMenu,hTP,NULL,ptM.x,ptM.y,NULL, hWnd,addr Norect
  invoke DestroyMenu,hMenu

.ELSEIF uMsg==WM_MOUSEMOVE                  ; Uniquement pour le son wave du Mouse-chien
   .data
    BUG3 db 16 DUP(?)                       ; interference de memoire ? (par precaution)
    Pos POINT <0,0>                         ; Position de la mouse    Pos.x   Pos.y  (long dword)
   .code
    push lParam
    pop word PTR Pos.x
    pop word PTR Pos.y

    mov  CF_PickKEY,0                                                                                                    ; JEU_ACTION

   ;*********************************************  PICK_MOUSE.asm
    include  Pick_MOUSE.asm
   ;*********************************************  End

IF PosMouse
.data
 Formatz   db   "Pos X = %.4i .... Pos Y = %.4i ....",0
    msgz   db   32 DUP(?),0
.code
    invoke wsprintf,addr msgz,addr Formatz,Pos.x,Pos.y
    invoke TextOut,hDC,50,42,addr msgz,eax
ENDIF

   ; --------------------------------------------------  Changement du cursor en croix de deplacement
IF     BG_GORKY
        .if (Pos.y > 278 && Pos.y < 328) && ((Pos.x > 138 && Pos.x < 186) || (Pos.x > 854 && Pos.x < 902))
ELSEIF BG_BABY
        .if (Pos.y > 220 && Pos.y < 246) && ((Pos.x > 92 && Pos.x < 126) || (Pos.x > 912 && Pos.x < 946))
ELSEIF BG_SAVANT
        .if (Pos.y > 175 && Pos.y < 262) && ((Pos.x > 92 && Pos.x < 162) || (Pos.x > 872 && Pos.x < 942))
ELSEIF BG_SABABY
        .if (Pos.y > 220 && Pos.y < 246) && ((Pos.x > 92 && Pos.x < 126) || (Pos.x > 912 && Pos.x < 946))
ENDIF

    invoke SetCursor,hCurs1  ;  DC_SIZEALL
   .endif
   .if (Pos.y > 02 && Pos.y < 36) && (Pos.x > 22 && Pos.x < 950)           ; CAPTION Magique Balles
    invoke SetCursor,hCurs1
   .endif

   .if     (Pos.y > 9 && Pos.y < 27) && (Pos.x > 984 && Pos.x < 1022)      ; CLOSE le PRGM
    invoke  SelectObject,memDC,hBmp6                                       ; Close X RED
    invoke  StretchBlt,hDC,955,11,066,016,memDC,80,00,066,016,0CC0020h
       .if  FlgClose == 0
       mov  FlgClose,1
       invoke PlaySoundA,603,00,40005h                                     ; .wav
       .endif
   .elseif  FlgClose == 1
       mov  FlgClose,0
    invoke  SelectObject,memDC,hBmp6                                       ; Normal Gris
    invoke  StretchBlt,hDC,955,11,066,016,memDC,00,00,066,016,0CC0020h
   .endif

   .if     (Pos.y > 9 && Pos.y < 27) && (Pos.x > 954 && Pos.x < 982)       ; SW_MINIMIZE Shown
    invoke  SelectObject,memDC,hBmp6                                       ;
    invoke  StretchBlt,hDC,955,11,066,016,memDC,160,00,066,016,0CC0020h
       .if  FlgMini == 0
       mov  FlgMini,1
    invoke  PlaySoundA,603,00,40005h                                       ; .wav
    .endif
   .elseif  FlgMini == 1
       mov  FlgMini,0
    invoke  SelectObject,memDC,hBmp6                                       ; Normal Gris
    invoke  StretchBlt,hDC,955,11,066,016,memDC,00,00,066,016,0CC0020h
   .endif

IF chien
   include .\Res\CHIEN_COUNTRY_Runnig.asm   ; via .ELSEIF uMsg==WM_TIMER && wParam == 2  placer en fin WM_MOUSEMOVE
ENDIF

.ELSEIF  uMsg == WM_PAINT
;Ps  PAINTSTRUCT  <>      ; WM_PAINT

    invoke   BeginPaint,hWnd,ADDR Ps
    invoke   EndPaint,hWnd,ADDR Ps

    invoke   SelectObject,memDC,hBmp1                                          ; AVMI_logo  GIF
    invoke   StretchBlt,hDC, 0, 0,1044,584,memDC,0,0,1044,584,0CC0020h
    invoke   SelectObject,memDC ,hBmp5
    invoke   StretchBlt,hDC,PHimg,PVimg,34,34,memDC,IMG, 0, 34, 34,0CC0020h    ; Animation du chien en rapelle

    invoke   StretchBlt,hDC,220,210,600,220,hPano,0,0,600,220,0CC0020h         ; Animation  Rappel

.ELSEIF  uMsg==WM_LBUTTONDOWN
     push lParam
     pop word PTR Pos.x
     pop word PTR Pos.y

     mov CF_PickKEY,1     ; Pour  JEU_ACTION.asm   (raz aussitôt)                                                          JEU_ACTION

comment¤
 CF_heure    BYTE  00    ;  0  1  OverOn HEURE
 CF_music    BYTE  00    ;  0  1  OverOn MUSIQUE
 CF_help     BYTE  00    ;  0  1  OverOn HELP
 CF_exit     BYTE  00    ;  0  1  OverOn OPTION
 CF_style    BYTE  00    ;  0  1  OverOn STYLE
 CF_niveau   BYTE  00    ;  0  1  OverOn OPTION
 CF_start    BYTE  00    ;  0  1  OverOn START
c------¤
.data
 RD_3 db "rundll32.exe shell32.dll,Control_RunDLL timedate.cpl",0           ; Control_RunDLL   pour cpl
.code
   .if     CF_help   == 1
    invoke SendMessage,hWnd,WM_KEYDOWN,VK_F1,NULL
   .elseif CF_start  == 1
    invoke SendMessage,hWnd,WM_KEYDOWN,VK_RETURN,NULL
   .elseif CF_heure  == 1
    invoke PlaySoundA,Snd_Heure,00,40005h
    invoke WinExec,ADDR RD_3,SW_SHOW
   .elseif CF_style  == 1
    invoke SendMessage,hWnd,WM_KEYDOWN,VK_S,NULL
   .elseif CF_niveau == 1
    invoke SendMessage,hWnd,WM_KEYDOWN,VK_L,NULL
   .elseif CF_music  == 1
    invoke SendMessage,hWnd,WM_KEYDOWN,VK_M,NULL
   .elseif CF_exit == 1
    invoke SendMessage,hWnd,WM_KEYDOWN,VK_X,NULL
   .endif

   ;------------------------MoveWinodos
IF     BG_GORKY
        .if (Pos.y > 278 && Pos.y < 328) && ((Pos.x > 138 && Pos.x < 186) || (Pos.x > 854 && Pos.x < 902))
ELSEIF BG_BABY
        .if (Pos.y > 220 && Pos.y < 246) && ((Pos.x > 92 && Pos.x < 126) || (Pos.x > 912 && Pos.x < 946))
ELSEIF BG_SAVANT
        .if (Pos.y > 175 && Pos.y < 262) && ((Pos.x > 92 && Pos.x < 162) || (Pos.x > 872 && Pos.x < 942))
ELSEIF BG_SABABY
        .if (Pos.y > 220 && Pos.y < 246) && ((Pos.x > 92 && Pos.x < 126) || (Pos.x > 912 && Pos.x < 946))
ENDIF
    invoke SetCursor,hCurs1
       mov Flg1,1
       mov Flg3,1                                                        ; Yeux fermes Gorky Right/Left
    invoke PlaySoundA,601,00,40005h                                      ; GLUCH.wav
    invoke SendMessage,hWnd,WM_NCLBUTTONDOWN,HTCAPTION,lParam
   .endif

   .if (Pos.y > 02 && Pos.y < 36) && (Pos.x > 22 && Pos.x < 950)        ; CAPTION  CURSOR

    invoke SetCursor,hCurs1
    invoke SendMessage,hWnd,WM_NCLBUTTONDOWN,HTCAPTION,lParam
   .endif

   .if     (Pos.y > 9 && Pos.y < 27) && (Pos.x > 984 && Pos.x < 1022)    ; CLOSE le PRGM
    invoke DestroyWindow,hWnd
   .endif
   .if     (Pos.y > 9 && Pos.y < 27) && (Pos.x > 954 && Pos.x < 982)     ; SW_MINIMIZE Shown                                                                          ;  SW_MINIMIZE Shown
    invoke ShowWindow, hWnd,SW_MINIMIZE   ;  SW_HIDE  ;   SW_SHOWNORMAL
   .endif

.ELSEIF  uMsg == WM_SYSKEYDOWN    ; avec ALT

  .if     wParam == VK_F4
   invoke SendMessage,hWnd,WM_SYSCOMMAND,SC_CLOSE,NULL
  .endif

  .if      wParam == VK_INSERT
    mov    CF_Cnt,0
  .endif

.ELSEIF  uMsg == WM_KEYUP

   ;-------------------------------------  Selection MUSIQUE
   ;  Flg_Music   1 OUI NON 0  .. DEFAULT pour Affichage  Music OUI au start du prgm
   .if      FlgStopM == 5
    invoke  PlayMidiFile,hWnd,offset M2
       mov  FlgStopM,50
       mov  Flg_Music,1
   .elseif  FlgStopM == 6
    invoke  PlayMidiFile,hWnd,offset M3
       mov  FlgStopM,60
       mov  Flg_Music,1
   .elseif  FlgStopM == 7
    invoke  PlayMidiFile,hWnd,offset M4
       mov  FlgStopM,70
       mov  Flg_Music,1
   .elseif  FlgStopM == 8
    invoke  PlayMidiFile,hWnd,offset M1
       mov  FlgStopM,80
       mov  Flg_Music,1
   .endif

.ELSEIF  uMsg == WM_KEYDOWN

   ;-------------------------------  VOLUME SOUND

comment¤
   .if      Flg_Tmp1 == 1
        mov Flg_Tmp1,0
        mov eax,Flg_Vol                               ; Flg_Vol    DWORD   00     ;   0 à 99     .. Volume son musique
     invoke Display2 ,10
     invoke SelectObject,memDC,hBmp509                ; 5)   ; || wParam == VK_N
        inc Flg_Niveau
       .if  Flg_Niveau >= 7
        mov Flg_Niveau,1
       .endif
        mov CF_repC,1
 invoke PlaySoundA,Snd_Level,00,40005h
.endif
 .if         Flg_JEU  == 3  || Flg_JEU  > 5    ;; &&  Flg_JEU  != 4   ; selection du niveau
    .if      wParam == VK_1
        mov CF_repC,1
        mov  Flg_Niveau, 1
    .elseif  wParam == VK_2
        mov CF_repC,1
        mov  Flg_Niveau, 2
    .elseif  wParam == VK_3
        mov CF_repC,1
        mov  Flg_Niveau, 3
    .elseif  wParam == VK_4
        mov CF_repC,1
        mov  Flg_Niveau, 4
    .elseif  wParam == VK_5
        mov CF_repC,1
        mov  Flg_Niveau, 5
    .elseif  wParam == VK_6
        mov CF_repC,1
        mov  Flg_Niveau, 6
    .elseif  wParam == VK_F12
        mov CF_repC,1
        mov  Flg_Niveau, 8
    .endif
    .if      wParam == VK_S  &&  Flg_Jeton == 2    &&  CF_Eff == 1  ;  CF_Eff pas de style pendant le rand des jetons
        mov  Flg_Jeton,1
     invoke  PlaySoundA,Snd_Style,00,40005h
    .elseif  wParam == VK_S  &&  Flg_Jeton == 1    &&  CF_Eff == 1
        mov  Flg_Jeton,2
     invoke  PlaySoundA,Snd_Style,00,40005h
    .endif
 .endif

    ;VK_LEFT     equ 25h   ;     gauche
    ;VK_UP       equ 26h   ;     Fleche haut
    ;VK_RIGHT    equ 27h   ;     droite
    ;VK_DOWN     equ 28h   ;     bas
    .if     wParam == VK_LEFT    &&  Flg_JEU  == 4
     mov    Flg_Direct,VK_LEFT
    .elseif wParam == VK_RIGHT   &&  Flg_JEU  == 4
     mov    Flg_Direct,VK_RIGHT
    .elseif wParam == VK_UP      &&  Flg_JEU  == 4
     mov    Flg_Direct,VK_UP
    .elseif wParam == VK_DOWN    &&  Flg_JEU  == 4
     mov    Flg_Direct,VK_DOWN
    .endif

    .if      Flg_Jeton == 1  &&  Flg_JEU < 4
       push  hBmp531
        pop  hBmp530          ; hBmp530 Handle de selection
    .elseif  Flg_Jeton == 2  &&  Flg_JEU < 4
       push  hBmp532
        pop  hBmp530
    .endif

    ;------- VOLUME
    .if      wParam == VK_SUBTRACT  && Flg_Vol > 0     ; 0 à 100 % pour-cent    VOLUME Son MIDI                          ;    SON
        sub  Flg_Vol,1
        mov  Flg_Tmp1,1                                ; Tempo d'Affichage dela bulle
     invoke  PlaySoundA,614,00,40005h                  ; SNAP.WAV   Bruit du clavier
    .elseif  wParam == VK_ADD       && Flg_Vol < 99    ;
        add  Flg_Vol,1                                 ; Tempo d'Affichage dela bulle
        mov  Flg_Tmp1,1
     invoke  PlaySoundA,614,00,40005h                  ; SNAP.WAV   Bruit du clavier
    .endif

   ;------------------------------------------  Selection MUSIQUE
    .if       wParam == VK_F5
     invoke   CloseMidiFile
      .if     FlgStopM == 50
        mov   FlgStopM,0
        mov   Flg_Music,0
      .elseif FlgStopM != 50
        mov   FlgStopM,5
        mov   Flg_Music,1
      .endif
    .elseif   wParam == VK_F6

     invoke   CloseMidiFile
      .if     FlgStopM == 60
        mov   FlgStopM,0
        mov   Flg_Music,0
      .elseif FlgStopM != 60
        mov   FlgStopM,6
        mov   Flg_Music,1
      .endif
    .elseif   wParam == VK_F7

     invoke   CloseMidiFile
      .if     FlgStopM == 70
        mov   FlgStopM,0
        mov   Flg_Music,0
      .elseif FlgStopM != 70
        mov   FlgStopM,7
        mov   Flg_Music,1
      .endif
    .elseif   wParam == VK_F8

     invoke   CloseMidiFile
      .if     FlgStopM == 80
        mov   FlgStopM,0
        mov   Flg_Music,0
      .elseif FlgStopM != 80
        mov   FlgStopM,8
        mov   Flg_Music,1
      .endif
    .endif

  .if   wParam == VK_M
      .if      Flg_Music == 0
       mov     Flg_Music,1
       invoke  PlayMidiFile,hWnd,addr M5
      .elseif  Flg_Music == 1
       mov     Flg_Music,0
       invoke  CloseMidiFile
      .endif
   PosH = 514  ;  X   OUI  NON  àla musique
   PosV = 08   ;  Y
  .endif

;------------------------------------------------------------------------------------------------------------------ END MUSIQUE
    .if wParam == VK_F1  &&   hwndDlg==0
     invoke CreateDialogParam,hInstance, addr DlgName,hWnd,OFFSET DlgProc,NULL
        mov hwndDlg,eax

IF FocusDLG
     invoke SetFocus,hwndDlg    ;  FOCUS àla DlgBox     WM_KILLFOCUS  et  and a WM_SETFOCUS
ENDIF
        mov Goofyflag,1

    .elseif hwndDlg==0
    .endif

    .if     (wParam == VK_F3 || wParam == VK_F4) && hwndDlg2 == 0
     invoke CreateDialogParam,hInstance,addr DlgName2,hWnd,OFFSET DlgProc2,NULL
        mov hwndDlg2,eax
    .endif

    .if wParam==VK_F2
     invoke PlaySoundA,603,00,40005h
    .data
     AboutMsg db "MERLIMONT and game",13,10
              db "Copyright © 1999-2010 JMM",0
     DName    db "MERLIMONT Informatique & game",0
    .code

     invoke PlaySoundA,610,00,40005h                           ; 620 Music Mozart
     invoke ShellAbout,hWnd,ADDR DName,ADDR AboutMsg,hIcon
     invoke PlaySoundA,609,00,40005h                           ; Send_MSG.wav     Apres
    .endif

 IF      BG_GORKY
         include .\CLINDOEIL_GORKY.asm
 ELSEIF  BG_BABY
         include .\CLINDOEIL_BABY.asm
 ELSEIF BG_SAVANT
;;         include .\CLINDOEIL_SAVANT.asm
 ELSEIF BG_SABABY
         include .\CLINDOEIL_SABABY.asm
 ENDIF

.ELSEIF  uMsg == WM_TIMER && wParam == 4 &&  Goofyflag==2   ; 1_Ouvert  2_Ferme
            invoke Paint_Goofy_Eyes,hwndDlg
.ELSEIF  uMsg == WM_TIMER && wParam == 5 &&  Goofyflag==1   ; 1_Ouvert  2_Ferme
            invoke Paint_Goofy_Eyes,hwndDlg

;--------------------------------------- PostQUIT & Procedures

.ELSEIF wParam==1Bh
         invoke DestroyWindow,hWnd
.ELSEIF   uMsg==WM_DESTROY

         invoke CloseMidiFile
         invoke SetMasterVolume,Vol_Org
IF final
         invoke PlaySoundA,602,00,40004h      ; U_Sortie
ENDIF
         invoke DeleteDC,memDC
         invoke ReleaseDC,hWnd,hDC
         invoke PostQuitMessage,NULL
.ELSE
         invoke DefWindowProc,hWnd,uMsg,wParam,lParam
.ENDIF
         ret
WndProc endp
Retour à la page MA62