Visualizzazione dei risultati da 1 a 5 su 5

Discussione: [c++]API

  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    136

    [c++]API

    ho scritto questo codice

    codice:
     #define STRICT
     #define WIN32_LEAN_AND_MEAN
     #include <windows.h>
      
     int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nCmdShow) {
         MessageBox(0, "Hello, World!", "Messaggio al mondo", MB_OK);
     	return 0;
     }
    Come è possibile eliminare la skermata del dos che viene dietro alla finestrella con il messaggio?

  2. #2
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    136
    ah, perkè fa anche senza i 2 #define?

  3. #3
    Se usi Visual C++

    puoi fare così

    1) Vai al menu Project, Settings.
    2) Seleziona l'etichetta Link.
    3) Nel text box Project Options :
    a) Cancella /subsystem:console
    b) Inserisci /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup.

    oppure

    1) File -> Nuovo
    2) Win32 Application
    3) An empty project (progetto vuoto)
    4) File -> Nuovo -> C/C++ Source file -> Filename: winmain.c
    5) Incolli quel codice


    E' preferibile la seconda soluzione.

    #define STRICT
    Serve per far si che il compilatore utilizzi un type checking più forte.
    To enable STRICT type checking, define the symbol name
    "STRICT." Open the Project Settings dialog box, select the
    C/C++ tab, select General in the Categories box, and type
    STRICT in the Preprocessor Definitions box. You can also
    specify this definition on the command line or in a makefile
    by giving /DSTRICT as a compiler option.

    To define STRICT on a file-by-file basis (supported by C but
    not C++, as explained in the note that follows), insert a
    #define statement before including WINDOWS.H in files where
    you want to enable STRICT


    #define WIN32_LEAN_AND_MEAN
    Serve per escludere parti degli header file delle API di
    Windows, in modo da velocizzare il processo di compilazione.
    These macros define subsequent macros that exclude
    less-used declarations from the various Windows header files,
    to help speed compilation. For complete information on what
    these macros exclude, search the Windows.h and Afx_w32.h
    files for these symbols. To use this macro in your older
    projects, add the following to the top of your project's
    precompiled header file (typically Stdafx.h for most MFC
    applications)

  4. #4
    Utente di HTML.it
    Registrato dal
    Nov 2004
    Messaggi
    136
    si ma "Come è possibile eliminare la skermata del dos che viene dietro alla finestrella con il messaggio?"

  5. #5
    Utente di HTML.it L'avatar di netarrow
    Registrato dal
    Apr 2004
    Messaggi
    1,425
    Originariamente inviato da §hady
    si ma "Come è possibile eliminare la skermata del dos che viene dietro alla finestrella con il messaggio?"
    compili e linki sotto forma di win32 application come mostrato sopra da internet.

    Imparare è un'esperienza, tutto il resto è solo informazione. (Albert Einstein)

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.