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
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
RE : PIC 16F84RE : PIC 16F84 par pont
Cliquez pour lire la suite par pont RE : PIC 16F84RE : PIC 16F84 par belounis
Cliquez pour lire la suite par belounis RE : PIC 16F84RE : PIC 16F84 par pont
Cliquez pour lire la suite par pont
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|