Accueil > > > SPLASH SCREEN
SPLASH SCREEN
Information sur la source
Description
exemple simple pour ajouter un splash screen à vos application
Source
- .386
- .model flat,stdcall
- option casemap:none
-
- include c:\masm32\include\windows.inc
- include c:\masm32\include\kernel32.inc
- include c:\masm32\include\user32.inc
- include c:\masm32\include\gdi32.inc
-
- includelib c:\masm32\lib\kernel32.lib
- includelib c:\masm32\lib\user32.lib
- includelib c:\masm32\lib\gdi32.lib
-
- .CODE
- include splash.hex
- PROGRAMME:
- ;////////////////////////////////
- ;----------- CREE THREAD -------
- ;////////////////////////////////
- push 0
- push 0
- push 0
- push offset WINSPLASH
- push 0
- push 0
- call CreateThread
-
- ;////////////////////////////////////////////
- ;---------- FENETRE PRINCIPAL ---------------
- ;////////////////////////////////////////////
-
- push 200h
- push GPTR
- call GlobalAlloc
- push eax ;arg GlobalFree
- mov dword ptr [eax],WS_CAPTION or WS_SYSMENU or DS_CENTER
- mov word ptr [eax+14],290
- mov word ptr [eax+16],100
- push 0
- push offset DialogProc
- push 0
- push eax
- push 400000h ;hinst
- call DialogBoxIndirectParam
- call GlobalFree
- push 0
- call ExitProcess
-
- ;//////////////////////////////////////////////////
- ;----------- PROC FENETRE PRINCIPAL --------------
- ;//////////////////////////////////////////////////
- DialogProc proc
- mov eax,[esp+8]
- cmp eax,WM_CLOSE
- je WMCLOSE
- jmp DLG
- WMCLOSE: push 0
- push [esp+8]
- call EndDialog
- DLG: xor eax,eax
- ret 16
- DialogProc endp
- ;///////////////////////////////////////////
- ;------------- FENETRE SPLASH --------------
- ;///////////////////////////////////////////
- WINSPLASH proc
- push 512
- push GPTR
- call GlobalAlloc
- push eax ;arg GlobalFree
- mov dword ptr [eax],WS_POPUP or DS_CENTER
- mov dword ptr [eax+4],WS_EX_TOPMOST or WS_EX_TOOLWINDOW
- mov word ptr [eax+14],160
- mov word ptr [eax+16],120
- push 0
- push offset DlgSplashProc
- push 0
- push eax
- push 400000h ;hinst
- call DialogBoxIndirectParam
- call GlobalFree
- ret
- WINSPLASH endp
- ;///////////////////////////////////////
- ;--------- PROC FENETRE SPLASH --------
- ;///////////////////////////////////////
-
- DlgSplashProc proc
-
- mov eax,[esp+8]
- cmp eax,WM_ACTIVATEAPP
- je WMACTIVAPP
- cmp eax,WM_CLOSE
- je WMCLOSE
-
- push [esp+4]
- call GetDC
- mov edi,eax
-
- lea esi,image
- mov eax,esi
- add eax,14
- mov edx,esi
- add edx,[esi+10]
-
- push 00CC0020h ;copy
- push 0 ;DIB_RGB_COLORS=0
- push eax;bmp_header
- push edx;bmp_pixels
- push [esi+22] ;bmp height DIB source
- push [esi+18] ;bmp width DIB source
- push 0 ;y of source rectangle
- push 0 ;x of source rectangle
- push 240 ;bmp height rect destination
- push 320 ;bmp width rect destination
- push 0 ;y of destination rectangle
- push 0 ;x of destination rectangle
- push edi ;DC of da window
- call StretchDIBits
- jmp DLG
- WMACTIVAPP: push 0
- push 0
- push [esp+12]
- push offset TIMER
- push 0
- push 0
- call CreateThread
- jmp DLG
- WMCLOSE: push 0
- push [esp+8]
- call EndDialog
- DLG: xor eax,eax
- ret 16
-
- DlgSplashProc endp
- ;/////////////////////////////////
- ;-------------- TIMER ------------
- ;/////////////////////////////////
- TIMER proc
-
- push 5000
- call Sleep
- push 0
- push 0
- push WM_CLOSE
- push [esp+16]
- call SendMessage
- ret 4
-
- TIMER endp
- end PROGRAMME
.386
.model flat,stdcall
option casemap:none
include c:\masm32\include\windows.inc
include c:\masm32\include\kernel32.inc
include c:\masm32\include\user32.inc
include c:\masm32\include\gdi32.inc
includelib c:\masm32\lib\kernel32.lib
includelib c:\masm32\lib\user32.lib
includelib c:\masm32\lib\gdi32.lib
.CODE
include splash.hex
PROGRAMME:
;////////////////////////////////
;----------- CREE THREAD -------
;////////////////////////////////
push 0
push 0
push 0
push offset WINSPLASH
push 0
push 0
call CreateThread
;////////////////////////////////////////////
;---------- FENETRE PRINCIPAL ---------------
;////////////////////////////////////////////
push 200h
push GPTR
call GlobalAlloc
push eax ;arg GlobalFree
mov dword ptr [eax],WS_CAPTION or WS_SYSMENU or DS_CENTER
mov word ptr [eax+14],290
mov word ptr [eax+16],100
push 0
push offset DialogProc
push 0
push eax
push 400000h ;hinst
call DialogBoxIndirectParam
call GlobalFree
push 0
call ExitProcess
;//////////////////////////////////////////////////
;----------- PROC FENETRE PRINCIPAL --------------
;//////////////////////////////////////////////////
DialogProc proc
mov eax,[esp+8]
cmp eax,WM_CLOSE
je WMCLOSE
jmp DLG
WMCLOSE: push 0
push [esp+8]
call EndDialog
DLG: xor eax,eax
ret 16
DialogProc endp
;///////////////////////////////////////////
;------------- FENETRE SPLASH --------------
;///////////////////////////////////////////
WINSPLASH proc
push 512
push GPTR
call GlobalAlloc
push eax ;arg GlobalFree
mov dword ptr [eax],WS_POPUP or DS_CENTER
mov dword ptr [eax+4],WS_EX_TOPMOST or WS_EX_TOOLWINDOW
mov word ptr [eax+14],160
mov word ptr [eax+16],120
push 0
push offset DlgSplashProc
push 0
push eax
push 400000h ;hinst
call DialogBoxIndirectParam
call GlobalFree
ret
WINSPLASH endp
;///////////////////////////////////////
;--------- PROC FENETRE SPLASH --------
;///////////////////////////////////////
DlgSplashProc proc
mov eax,[esp+8]
cmp eax,WM_ACTIVATEAPP
je WMACTIVAPP
cmp eax,WM_CLOSE
je WMCLOSE
push [esp+4]
call GetDC
mov edi,eax
lea esi,image
mov eax,esi
add eax,14
mov edx,esi
add edx,[esi+10]
push 00CC0020h ;copy
push 0 ;DIB_RGB_COLORS=0
push eax;bmp_header
push edx;bmp_pixels
push [esi+22] ;bmp height DIB source
push [esi+18] ;bmp width DIB source
push 0 ;y of source rectangle
push 0 ;x of source rectangle
push 240 ;bmp height rect destination
push 320 ;bmp width rect destination
push 0 ;y of destination rectangle
push 0 ;x of destination rectangle
push edi ;DC of da window
call StretchDIBits
jmp DLG
WMACTIVAPP: push 0
push 0
push [esp+12]
push offset TIMER
push 0
push 0
call CreateThread
jmp DLG
WMCLOSE: push 0
push [esp+8]
call EndDialog
DLG: xor eax,eax
ret 16
DlgSplashProc endp
;/////////////////////////////////
;-------------- TIMER ------------
;/////////////////////////////////
TIMER proc
push 5000
call Sleep
push 0
push 0
push WM_CLOSE
push [esp+16]
call SendMessage
ret 4
TIMER endp
end PROGRAMME
Conclusion
Très simple on cree un thread qui cree la fenetre splash et dans sa proc on cree un thread qui sert de timer propre simple efficace comparer avec l'example dans masm.
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
IMAGINE CUP 2012, MAKE A SIGN EN FINALEIMAGINE CUP 2012, MAKE A SIGN EN FINALE par junarnoalg
Voilà qui est fait, la nouvelle est officielle ! L'équipe belge "Make a Sign" va au pays des kangourous défendre son projet dans la catégorie Software Design. http://www.imaginecup.com/CompetitionsContent/Competition/WorldwideFinalists.aspx V...
Cliquez pour lire la suite de l'article par junarnoalg KINECT 1.5 IS OUT !KINECT 1.5 IS OUT ! par Vko
La version 1.5 du Kinect For Microsoft vient tout juste de sortir ! Plein de nouveautés: Tracking de squelette en Near Mode Détection en position assise Détection faciale avec un SDK dédié Documentation et des guideline (enfin) Un out...
Cliquez pour lire la suite de l'article par Vko LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) LES ACTUALITéS DE LA SEMAINE SUR C2I.FR (14 MAI - 20 MAI) par richardc
Mise à jour des Web API du 14 Mai
Réservez dès maintenant votre journée du 20 juin pour le Windows Azure Dev Camp 2012 à Paris
Mise à jour de Team Foundation Service
MechCommander 2 sur Windows 8
Entity Framework 5 Release Candidate e...
Cliquez pour lire la suite de l'article par richardc REACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITERREACTIVE EXTENSIONS : CONSOMMER DES SERVICES AVEC RX PARTIE 3, LES PIèGES à éVITER par Groc
Une mauvaise utilisation de rx lors de l'écriture d'une couche d'accès à des services peut conduire à des cas embarassants avec des erreurs mal gérées, des appels qui ne partent lorsqu'ils le devraient, et même des résultats incorrects . le tout nuis...
Cliquez pour lire la suite de l'article par Groc SHAREPOINT BLOG SITE, PROBLèME D'ARCHIVESSHAREPOINT BLOG SITE, PROBLèME D'ARCHIVES par junarnoalg
Dernièrement, nous avons migré le site
myTIC
vers un nouveau serveur SharePoint 2010. Dans les contenus que nous vouloins récupérer, nous avions un certain nombre de blogs.
Nous avons utilisé les commandes Power...
Cliquez pour lire la suite de l'article par junarnoalg
Logiciels
974 Application Server (12.2.4.0)974 APPLICATION SERVER (12.2.4.0)Développez de puissantes applications dans un environnement de 'cloud computing', clusterisé, séc... Cliquez pour télécharger 974 Application Server vPicture (1.4.2.1)VPICTURE (1.4.2.1)Avec vPicture, hébergez vos images facilement et rapidement.
vPicture est un utilitaire simple, ... Cliquez pour télécharger vPicture Easy-Planning (2.2.1.6)EASY-PLANNING (2.2.1.6)Easy-Planning permet de créer des plannings sous la représentation de diagrammes et est adapté au... Cliquez pour télécharger Easy-Planning COM-BACKUP (2.0)COM-BACKUP (2.0)
COM-BACKUP est un logiciel de sauvegarde qui permet de planifier les sauvegardes de vos dossiers ...
Cliquez pour télécharger COM-BACKUP mySongBook Player (1.0.0)MYSONGBOOK PLAYER (1.0.0)mySongBook Player est un logiciel gratuit permettant l'accès à une archive de tablatures/partitio... Cliquez pour télécharger mySongBook Player
|