fensterposition

Seite 1 von 1 - Forum: Coding Stuff auf overclockers.at

URL: https://www.overclockers.at/coding-stuff/fensterposition_39178/page_1 - zur Vollversion wechseln!


FMFlash schrieb am 26.06.2002 um 16:29

ich will mein dialogfenster in der ecke rechts oben platzieren, es landet allerdings immer links oben

folgender code wird einmalig in ::OnPaint() getriggert:

CWnd *pWnd, *pWndInsertAfter;
CRect rec, thisRec;

pWnd = GetDesktopWindow();
pWnd->GetClientRect( rec );

this->GetClientRect( thisRec );
this->SetWindowPos( pWndInsertAfter, (rec.right-thisRec.Width()), rec.top, thisRec.Width(), thisRec.Height(), NULL );

wo liegen die fehler?

ps: start ichs am rechten monitor landets in der mitte, am linken links oben


Oculus schrieb am 26.06.2002 um 17:13

pfff
so auf die gachn schauts ok aus :confused:

welche VC-version verwendest denn?


FMFlash schrieb am 26.06.2002 um 17:17

6.0

im c++.de forum wurde bestätigt das es funktioniert, aber bei mir tut es das eben nicht!

ps: alles was ich bekomm is entweder ein fenster in der mitte oder einen "fehler in anwendung"-requester


FMFlash schrieb am 26.06.2002 um 17:48

problem gelöst

statt
this->SetWindowPos( pWndInsertAfter, (rec.right-thisRec.Width()), rec.top, thisRec.Width(), thisRec.Height(), NULL );

ganz einfach
this->SetWindowPos( NULL, (rec.right-thisRec.Width()), rec.top, thisRec.Width(), thisRec.Height(), NULL );

:D :cool:




overclockers.at v4.thecommunity
© all rights reserved by overclockers.at 2000-2026