Wo ist HMONITOR deklariert?



  • Hallo!
    In welcher include Datei ist HMONITOR deklariert?
    windows.h reicht nicht aus 😞

    Kevin



  • #include <windows.h> 
    int main(){
        HMONITOR m = NULL;
    return 0; 
    }
    

    kein problem... 🙄



  • #include "windows.h"

    typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);

    D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2065: 'HMONITOR' : nichtdeklarierter Bezeichner

    😕



  • blind?

    #include <windows.h>
    


  • #include <windows.h>

    typedef BOOL (CALLBACK* MONITORENUMPROC)(HMONITOR, HDC, LPRECT, LPARAM);

    geht trotzdem nicht



  • Natürlich geht das.
    Welche Fehlermeldung erscheint denn?



  • D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2065: 'HMONITOR' : nichtdeklarierter Bezeichner

    kann das daran liegen dass ich das in einer headerdatei tu?



  • --------------------Konfiguration: user32 - Win32 Release--------------------
    Kompilierung läuft...
    main.cpp
    D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2065: 'HMONITOR' : nichtdeklarierter Bezeichner
    D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2275: "HDC" : Ungültige Verwendung dieses Typs als Ausdruck
    D:\Programme\Microsoft Visual Studio\VC98\INCLUDE\windef.h(239) : Siehe Deklaration von 'HDC'
    D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2275: "LPRECT" : Ungültige Verwendung dieses Typs als Ausdruck
    D:\Programme\Microsoft Visual Studio\VC98\INCLUDE\windef.h(292) : Siehe Deklaration von 'LPRECT'
    D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2275: "LPARAM" : Ungültige Verwendung dieses Typs als Ausdruck
    D:\Programme\Microsoft Visual Studio\VC98\INCLUDE\windef.h(171) : Siehe Deklaration von 'LPARAM'
    D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2165: 'left-side modifier' : Zeiger auf Daten koennen nicht veraendert werden
    D:\Programme\Microsoft Visual Studio\MyProjects\notifydll\main.h(3) : error C2071: 'MONITORENUMPROC' : ungueltige Speicherklasse



  • aus windef.h:

    #if(WINVER >= 0x0500)
    // ...
    DECLARE_HANDLE(HMONITOR);
    //...
    #endif /* WINVER >= 0x0500 */
    

    Ansonsten ist es auch noch in Multimon.h (Platform SDK).



  • danke!
    mit multimon gehts


Anmelden zum Antworten