Newsgroup: it.comp.lang.visual-basic
Titolo: R: msgbox personalizzato ????


peggio della sibilla cumana... ::))))) di che si tratta? dove si trova? ecc
ecc
MarioH

trova? ecc ecc
mannaggia a te :)
==================================================
==================================================
The MessageBoxIndirect function creates, displays, and operates a 
message box. The message box contains application-defined message text 
and title, any icon, and any combination of predefined push buttons.
int MessageBoxIndirect(
    LPMSGBOXPARAMS lpMsgBoxParams	// address of structure for message 
box parameters
   );	
 
Parameters
lpMsgBoxParams
Pointer to a MSGBOXPARAMS structure that contains information used to 
display the message box. 
 
Return Values
The return value is zero if there is not enough memory to create the 
message box.
If the function succeeds, the return value is one of the following menu-
item values returned by the dialog box: 
Value	Meaning
IDABORT	Abort button was selected.
IDCANCEL	Cancel button was selected.
IDIGNORE	Ignore button was selected.
IDNO	No button was selected.
IDOK	OK button was selected.
IDRETRY	Retry button was selected.
IDYES	Yes button was selected.
 
If a message box has a Cancel button, the function returns the IDCANCEL 
value if either the ESC key is pressed or the Cancel button is selected. 
If the message box has no Cancel button, pressing ESC has no effect. 
Remarks
When you use a system-modal message box to indicate that the system is 
low on memory, the strings pointed to by the lpszText and lpszCaption 
members of the MSGBOXPARAMS structure should not be taken from a 
resource file, because an attempt to load the resource may fail. 
When an application calls MessageBoxIndirect and specifies the 
MB_ICONHAND and MB_SYSTEMMODAL flags for the dwStyle member of the 
MSGBOXPARAMS structure, Windows displays the resulting message box 
regardless of available memory. When these flags are specified, Windows 
limits the length of the message box text to three lines. Windows does 
not automatically break the lines to fit in the message box, however, so 
the message string must contain carriage returns to break the lines at 
the appropriate places. 
If you create a message box while a dialog box is present, use the 
handle of the dialog box as the hWnd parameter. The hWnd parameter 
should not identify a child window, such as a control in a dialog box. 
Windows 95: The system can support a maximum of 16,364 window handles.
See Also
MessageBox, MessageBoxEx, MSGBOXPARAMS 
==================================================
==================================================
The MSGBOXPARAMS structure contains information used to display a 
message box. The MessageBoxIndirect function uses this structure.
typedef struct {  
    UINT      cbSize; 
    HWND      hwndOwner; 
    HINSTANCE hInstance; 
    LPCSTR    lpszText; 
    LPCSTR    lpszCaption; 
    DWORD     dwStyle; 
    LPCSTR    lpszIcon; 
    DWORD     dwContextHelpId; 
    MSGBOXCALLBACK lpfnMsgBoxCallback; 
    DWORD     dwLanguageId; 
} MSGBOXPARAMS, *PMSGBOXPARAMS, FAR *LPMSGBOXPARAMS; 
 
Members
cbSize
Specifies the structure size, in bytes.
hwndOwner
Identifies the owner window. This member can be NULL.
hInstance
Identifies the instance containing the icon resource identified by the 
lpszIcon member, and the string resource identified by the lpszText or 
lpszCaption member. 
lpszText
Points to a null-terminated string, or the identifier of a string 
resource, that contains the message to be displayed. 
lpszCaption
Points to a null-terminated string, or the identifier of a string 
resource, that contains the message box title. If this member is NULL, 
the default title Error is used.
dwStyle
Specifies a set of bit flags that determine the contents and behavior of 
the dialog box. This member can be a combination of flags described for 
the uType parameter of the MessageBoxEx function. 
In addition, you can specify the MB_USERICON flag if you want the 
message box to display the icon specified by the lpszIcon member.
lpszIcon
Identifies an icon resource. This parameter can be either a null-
terminated string or an integer resource identifier passed to the 
MAKEINTRESOURCE macro. 
To load one of the Windows predefined icons, set the hInstance member to 
NULL and set lpszIcon to one of the values listed with the LoadIcon 
function. 
This member is ignored if the dwStyle member does not specify the 
MB_USERICON flag.
dwContextHelpId
Identifies a Help context. If a Help event occurs, this value is 
specified in the HELPINFO structure that the message box sends to the 
owner window or callback function.
lpfnMsgBoxCallback
Points to the callback function that processes Help events for the 
message box. The callback function has the following form:
 
VOID CALLBACK MsgBoxCallback(LPHELPINFO lpHelpInfo); 
 
If this member is NULL, the message box sends WM_HELP messages to the 
owner window when help events occur.
dwLanguageId
Specifies the language in which to display the text contained in the 
predefined push buttons. This value must be in the form returned by the 
MAKELANGID macro. 
For a list of the language identifiers supported by Win32, see Language 
Identifiers. Note that each localized release of Windows typically 
contains resources only for a limited set of languages. Thus, for 
example, the U.S. version offers LANG_ENGLISH, the French version offers 
LANG_FRENCH, the German version offers LANG_GERMAN, and the Japanese 
version offers LANG_JAPANESE. Each version offers LANG_NEUTRAL. This 
limits the set of values that can be used with the wLanguageId 
parameter. Before specifying a language identifier, you should enumerate 
the locales that are installed on a system.
==================================================
==================================================
Contento? :)
-- 
"Your mouse has moved. Windows NT must be restarted for this change to 
take effect."

troppa grazia!!!!!
sicche č una funzione Api... uhm... quasi quasi uso quella.
solo una cosa. se l'hai gia usata, come diavolo si fa per le icone? nonne
capisco molto di file risorse. un'ultimissima cosa: nella struttura MSGBOX
ecc. c'č un elemtno che č il titolo del msgbox e un altro che č il testo
visualizzato nel messaggio. ma come si fa a modificare il testo dei singoli
pulsanti?
MarioH

modificare il testo dei singoli pulsanti?
non si fa :) e NON si DEVE farlo... il testo sui pulsanti cambia in base 
alla lingua del sistema operativo... "Sì / No" diventa "Ja / Nein", "OK 
/ Annulla" sempre in tedesco sarebbe "OK / Abbrechen" (e non lo 
dimenticherò finchè vivo :), eccetera. Quei pulsanti standard sono lì 
apposta, già il fatto di poter cambiare le icone non dovrebbe essere 
abusato (io ad esempio al massimo lo userei per piazzarci le icone - 
corrispondenti - di BeOS, per intonarsi al look dei miei programmi)


 come faresti con l'editor di Visual C++, ma è un editor dignitosissimo.
gia nell'IDE? chissa dove sta... mo lo cerco... ::)))))
solo una cosa. alla fine avrò un file .RES con un sacco di disegnini dentro?
e ogni disegnino avrà un nome, che io caricherò chesso con loadpicture o
qualcosa del genere... è piu o meno cosi?

loadpicture o qualcosa del genere... è piu o meno cosi?
non solo immagini. La maggior parte delle API di base può caricare sia 
da file sia da risorse. Questo comprende immagini, filmati AVI, suoni 
WAV, testo, eccetera. Non solo, anche le dialog standard (apri file, 
salva file, ecc) si possono personalizzare, definendo una dialog 
personalizzata in un file risorse e caricandola passando l'ID come 
parametro. I file risorse possono essere usati anche per salvare modelli 
di finestre da caricare con DialogBox(), per salvare l'archivio vero e 
proprio nel caso di archivi autoestraenti, e per una quantità di altre 
operazioni. La tecnologia ActiveX ad esempio fa uso di una risorsa 
all'interno dell'applicazione server per salvare la type library 
relativa.
