begin process at 2010 03 20 01:07:53
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

divers

 > FENETRE IRREGULIERE COOL POUR LES SPLASH OU INTRO! [MASM32]

FENETRE IRREGULIERE COOL POUR LES SPLASH OU INTRO! [MASM32]


 Information sur la source

Note :
8,67 / 10 - par 3 personnes
8,67 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :divers Niveau :Initié Date de création :29/06/2002 Date de mise à jour :29/06/2002 01:25:51 Vu / téléchargé :4 782 / 423

Auteur : BlackWizzard

Ecrire un message privé
Site perso
Ce membre participe au partage de revenus publicitaires
Commentaire sur cette source (6)
Ajouter un commentaire et/ou une note


 Description

Cliquez pour voir la capture en taille normale
encore un code pas de moi mais que je me suis amusé a modifier...
j'apprend l'asm comme ça, en modifiant et en touchant a tout!

le prog pour generer le fichier .rgn, je l'ai trouvé ici :: http://www.codeproject.com/

Source

  • .386
  • .model flat, stdcall
  • option casemap :none
  • include \MASM32\INCLUDE\windows.inc
  • include \MASM32\INCLUDE\gdi32.inc
  • include \MASM32\INCLUDE\user32.inc
  • include \MASM32\INCLUDE\kernel32.inc
  • includelib \MASM32\LIB\gdi32.lib
  • includelib \MASM32\LIB\user32.lib
  • includelib \MASM32\LIB\kernel32.lib
  • WinMain PROTO :DWORD,:DWORD,:DWORD,:DWORD
  • WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
  • .DATA
  • ClassName db "cws_class",0
  • DisplayName db "[--BlackWizzard--]",0
  • Text db "Vous me quittez?",0
  • ButtonClassName db "button",0
  • ButtonText db "[-Quitter-]",0
  • RsrcName db "RANGE",0
  • RsrcType db "RGN",0
  • .DATA?
  • hWnd dd ?
  • hInstance dd ?
  • RsrcHand dd ?
  • RsrcSize dd ?
  • RsrcPoint dd ?
  • hwndButton dd ?
  • .CONST
  • ButtonID equ 1000
  • PictureW equ 500
  • PictureH equ 300
  • .CODE
  • start:
  • invoke GetModuleHandle, NULL
  • mov hInstance, eax
  • invoke WinMain,hInstance,NULL,NULL,SW_SHOWDEFAULT
  • invoke ExitProcess,eax
  • WinMain PROC hInst :DWORD,hPrevInst :DWORD,CmdLine :DWORD,CmdShow :DWORD
  • LOCAL wc :WNDCLASSEX
  • LOCAL msg :MSG
  • mov wc.cbSize,sizeof WNDCLASSEX
  • mov wc.style,CS_HREDRAW or CS_VREDRAW or CS_BYTEALIGNWINDOW
  • mov wc.lpfnWndProc,offset WndProc
  • mov wc.cbClsExtra,NULL
  • mov wc.cbWndExtra,NULL
  • push hInst
  • pop wc.hInstance
  • ; --> LOAD BITMAP FROM EXECUTABLE (RESOURCE)
  • invoke LoadBitmap,hInst,1000
  • ; --> USE THAT BITMAP AS WINDOW BACKGROUND
  • invoke CreatePatternBrush,eax
  • mov wc.hbrBackground,eax
  • mov wc.lpszMenuName,NULL
  • mov wc.lpszClassName,offset ClassName
  • mov wc.hIcon,NULL
  • invoke LoadCursor,NULL,IDC_ARROW
  • mov wc.hCursor,eax
  • mov wc.hIconSm,NULL
  • invoke RegisterClassEx, ADDR wc
  • ; --> CALCULATE THE MIDDLE OF THE SCREEN FOR OUR WINDOW
  • ; 1. get width of the screen
  • ; 2. divide it
  • ; 3. get the width of our BG-Picture
  • ; 4. divide it
  • ; 5. horizontal middle = value of step 2 - value of step 4
  • ; 6. ... do the same with screen/picture height ...
  • invoke GetSystemMetrics,SM_CXSCREEN
  • shr eax,1
  • sub eax,PictureW/2
  • push eax
  • invoke GetSystemMetrics,SM_CYSCREEN
  • shr eax,1
  • sub eax,PictureH/2
  • pop ebx
  • ; --> CREATE OUR WINDOW (WITH POPUP STYLE!)
  • invoke CreateWindowEx,WS_EX_LEFT,ADDR ClassName,ADDR DisplayName,
  • WS_POPUP,ebx,eax,PictureW,PictureH,NULL,NULL,hInst,NULL
  • mov hWnd,eax
  • invoke ShowWindow,eax,SW_SHOWNORMAL
  • invoke UpdateWindow,hWnd
  • _Start:
  • invoke GetMessage,ADDR msg,NULL,0,0
  • test eax, eax
  • jz _Exit
  • invoke TranslateMessage,ADDR msg
  • invoke DispatchMessage,ADDR msg
  • jmp _Start
  • _Exit:
  • mov eax,msg.wParam
  • ret
  • WinMain ENDP
  • WndProc PROC hWin :DWORD,uMsg :DWORD,wParam :DWORD,lParam :DWORD
  • .IF uMsg == WM_CREATE
  • ; --> LOAD REGION_DATA (SEE API REF FOR QUESTIONS)
  • invoke FindResource,hInstance,addr RsrcName,addr RsrcType
  • mov RsrcHand, eax
  • invoke LoadResource,hInstance,eax
  • mov RsrcPoint, eax
  • invoke SizeofResource,hInstance,RsrcHand
  • mov RsrcSize, eax
  • invoke LockResource,RsrcPoint
  • mov RsrcPoint, eax
  • ; --> CREATE REGION AND PASS IT TO OUR WINDOW
  • invoke ExtCreateRegion,NULL,RsrcSize,eax
  • invoke SetWindowRgn,hWin,eax,TRUE
  • ; --> CREATE A SIMPLE BUTTON
  • invoke CreateWindowEx,NULL, ADDR ButtonClassName,ADDR ButtonText,\
  • WS_CHILD or WS_VISIBLE or BS_DEFPUSHBUTTON,\
  • 178,255,100,25,hWin,ButtonID,hInstance,NULL
  • mov hwndButton,eax
  • .ELSEIF uMsg == WM_COMMAND
  • mov eax,wParam
  • .IF ax == ButtonID
  • invoke MessageBox,hWin,addr Text,addr DisplayName,MB_OK
  • invoke SendMessage,hWin,WM_DESTROY,NULL,NULL
  • .ENDIF
  • .ELSEIF uMsg == WM_LBUTTONDOWN
  • ; --> MAKE OUR WINDOW THINK THAT THE USER MOVES THE CAPTION_BAR
  • invoke SendMessage,hWin,WM_NCLBUTTONDOWN,HTCAPTION,lParam
  • .ELSEIF uMsg == WM_DESTROY
  • invoke PostQuitMessage,NULL
  • xor eax,eax
  • ret
  • .ENDIF
  • invoke DefWindowProc,hWin,uMsg,wParam,lParam
  • ret
  • WndProc ENDP
  • END start
.386
.model          flat, stdcall  
option          casemap :none 

include         \MASM32\INCLUDE\windows.inc
include         \MASM32\INCLUDE\gdi32.inc
include         \MASM32\INCLUDE\user32.inc
include         \MASM32\INCLUDE\kernel32.inc

includelib      \MASM32\LIB\gdi32.lib
includelib      \MASM32\LIB\user32.lib
includelib      \MASM32\LIB\kernel32.lib
      
WinMain         PROTO :DWORD,:DWORD,:DWORD,:DWORD
WndProc         PROTO :DWORD,:DWORD,:DWORD,:DWORD
     
.DATA

ClassName       db "cws_class",0
DisplayName     db "[--BlackWizzard--]",0

Text            db "Vous me quittez?",0              

ButtonClassName db "button",0
ButtonText      db "[-Quitter-]",0

RsrcName        db "RANGE",0
RsrcType        db "RGN",0  

.DATA?

hWnd            dd ?
hInstance       dd ?
RsrcHand        dd ?
RsrcSize        dd ?
RsrcPoint       dd ?
hwndButton      dd ?

.CONST

ButtonID        equ 1000
PictureW        equ 500
PictureH        equ 300

.CODE

start:
        invoke  GetModuleHandle, NULL
        mov     hInstance, eax

        invoke  WinMain,hInstance,NULL,NULL,SW_SHOWDEFAULT
        invoke  ExitProcess,eax

WinMain         PROC hInst :DWORD,hPrevInst :DWORD,CmdLine :DWORD,CmdShow :DWORD

                LOCAL   wc   :WNDCLASSEX
                LOCAL   msg  :MSG

        mov     wc.cbSize,sizeof WNDCLASSEX
        mov     wc.style,CS_HREDRAW or CS_VREDRAW or CS_BYTEALIGNWINDOW
        mov     wc.lpfnWndProc,offset WndProc
        mov     wc.cbClsExtra,NULL
        mov     wc.cbWndExtra,NULL      
        push    hInst
        pop     wc.hInstance      
        
; -->   LOAD BITMAP FROM EXECUTABLE (RESOURCE)
        invoke  LoadBitmap,hInst,1000                   
        
; -->   USE THAT BITMAP AS WINDOW BACKGROUND            
        invoke  CreatePatternBrush,eax
        mov     wc.hbrBackground,eax
        
        mov     wc.lpszMenuName,NULL
        mov     wc.lpszClassName,offset ClassName             
        mov     wc.hIcon,NULL
        invoke  LoadCursor,NULL,IDC_ARROW
        mov     wc.hCursor,eax      
        mov     wc.hIconSm,NULL
        
        invoke  RegisterClassEx, ADDR wc

; -->   CALCULATE THE MIDDLE OF THE SCREEN FOR OUR WINDOW
;       1. get width of the screen
;       2. divide it
;       3. get the width of our BG-Picture
;       4. divide it
;       5. horizontal middle = value of step 2 - value of step 4
;       6. ... do the same with screen/picture height ...
        invoke  GetSystemMetrics,SM_CXSCREEN
        shr     eax,1
        sub     eax,PictureW/2
        push    eax

        invoke  GetSystemMetrics,SM_CYSCREEN
        shr     eax,1
        sub     eax,PictureH/2
        pop     ebx

; -->   CREATE OUR WINDOW (WITH POPUP STYLE!)
        invoke  CreateWindowEx,WS_EX_LEFT,ADDR ClassName,ADDR DisplayName,
                WS_POPUP,ebx,eax,PictureW,PictureH,NULL,NULL,hInst,NULL
        mov     hWnd,eax
        
        invoke  ShowWindow,eax,SW_SHOWNORMAL
        invoke  UpdateWindow,hWnd

_Start:
        invoke  GetMessage,ADDR msg,NULL,0,0
        test    eax, eax
        jz      _Exit
        invoke  TranslateMessage,ADDR msg
        invoke  DispatchMessage,ADDR msg
        jmp     _Start
_Exit:

        mov     eax,msg.wParam
        ret

WinMain         ENDP

WndProc         PROC hWin :DWORD,uMsg :DWORD,wParam :DWORD,lParam :DWORD

.IF     uMsg == WM_CREATE

; -->   LOAD REGION_DATA (SEE API REF FOR QUESTIONS)
        invoke  FindResource,hInstance,addr RsrcName,addr RsrcType
        mov     RsrcHand, eax

        invoke  LoadResource,hInstance,eax
        mov     RsrcPoint, eax

        invoke  SizeofResource,hInstance,RsrcHand
        mov     RsrcSize, eax

        invoke  LockResource,RsrcPoint
        mov     RsrcPoint, eax          

; -->   CREATE REGION AND PASS IT TO OUR WINDOW 
        invoke  ExtCreateRegion,NULL,RsrcSize,eax
        invoke  SetWindowRgn,hWin,eax,TRUE

; -->   CREATE A SIMPLE BUTTON
        invoke  CreateWindowEx,NULL, ADDR ButtonClassName,ADDR ButtonText,\
                WS_CHILD or WS_VISIBLE or BS_DEFPUSHBUTTON,\
                178,255,100,25,hWin,ButtonID,hInstance,NULL
        mov     hwndButton,eax

.ELSEIF uMsg == WM_COMMAND   
        mov     eax,wParam

.IF     ax ==   ButtonID
        invoke  MessageBox,hWin,addr Text,addr DisplayName,MB_OK
        invoke  SendMessage,hWin,WM_DESTROY,NULL,NULL

.ENDIF
                                          
.ELSEIF uMsg == WM_LBUTTONDOWN

; -->   MAKE OUR WINDOW THINK THAT THE USER MOVES THE CAPTION_BAR
        invoke  SendMessage,hWin,WM_NCLBUTTONDOWN,HTCAPTION,lParam
        
.ELSEIF uMsg == WM_DESTROY
        invoke  PostQuitMessage,NULL
        xor     eax,eax
        ret

.ENDIF

        invoke  DefWindowProc,hWin,uMsg,wParam,lParam
        ret

WndProc         ENDP

END             start 



 Sources du même auteur

MASM :: SE COPIER AVEC GESTION DES ERREURS
MASM :: GETMODULEFILENAMEA :: RECUPERER LE NOM DE L'EXECUTAB...
[CODE 04] RECUPERER LE CARACTÉRE TAPÉ ET LES COORDONNÉES DE ...
[CODE 03] LES EVENEMENTS D'UNE FENETRE. [MASM32]
[CODE 02] DEPLACER UNE FENETRE SANS LA BORDURE [MASM32]

 Sources de la même categorie

Source avec une capture DESSIN DE RECTANGLES (POSITION, TAILLE, COULEUR, ÉPAISSEUR) par macsou01
RECHERCHE DES PALINDROMES D'UN TEXTE SAISI. par PCBill
Source avec Zip LIBRAIRIE GRAPHIQUE (ET PLUS) EN MODE RÉEL par epineurien
Source avec Zip Source avec une capture LIB PROGRESSBAR (PERSONNALISABLE , DÉGRADÉ DE COULEUR,POURCE... par knetus
Source avec Zip Source avec une capture AFFICHE COULEUR par knetus

Commentaires et avis

Commentaire de jeremyM le 29/06/2002 12:30:21

j'ai pas testé le code mais a en voire la capture ca a l'air super, c vraiment zouli...
un petit 8/10 à celui qu'à fait le code, tu lui transmettera.. :-)

Commentaire de Xs le 30/06/2002 00:31:49

ouais cool !

dommage que ca reste u niveau de la capture : le zip est corrompue !

Commentaire de ManChesTer le 08/07/2002 02:52:13 administrateur CS

L'archive est inutilisable, domage. met le a jour svp.

Commentaire de Cendra le 30/12/2002 15:29:55

meme probleme que ManChesTer, le zip marche pas,
et peut tu donner le nom du programme pour les RNG stp :)

Commentaire de theXman le 07/06/2003 11:07:39

bien c00l! jvoulais faire des trucs comme ca... allez hop, une HeineKen, un bedo, et go to prog! ;)
thX à toi l'ami

Commentaire de statismeles le 27/05/2005 12:59:24

zip toujours invalide :-(

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,811 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales