Hallo,
ich versuch jetzt seit paar Stunden die Funktion SHAppBarMessage in einem Projekt zu benutzen.
Ich will eigentlich eine Taskbar wie die Windows Taskbar bauen.
Ich programmiere in Qt-Creator. Habe für Qt eine AppBar gedownloadet und bekomme aber beim Compilieren folgenden Fehler.
Die Funktion dazu sieht so aus:
Die includes der Header-Datei sehen so aus:
ich versuch jetzt seit paar Stunden die Funktion SHAppBarMessage in einem Projekt zu benutzen.
Ich will eigentlich eine Taskbar wie die Windows Taskbar bauen.
Ich programmiere in Qt-Creator. Habe für Qt eine AppBar gedownloadet und bekomme aber beim Compilieren folgenden Fehler.
Code:
QAppBar.obj:-1: Fehler:LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__imp_SHAppBarMessage" in Funktion ""public: void __cdecl QAppBar::setWidth(int)" (?setWidth@QAppBar@@QEAAXH@Z)".
Code:
void QAppBar::setWidth( int w )
{
// Positioning an appbar is a three-step process:
// 1) We ask Windows what area is available for appbars by sending it an
// ABM_QUERYPOS with a RECT covering the entire desktop; it returns
// a modified RECT that excludes the taskbar and other appbars.
// 2) We come up with a position and size for the appbar (based on
// this.edge and this.width), staying inside this RECT, and pass it
// to Windows using ABM_SETPOS.
// 3) On the slim chance that another appbar appears between ABM_QUERYPOS
// and ABM_SETPOS, we'll get a modified RECT back. Use this final
// RECT to setGeometry().
// If child widgets have mandated a minimum width on this window, it
// must be respected
if( minimumWidth() != 0 ) w = max( w, minimumWidth());
// Get the area of the entire desktop
abd.rc.left = abd.rc.top = 0;
abd.rc.right = GetSystemMetrics( SM_CXSCREEN );
abd.rc.bottom = GetSystemMetrics( SM_CYSCREEN );
// Let Windows subtract the amount being used by other appbars and the
// taskbar
SHAppBarMessage( ABM_QUERYPOS, &abd );
// Position our window on either the left or right side of the screen
if( abd.uEdge == ABE_LEFT ) abd.rc.right = abd.rc.left + w;
else abd.rc.left = abd.rc.right - w;
// Pass the final bounding rectangle to the system
SHAppBarMessage( ABM_SETPOS, &abd );
// Set our actual position based on what came back from ABM_SETPOS
RECT& rc = abd.rc;
setGeometry( rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top );
resizeHandle->setFixedHeight( rc.bottom - rc.top );
}
Code:
... #include <windows.h> #include <shellapi.h>