begin process at 2010 03 11 19:49:51
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Applications Windows

 > DIALOG ( FENETRE DE LOG RICHEDIT )

DIALOG ( FENETRE DE LOG RICHEDIT )


 Description

Ce code fait la gestion d'une fenetre de log
a inclure directement dans un fichier Source
2 fonctions:
logCreate(HANDLE hwParent) ; cree la boite de dialog
logAll(PSTR pString) ; envoie la chaine zero terminal dans le RichEdit

Source

  • ; a inclure dans votre source asm
  • ; logCreate(HANDLE hwParent) ; cree le dialog
  • ; logAll(PSTR string) ; envoi la chaine string a la fenetre de log
  • @ EQU OFFSET
  • IDC_RICHEDIT1 EQU 2001
  • logCreate PROTO :DWORD
  • logAll PROTO :DWORD
  • ; ne pas utiliser en fenetre principale
  • ;*******************************************************************.data
  • ;******************************************************************* azREdit db "RichEd20.dll",0
  • dlg01 db "LOGVIEW",0
  • ;*******************************************************************.data?
  • ;******************************************************************* hRLib dd ?
  • hwLog dd ?
  • ;*******************************************************************.code
  • ;*******************************************************************; PUBLIC
  • logCreate PROC hwParent:DWORD
  • invoke LoadLibrary,@ azREdit
  • and eax,eax
  • mov hRLib,eax
  • stc
  • je @F
  • invoke CreateDialogParam,hInstance,@ dlg01,hwParent,@ wpLog,0
  • clc
  • @@:
  • ret
  • logCreate ENDP
  • ;*******************************************************************
  • logAll PROC USES EBX pStr:DWORD
  • ;
  • ; log send to screen
  • ;
  • invoke GetDlgItem,hwLog,IDC_RICHEDIT1
  • mov ebx,eax
  • push -1
  • push -1
  • invoke SendMessage,ebx,EM_EXSETSEL,0,esp
  • invoke SendMessage,ebx,EM_REPLACESEL,FALSE,pStr
  • invoke SendMessage,ebx,EM_SCROLLCARET,0,0
  • invoke UpdateWindow,ebx
  • add esp,2*4
  • ret
  • logAll ENDP
  • ;*******************************************************************; PRIVATE
  • wpLog PROC hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
  • mov ecx,uMsg
  • cmp ecx,WM_INITDIALOG
  • je do_INITDIALOG
  • cmp ecx,WM_CLOSE
  • je do_CLOSE
  • do_DEFAULT:
  • xor eax,eax
  • ret
  • do_INITDIALOG:
  • push hWin
  • pop hwLog
  • push ebx
  • invoke GetDlgItem,hWin,IDC_RICHEDIT1
  • mov ebx,eax
  • push -1
  • push 0
  • invoke SendMessage,ebx,EM_EXSETSEL,0,esp
  • invoke SendMessage,ebx,EM_REPLACESEL,FALSE,esp
  • invoke SendMessage,ebx,EM_SCROLLCARET,0,0
  • add esp,2*4
  • xor eax,eax
  • pop ebx
  • ret
  • do_CLOSE:
  • invoke FreeLibrary,hRLib
  • xor eax,eax
  • ret
  • wpLog ENDP
  • ;*******************************************************************
  • ;FICHIER RESSOURCE
  • ;*******************************************************************
  • ; dans le fichier ressource copier/coller
  • #include "\inc\resource.h"
  • #define IDC_STATIC -1
  • //#define LOGVIEW 2000
  • #define IDC_RICHEDIT1 2001
  • LOGVIEW DIALOG DISCARDABLE 200, 0, 500, 250
  • STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
  • CAPTION "Log"
  • FONT 8, "MS Sans Serif"
  • BEGIN
  • CONTROL "",IDC_RICHEDIT1,"RichEdit20A",ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL | WS_BORDER | WS_TABSTOP | WS_VSCROLL,1,1,498,248
  • END
;	a inclure dans votre source asm
;	logCreate(HANDLE hwParent) ; cree le dialog
;	logAll(PSTR string) ; envoi la chaine string a la fenetre de log

@ EQU OFFSET
IDC_RICHEDIT1	EQU	2001

logCreate	PROTO	:DWORD
logAll	PROTO	:DWORD

; ne pas utiliser en fenetre principale

;*******************************************************************.data
;*******************************************************************	azREdit	db	"RichEd20.dll",0
	dlg01	db	"LOGVIEW",0

;*******************************************************************.data?
;*******************************************************************	hRLib		dd	?
	hwLog		dd	?

;*******************************************************************.code
;*******************************************************************; PUBLIC

logCreate	PROC	hwParent:DWORD
	invoke	LoadLibrary,@ azREdit
	and		eax,eax
	mov		hRLib,eax
	stc
	je		@F
	invoke	CreateDialogParam,hInstance,@ dlg01,hwParent,@ wpLog,0
	clc
@@:
	ret
logCreate	ENDP

;*******************************************************************
logAll	PROC USES EBX pStr:DWORD

	;
	;	log send to screen
	;

	invoke	GetDlgItem,hwLog,IDC_RICHEDIT1
	mov		ebx,eax
	push	-1
	push	-1
	invoke	SendMessage,ebx,EM_EXSETSEL,0,esp
	invoke	SendMessage,ebx,EM_REPLACESEL,FALSE,pStr
	invoke	SendMessage,ebx,EM_SCROLLCARET,0,0
	invoke	UpdateWindow,ebx
	add		esp,2*4

	ret
logAll	ENDP

;*******************************************************************; PRIVATE

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

	mov		ecx,uMsg

	cmp		ecx,WM_INITDIALOG
	je		do_INITDIALOG
	cmp		ecx,WM_CLOSE
	je		do_CLOSE

do_DEFAULT:
	xor		eax,eax
	ret

do_INITDIALOG:
	push	hWin
	pop		hwLog
	push	ebx

	invoke	GetDlgItem,hWin,IDC_RICHEDIT1
	mov		ebx,eax
	push	-1
	push	0
	invoke	SendMessage,ebx,EM_EXSETSEL,0,esp
	invoke	SendMessage,ebx,EM_REPLACESEL,FALSE,esp
	invoke	SendMessage,ebx,EM_SCROLLCARET,0,0
	add		esp,2*4

	xor		eax,eax
	pop		ebx
	ret

do_CLOSE:
	invoke	FreeLibrary,hRLib
	xor		eax,eax
	ret

wpLog	ENDP

;*******************************************************************
;FICHIER RESSOURCE
;*******************************************************************
;	dans le fichier ressource copier/coller

#include "\inc\resource.h"

#define IDC_STATIC	-1

//#define LOGVIEW		2000
#define IDC_RICHEDIT1	2001

LOGVIEW DIALOG DISCARDABLE  200, 0, 500, 250
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
CAPTION "Log"
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "",IDC_RICHEDIT1,"RichEdit20A",ES_MULTILINE | ES_AUTOHSCROLL | ES_AUTOVSCROLL | WS_BORDER | WS_TABSTOP | WS_VSCROLL,1,1,498,248
END

 Conclusion

si quelqu'un sait comment mettre a jour l'ascenseur du RichEdit meme si la boite n'as pas le focus. -> patatalo


 Sources du même auteur

Source avec Zip SCHEDULEUR TEST
Source avec Zip Source avec une capture LIVE CD OMF
Source avec Zip V86 HOOK BIOS/DOS
Source avec Zip TORITO LOADER & ISOEMUL
Source avec Zip HIDEVCD OU ANTI-BLAXX LIKE

 Sources de la même categorie

Source avec Zip Source avec une capture BASE DE REGISTRE ET TRANSFERE DE BMP DANS SYSTEM32 par vincent2795
Source avec Zip RÉSOUDRE LES PROBLÈMES DE VERSIONS DU SYSTÈME OU DE DLL par ToutEnMasm
Source avec Zip DEXPLORE INTERFACE HELP2 MICROSOFT DOCUMENT EXPLORER par ToutEnMasm
Source avec Zip DEXPLORE INTERFACE HELP2 MICROSOFT DOCUMENT EXPLORER par ToutEnMasm
Source avec Zip Source avec une capture ANALYSEUR DE TRAFIC (WINPCAP) par ORdream

Commentaires et avis

Commentaire de ToutEnMasm le 09/06/2004 16:39:01

salut,
je ne vois pas ce qu'est l'ascenseur de la richedit mais je vois tres bien comment me servir de la richedit.C'est dans le source d'editmasm,entre autres choses,avec des commentaires ,voir mon site.
                                ToutEnmasm

Commentaire de Kirua le 10/06/2004 15:49:46

l'ascenseur c'est la "barre de scroll", le "machin" qui te permet de faire défiler le contenu de la boîte de haut en bas et, parfois, de gauche à droite quand ça dépasse.

 Ajouter un commentaire




Nos sponsors


Appels d'offres

Sondage...

Comparez les prix

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

 
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,796 sec (3)

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