cs_Fyerrblad
Messages postés22Date d'inscriptionmercredi 30 mai 2007StatutMembreDernière intervention24 janvier 2008
-
2 juin 2007 à 18:46
daetips
Messages postés142Date d'inscriptionjeudi 10 juillet 2003StatutMembreDernière intervention10 novembre 2007
-
3 juin 2007 à 01:45
Slt,
C'était pour savoir si qqun savait inverser l'écran. Svp envoyer le code.
Merci.
jmfmarques
Messages postés7668Date d'inscriptionsamedi 5 novembre 2005StatutMembreDernière intervention22 août 201427 2 juin 2007 à 21:22
Slt- (c'est probablement Salut, je pense ?...)
Inverser l'écran ? pourquoi pas ?
On peut le faire de différentes façons, en "bouffant" (à coup sur) l'essentiel des ressources de ta machine...car il faudra répêter sans cesse l'opération... à chaque geste fait... à chaqe changement de fenêtre... et en plus :donner le raisonnement qui permettrait de savoir dans quelle fenêtre (pour Windows, même un simple contrôle est une fenêtre) se trouve le curseur...
Reste à savoir quelel en serait l'utilité... et je suis (pour ne rien te cacher) assez curieux de la connaître) !
Ne serait-il pas plus simple, si tu tiens vraiment à avoir un torticolis, de pendre matériellement ton écran tête bêche au plafond ?
Le plus simple, je pense, tu prends ton écran avec tes deux mains, et tu le retourne comme tu veux.
Aucun programme à faire et ca prends que quelques secondes.
daetips
Messages postés142Date d'inscriptionjeudi 10 juillet 2003StatutMembreDernière intervention10 novembre 2007 3 juin 2007 à 01:43
Tous les deux codes sont avec une form maximisée..ca doit etre possible de dessiner sur l'écran directement
Pour inverser les couleurs:
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function InvertRect Lib "user32" (ByVal hdc As Long, ByRef lpRect As RECT) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Sub Command1_Click()
Dim r As RECT
Me.ScaleMode = vbPixels
r.Left = 0
r.Top = 0
r.Right = Me.Width
r.Bottom = Me.Height
InvertRect Me.hdc, r
End Sub
Private Sub Form_Initialize()
Dim W, H
W = Screen.Width / 15
H = Screen.Height / 15
StretchBlt hdc, 0, 0, W, H, GetDC(0&), 0, 0, W, H, vbSrcCopy
Command1_Click
End Sub
Pour retourner l'écran
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Const RCScale = 200
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
Dim GetDesktopWindow As Long
Private Sub Form_Initialize()
Dim W, H, C
C = GetWindowDC(GetDesktopWindow)
W = Screen.Width / Screen.TwipsPerPixelX
H = Screen.Height / Screen.TwipsPerPixelY
'StretchBlt hdc, 0, 0, W, H, GetDC(0&), 0, 0, W, H, vbSrcCopy 'normal
StretchBlt C, 0, H, W, -H, GetDC(0&), 0, 0, W, H, vbSrcCopy 'inversion x
'StretchBlt hdc, W, 0, -W, H, GetDC(0&), 0, 0, W, H, vbSrcCopy 'inversion y
'StretchBlt hdc, W, H, -W, -H, GetDC(0&), 0, 0, W, H, vbSrcCopy 'inversion x et y
End Sub