Accueil > > > DIALOG ( FENETRE DE LOG RICHEDIT )
DIALOG ( FENETRE DE LOG RICHEDIT )
Information sur la source
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
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
[MSTD10] SHAREPOINT 2010 ET TEAM FOUNDATION SERVER[MSTD10] SHAREPOINT 2010 ET TEAM FOUNDATION SERVER par phil
Un post rapide pour vous informer de la disponibilité de la vidéo de ma présentation sur SharePoint 2010 & Team Foundation Server. http://www.microsoft.com/france/vision/mstechdays10/Webcast.aspx?EID=20215d48-02e3-4d43-8c36-e53505c3b316 Dans la ...
Cliquez pour lire la suite de l'article par phil [MSTD10] SQL SERVER 2008 POUR LES DéVELOPPEURS ET VISUAL STUDIO TEAM SYSTEM DATABASE EDITION[MSTD10] SQL SERVER 2008 POUR LES DéVELOPPEURS ET VISUAL STUDIO TEAM SYSTEM DATABASE EDITION par Miiitch
Lors de cette session que j'ai animé avec Rui , j'ai eu l'occasion de présenter, en plus des nouveautés de SQL Server 2008, comment utiliser l'édition "database" de Visual Studio 2008. Le principe? Avoir les mêmes outils lors que l'on travaille avec une b...
Cliquez pour lire la suite de l'article par Miiitch [WF4] LOCALISER SIMPLEMENT UNE ACTIVITé ET SON DESIGNER WPF[WF4] LOCALISER SIMPLEMENT UNE ACTIVITé ET SON DESIGNER WPF par JeremyJeanson
La localisation . vous connaissez ce system miraculeux qui permet à votre application de s'afficher dans la langue de l'utilisateur (à condition de l'avoir intégrée dans votre programme). Comment mettre en place la localisation dans WF4? Cette question m'...
Cliquez pour lire la suite de l'article par JeremyJeanson [TECHDAYS 2010] WEBCASTS ET SLIDES[TECHDAYS 2010] WEBCASTS ET SLIDES par Audrey
Les webcasts des sessions des Techdays 2010 sont maintenant disponibles en ligne ! Me concernant, voici les slides et le webcast de la session Blend 3 / Skechtflow : Dessinez c'est gagné ! (animée avec Michel Perfetti ) Les slides et le webcast : Blend 3/...
Cliquez pour lire la suite de l'article par Audrey NDEPEND V3. J'ADORE SON INTéGRATION AVEC VS2010NDEPEND V3. J'ADORE SON INTéGRATION AVEC VS2010 par tja
Après une petite introduction à son utilisation que vous pouvez lire ici j'ai également eu envie d'installer ma copie et de jouer un peu avec. Après les premières minutes de son utilisation. J'ai tout de suite ADORE. L'utilisation intuitive sans besoi...
Cliquez pour lire la suite de l'article par tja
Logiciels
Rigs of Rods (63.3)RIGS OF RODS (63.3)c'est un jeu de multi-simulation camions,autobus voitures, avions, bateaux, hélicoptère avec défo... Cliquez pour télécharger Rigs of Rods Konvertor (4.00)KONVERTOR (4.00)Le logiciel est un gestionnaire multimedia affichant, jouant et convertissant plus de 2000 format... Cliquez pour télécharger Konvertor Xlite (v 3.0 build 41150)XLITE (V 3.0 BUILD 41150)c'est un logiciel qui permet de téléphoner par Internet à l'aide d'un compte SIP pratique pour le... Cliquez pour télécharger Xlite Academy System (10.9.3.0)ACADEMY SYSTEM (10.9.3.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|