ERLEDIGT
JA
JA
ANTWORTEN
2
2
ZUGRIFFE
671
671
EMPFEHLEN
-
In einer Anwendung mit einem TreeView habe ich ein Kontextmenü implementiert, das mit der rechten Maustaste geöffnet wird:
Das klappt auch soweit, zumindest wenn ich nur einen Bildschirm habe. Wenn allerdings 2 Bildschirme da sind, wie bei vielen unserer Arbeitsplätze, funktioniert es nicht mehr. ptLV.x ist immer größer 65535, wenn das Applikationsfenster im Bildschirm 2 ist.Code :1 2 3 4 5 6 7 8 9 10 11 12 13
void CLeftView::OnRclick(NMHDR* pNMHDR, LRESULT* pResult) { //Mauskoordinaten ermitteln dwPos = GetMessagePos(); ptSCR.x = LOWORD (dwPos); ptSCR.y = HIWORD (dwPos); ptLV = ptSCR; ScreenToClient(&ptLV); //geklicktes Item ermitteln Item.hItem = Tree.HitTest(ptLV, &uFlags ); .... }
Gibt es irgendwo Infos darüber, wie sich das ScreenToClient(..) bei 2 Bildschirmen verhält? Kann ich davon ausgehen, daß ich immer nur das Low-word der X-Koordinate brauche?
Ich würde mich freuen, wenn mir da einer was sagen könnte, was mir weiterhilft.
Grüße an alle,
jokey2
-
Bei GetMessagePos steht in der MSDN Folgendes unter Remarks:
As noted above, the x-coordinate is in the low-order int of the return value; the y-coordinate is in the high-order int (both represent signed values because they can take negative values on systems with multiple monitors). If the return value is assigned to a variable, you can use the MAKEPOINTS macro to obtain a POINTS structure from the return value. You can also use the GET_X_LPARAM or GET_Y_LPARAM macro to extract the x- or y-coordinate.
Important Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates of the cursor position because these macros return incorrect results on systems with multiple monitors. Systems with multiple monitor systems can have negative x- and y- coordinates, and LOWORD and HIWORD treat the coordinates as unsigned quantities.
-
Danke für den Tip! Mit GET_X_LPARAM und GET_Y_LPARAM klappt es auch mit 2 Bildschirmen in jeglicher Anordnung.
Ähnliche Themen
-
Led's an Bildschirmen und Router usw.
Von yahuu33 im Forum Cinema 4DAntworten: 3Letzter Beitrag: 27.03.09, 10:18 -
Problem: Windows mit 2 Bildschirmen.
Von josDesign im Forum Microsoft WindowsAntworten: 2Letzter Beitrag: 23.08.07, 14:27 -
Desktop auf 2 Bildschirmen
Von Kurt Cobain im Forum Microsoft WindowsAntworten: 7Letzter Beitrag: 26.10.05, 00:31 -
Bildschirmkoordinaten und Screenshot?
Von Math55 im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 1Letzter Beitrag: 25.07.05, 04:06 -
Ausgabe an bestimmten Bildschirmkoordinaten unter C
Von Eitum im Forum C/C++Antworten: 3Letzter Beitrag: 22.03.04, 23:53





Zitieren
Login






