Inverser l'écran

cs_Fyerrblad Messages postés 22 Date d'inscription mercredi 30 mai 2007 Statut Membre Dernière intervention 24 janvier 2008 - 2 juin 2007 à 18:46
daetips Messages postés 142 Date d'inscription jeudi 10 juillet 2003 Statut Membre Dernière intervention 10 novembre 2007 - 3 juin 2007 à 01:45
Slt,

C'était pour savoir si qqun savait inverser l'écran. Svp envoyer le code.
Merci.

- Fyerrblad -

4 réponses

jmfmarques Messages postés 7666 Date d'inscription samedi 5 novembre 2005 Statut Membre Dernière intervention 22 août 2014 27
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 ?
0
Utilisateur anonyme
3 juin 2007 à 00:03
Salut,

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.







__________
Kenji

(


Nouveau forum VBA/Office
0
daetips Messages postés 142 Date d'inscription jeudi 10 juillet 2003 Statut Membre Dernière intervention 10 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

Private Sub Form_Load()
Me.Left = Me.Left - 2 * RCScale
Me.Top = Me.Top - 0 * RCScale
Me.Left = Me.Left + 2 * RCScale
Me.Top = Me.Top + 0 * RCScale
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

Private Sub Form_Load()
Me.Left = Me.Left - 2 * RCScale
Me.Top = Me.Top - 0 * RCScale
Me.Left = Me.Left + 2 * RCScale
Me.Top = Me.Top + 0 * RCScale
SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, 33
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
End
End Sub

Daetips
0
daetips Messages postés 142 Date d'inscription jeudi 10 juillet 2003 Statut Membre Dernière intervention 10 novembre 2007
3 juin 2007 à 01:45
Euh..c'est du VB6, j'avais pas vu que c'était en .net (d'apres la catégorie)

Daetips
0
Rejoignez-nous