|
Trouver une ressource
Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !
SCV HTML EDITOR 1.0
Information sur la source
Description
C'est un éditeur HTML Graphique. Des idées ou les bugs éventuels seraient les bienvenus !!! Le code du dessous c'est le prompt
Source
- /********* PROMPT ****************/
- LRESULT CALLBACK WindowProcedure2 (HWND, UINT, WPARAM, LPARAM);
- char result[5000+1];
- HWND hwndpa;HWND pvalider;HWND pedit; HWND ptext;
- bool creer=0;HWND hwnd2;
- int prompt(HWND hwndp,char titre[],char description[],char defaut[]="")
- {
- result[0]='\0';
- hwndpa=hwndp; MSG messages;
- if (!creer){WNDCLASSEX wincl;char sClassName[] = "prompt";
- wincl.hInstance = NULL;wincl.lpszClassName = sClassName;
- wincl.lpfnWndProc = WindowProcedure2;wincl.style = CS_DBLCLKS;
- wincl.cbSize = sizeof (WNDCLASSEX);wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
- wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
- wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
- wincl.lpszMenuName = NULL;wincl.cbClsExtra = 0;wincl.cbWndExtra = 0;
- wincl.hbrBackground = reinterpret_cast<HBRUSH>(16);
- if (!RegisterClassEx (&wincl)){ return 0;}
- hwnd2 = CreateWindowEx (0,sClassName,titre,WS_SIZEBOX,0,0,450,200,HWND_DESKTOP,
- NULL,NULL,NULL);
- if (hwnd2 == NULL){MessageBox(NULL, "Erreur CODE P0.", "Erreur", MB_OK);return 0;}
- ShowWindow (hwnd2, SW_SHOW);ShowWindow (hwndp, SW_HIDE);
- /***/
- #define ID_PTEXT 100
- ptext = CreateWindowEx(0, "STATIC", "", WS_VISIBLE|WS_CHILD|BS_TEXT,
- 10, 10, 410, 40, hwnd2, (HMENU)ID_PTEXT, NULL, NULL);
- if (ptext == NULL){MessageBox(hwnd2, "Erreur CODE P1.", "Erreur", MB_OK);return 0;}
- SetWindowText(ptext,description);
- #define ID_PEDIT 101
- pedit = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL,
- 10, 60, 410, 25, hwnd2, (HMENU)ID_PEDIT, NULL, NULL);
- if (pedit == NULL){MessageBox(hwnd2, "Erreur CODE P2.", "Erreur", MB_OK);return 0;}
- SetWindowText(pedit,defaut);
- #define ID_PVALIDER 102
- pvalider = CreateWindowEx(0, "BUTTON", "", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_NOTIFY|BS_TEXT,
- 10, 100, 410 , 40, hwnd2, (HMENU)ID_PVALIDER, NULL, NULL);
- if (pvalider == NULL){MessageBox(hwnd2, "Erreur CODE P3.", "Erreur", MB_OK);return 0;}
- SetWindowText(pvalider,"Valider");
- creer=1;
- SetFocus(pedit);
- /***/
- }
- else {
- ShowWindow (hwnd2, SW_SHOW);ShowWindow (hwndp, SW_HIDE);
- /***/
- SetWindowText(hwnd2,titre);
- SetWindowText(ptext,description);
- SetWindowText(pedit,defaut);
- SetWindowText(pvalider,"Valider");
- SetFocus(pedit);
- /***/
- }
- result[0]='\0';
- while (GetMessage (&messages, NULL, 0, 0)){
- TranslateMessage(&messages);DispatchMessage(&messages);}return messages.wParam;
- }
- LRESULT CALLBACK WindowProcedure2 (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch (message) /* handle the messages */
- {
- case WM_COMMAND:
- if ((LOWORD(wParam) == ID_PVALIDER) && (HIWORD(wParam) == BN_CLICKED))
- {
- result[0]='\0';
- GetDlgItemText(hwnd,ID_PEDIT,result,5001);
- ShowWindow(hwnd,SW_HIDE);PostQuitMessage(0);ShowWindow(hwndpa,SW_SHOW);
- }
-
- break;
- case WM_DESTROY : MessageBox(hwnd,"Vous devez d\'abord valider avant de quitter","Erreur",MB_OK|MB_ICONERROR);break;
- case WM_CLOSE : MessageBox(hwnd,"Vous devez d\'abord valider avant de quitter","Erreur",MB_OK|MB_ICONERROR);break;
-
- default: /* for messages that we don't deal with */
- return DefWindowProc (hwnd, message, wParam, lParam);
- }
-
- return 0;
- }
- /********* FIN DU PROMPT ******************/
/********* PROMPT ****************/
LRESULT CALLBACK WindowProcedure2 (HWND, UINT, WPARAM, LPARAM);
char result[5000+1];
HWND hwndpa;HWND pvalider;HWND pedit; HWND ptext;
bool creer=0;HWND hwnd2;
int prompt(HWND hwndp,char titre[],char description[],char defaut[]="")
{
result[0]='\0';
hwndpa=hwndp; MSG messages;
if (!creer){WNDCLASSEX wincl;char sClassName[] = "prompt";
wincl.hInstance = NULL;wincl.lpszClassName = sClassName;
wincl.lpfnWndProc = WindowProcedure2;wincl.style = CS_DBLCLKS;
wincl.cbSize = sizeof (WNDCLASSEX);wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;wincl.cbClsExtra = 0;wincl.cbWndExtra = 0;
wincl.hbrBackground = reinterpret_cast<HBRUSH>(16);
if (!RegisterClassEx (&wincl)){ return 0;}
hwnd2 = CreateWindowEx (0,sClassName,titre,WS_SIZEBOX,0,0,450,200,HWND_DESKTOP,
NULL,NULL,NULL);
if (hwnd2 == NULL){MessageBox(NULL, "Erreur CODE P0.", "Erreur", MB_OK);return 0;}
ShowWindow (hwnd2, SW_SHOW);ShowWindow (hwndp, SW_HIDE);
/***/
#define ID_PTEXT 100
ptext = CreateWindowEx(0, "STATIC", "", WS_VISIBLE|WS_CHILD|BS_TEXT,
10, 10, 410, 40, hwnd2, (HMENU)ID_PTEXT, NULL, NULL);
if (ptext == NULL){MessageBox(hwnd2, "Erreur CODE P1.", "Erreur", MB_OK);return 0;}
SetWindowText(ptext,description);
#define ID_PEDIT 101
pedit = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, "EDIT", "", WS_VISIBLE|WS_CHILD|ES_AUTOHSCROLL|ES_NOHIDESEL,
10, 60, 410, 25, hwnd2, (HMENU)ID_PEDIT, NULL, NULL);
if (pedit == NULL){MessageBox(hwnd2, "Erreur CODE P2.", "Erreur", MB_OK);return 0;}
SetWindowText(pedit,defaut);
#define ID_PVALIDER 102
pvalider = CreateWindowEx(0, "BUTTON", "", WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON|BS_NOTIFY|BS_TEXT,
10, 100, 410 , 40, hwnd2, (HMENU)ID_PVALIDER, NULL, NULL);
if (pvalider == NULL){MessageBox(hwnd2, "Erreur CODE P3.", "Erreur", MB_OK);return 0;}
SetWindowText(pvalider,"Valider");
creer=1;
SetFocus(pedit);
/***/
}
else {
ShowWindow (hwnd2, SW_SHOW);ShowWindow (hwndp, SW_HIDE);
/***/
SetWindowText(hwnd2,titre);
SetWindowText(ptext,description);
SetWindowText(pedit,defaut);
SetWindowText(pvalider,"Valider");
SetFocus(pedit);
/***/
}
result[0]='\0';
while (GetMessage (&messages, NULL, 0, 0)){
TranslateMessage(&messages);DispatchMessage(&messages);}return messages.wParam;
}
LRESULT CALLBACK WindowProcedure2 (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) /* handle the messages */
{
case WM_COMMAND:
if ((LOWORD(wParam) == ID_PVALIDER) && (HIWORD(wParam) == BN_CLICKED))
{
result[0]='\0';
GetDlgItemText(hwnd,ID_PEDIT,result,5001);
ShowWindow(hwnd,SW_HIDE);PostQuitMessage(0);ShowWindow(hwndpa,SW_SHOW);
}
break;
case WM_DESTROY : MessageBox(hwnd,"Vous devez d\'abord valider avant de quitter","Erreur",MB_OK|MB_ICONERROR);break;
case WM_CLOSE : MessageBox(hwnd,"Vous devez d\'abord valider avant de quitter","Erreur",MB_OK|MB_ICONERROR);break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}
return 0;
}
/********* FIN DU PROMPT ******************/
Conclusion
Il n'est pas fini mais il est assez beau ! Désolé pour ceux qui n'ont pas WinRAR mais j'ai été obligé de compresser avec WinRAR avant WinZip vu que ça prends trop de place mais en téléchargeant le freeware QuickZip pour pourrez le décompresser !!! Pour l'executable c'est http://membres.lycos.fr/victorcrpg/ et cliquez sur SCV_HTML_EDITOR_1.0 Le seul truc qui est con c'est que il fait pas les fichiers de plus de 100ko (il les tronque) mais bon pour y arriver ... (même en prenant le code HTML de cppfrance j'y suis pas arrivé !!!)
Fichier Zip
Pour les "Membres Club", vous pouvez télécharger directement un fichier contenu dans le zip sans télécharger le zip en entier !
Télécharger le zip
Historique
- 14 juillet 2004 14:19:27 :
- Pour ceux qui veuleut vraiment l'utiliser comme un éditeur HTML il peuvent ouvrir un document avec (en clair : On clique sur un doc HTML on fait Ouvrir Avec.. on clique Parcourir.. on sélectionne le chemin ou il est et on Ouvre ) ça fait que quand il démarre (comme certaines applications le fichier se charge directement)
- 14 juillet 2004 15:31:13 :
- Rajout des fonctions Italique, Gras, Souligné, et Color&Taille du texte
- 14 juillet 2004 15:46:53 :
- Poste du code du prompt
- 14 juillet 2004 16:12:10 :
- Ajout de Indice et Exposant
(Mise des sources dans le .zip avec suppression du .exe)
- 14 juillet 2004 16:42:44 :
- Pour l'executable c'est http://membres.lycos.fr/victorcrpg/ et cliquez sur SCV_HTML_EDITOR_1.0
- 14 juillet 2004 17:08:16 :
- -
Sources du même auteur
Sources de la même categorie
Commentaires et avis
|
Comparez les prix Nouvelle version

HTC G1
Entre 449€ et 449€
|