Accueil > > > FENETRE IRREGULIERE COOL POUR LES SPLASH OU INTRO! [MASM32]
FENETRE IRREGULIERE COOL POUR LES SPLASH OU INTRO! [MASM32]
Information sur la source
Description
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 de la même categorie
Commentaires et avis
|
Derniers Blogs
CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT)CSS CONTENT STATE SELECTORS (PERSONNAL DRAFT) par FREMYCOMPANY
Bonjour à tous, Je viens de publier une proposition comprenant 5 pseudo-classes pour le CSS Working Group ayant trait à l'état de chargement d'un élément (ex: IMG,VIDEO,AUDIO,OBJECT pour l'HTML.). Si le c½ur vous en dit, vous pouvez retrouver cette p...
Cliquez pour lire la suite de l'article par FREMYCOMPANY MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ?MBA : POURQUOI FAIRE ET COMMENT LE CHOISIR ? par ROMELARD Fabrice
Formation initiale Durant la formation, le découpage classique est le suivant (je donnerai les équivalences Suisse lorsque je les connaîtrais) : Ecole primaire jusqu'au Collège : Formation générale permettant d'obtenir les méthodes...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice Y'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENTY'A DES ERREURS QUI PEUVENT RENDRE LE DéVELOPPEUR VIOLENT par Aleks
Quand on a ce genre d'erreur sans log :
Et bas on a juste envie de choper le gas de Microsoft qu'a développé ça et lui foutre des baffes de Coboye ! ...
Cliquez pour lire la suite de l'article par Aleks [HYPER-V 3] PRéSENTATION DES COMMANDLETS POWERSHELL[HYPER-V 3] PRéSENTATION DES COMMANDLETS POWERSHELL par Pierrick CATRO-BROUILLET
Avec la sortie prochaine de la Beta Consumer Preview de Windows 8, j'avais envie de revenir sur une des fonctionnalités que j'attends le plus et que, en bon geek que je suis, j'utilise déjà : Hyper-V 3 ainsi son module PowerShell.
Il y a déjà pléthor...
Cliquez pour lire la suite de l'article par Pierrick CATRO-BROUILLET IIS7 - COMPRESSION GZIPIIS7 - COMPRESSION GZIP par cyril
La compression GZIP permet d'améliorer les performances de navigation en compressant ce qu'envoie le serveur à un client. Pour comprendre comment cela fonctionne, regardons ce qu'il se passe au niveau HTTP lorsqu'un client tente d'accéder à une ress...
Cliquez pour lire la suite de l'article par cyril
Logiciels
Easy-Planning (1.0.0.1)EASY-PLANNING (1.0.0.1)Basé sur les mêmes principes que MyPlanning, Easy-Planning permet de créer des plannings sous la ... Cliquez pour télécharger Easy-Planning Academy System (17.1.3.0)ACADEMY SYSTEM (17.1.3.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System COLLECTOR PLUS (3.00B)COLLECTOR PLUS (3.00B)COLLECTOR PLUS version 3.00B est un logiciel utilisant une base de données alimentée par :
- L... Cliquez pour télécharger COLLECTOR PLUS PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V7.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO LettresFaciles 2011 (8.0.0.1)LETTRESFACILES 2011 (8.0.0.1)LettresFaciles est un logiciel facilitant la création et la rédaction de lettres types.
Son inte... Cliquez pour télécharger LettresFaciles 2011
|