Procedure ShowStyle(ID)
Param = GetWindowLong_(ID, #GWL_STYLE)
If Param & #WS_BORDER
Debug "WS_BORDER"
EndIf
If Param & #WS_CAPTION
Debug "WS_CAPTION"
EndIf
If Param & #WS_CHILD
Debug "WS_CHILD"
EndIf
If Param & #WS_CHILDWINDOW
Debug "WS_CHILDWINDOW"
EndIf
If Param & #WS_CLIPCHILDREN
Debug "WS_CLIPCHILDREN"
EndIf
If Param & #WS_CLIPSIBLINGS
Debug "WS_CLIPSIBLINGS"
EndIf
If Param & #WS_DISABLED
Debug "WS_DISABLED"
EndIf
If Param & #WS_DLGFRAME
Debug "WS_DLGFRAME"
EndIf
If Param & #WS_GROUP
Debug "WS_GROUP"
EndIf
If Param & #WS_HSCROLL
Debug "WS_HSCROLL"
EndIf
If Param & #WS_SYSMENU
Debug "WS_SYSMENU"
EndIf
If Param & #WS_MINIMIZEBOX
Debug "WS_MINIMIZEBOX"
EndIf
If Param & #WS_MAXIMIZEBOX
Debug "WS_MAXIMIZEBOX"
EndIf
If Param & #WS_OVERLAPPED
Debug "WS_OVERLAPPED"
EndIf
If Param & #WS_OVERLAPPEDWINDOW
Debug "WS_OVERLAPPEDWINDOW"
EndIf
If Param & #WS_POPUPWINDOW
Debug "WS_POPUPWINDOW"
EndIf
If Param & #WS_SIZEBOX
Debug "WS_SIZEBOX"
EndIf
If Param & #WS_TABSTOP
Debug "WS_TABSTOP"
EndIf
If Param & #WS_TILED
Debug "WS_TILED"
EndIf
If Param & #WS_TILEDWINDOW
Debug "WS_TILEDWINDOW"
EndIf
If Param & #WS_VSCROLL
Debug "WS_VSCROLL"
EndIf
EndProcedure
; on ouvre le bloc note
RunProgram("notepad.exe")
Delay(1000)
; on récupère le handle de la fenêtre du bloc note
NPID = GetForegroundWindow_()
; on affiche le titre de la fenêtre pour vérifier
Titre.s = Space(100)
GetWindowText_(NPID, @Titre.s, 100)
Debug Titre
; on cache la fenêtre
ShowWindow_(NPID, #SW_HIDE)
; on regarde les param de la fenêtre
Debug "La fenêtre a le Style suivant :"
ShowStyle(NPID)
; On retire le redimensionnement de la fenêtre
SetWindowLong_(NPID, #GWL_STYLE, GetWindowLong_(NPID, #GWL_STYLE) & ~ #WS_TILEDWINDOW)
; On redimensionne la fenêtre pour que windows apporte les modifications désirées
#TailleX = 300
#TailleY = 300
MoveWindow_(NPID, 200, 200, #TailleX + 1, #TailleY + 1, 0)
MoveWindow_(NPID, 200, 200, #TailleX, #TailleY, 0)
Debug ""
; on regarde les param de la fenêtre
Debug "Il reste le Style suivant :"
ShowStyle(NPID)
; on affiche la fenêtre
ShowWindow_(NPID, #SW_SHOW)
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?
[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Procedure ShowStyle(ID)
Param = GetWindowLong_(ID, #GWL_STYLE)
; Cette procedure permet d'afficher le style de la fenêtre avec une description
; La description est tirée de API-Guide
If Param & #WS_BORDER
Debug "WS_BORDER"
Debug " Creates a window that has a thin-line border."
EndIf
If Param & #WS_CAPTION
Debug "WS_CAPTION"
Debug " Creates a window that has a title bar (includes the WS_BORDER style)."
EndIf
If Param & #WS_CHILD
Debug "WS_CHILD"
Debug " Creates a child window. This style cannot be used with the WS_POPUP style"
EndIf
If Param & #WS_CHILDWINDOW
Debug "WS_CHILDWINDOW"
Debug "Same as the WS_CHILD style."
EndIf
If Param & #WS_CLIPCHILDREN
Debug "WS_CLIPCHILDREN"
Debug "Excludes the area occupied by child windows when drawing occurs within the parent window. This style is used when creating the parent window."
EndIf
If Param & #WS_CLIPSIBLINGS
Debug "WS_CLIPSIBLINGS"
Debug " Clips child windows relative to each other; that is, when a particular child window receives a WM_PAINT message, the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated. If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible, when drawing within the client area of a child window, to draw within the client area of a neighboring child window."
EndIf
If Param & #WS_DISABLED
Debug "WS_DISABLED"
Debug " Creates a window that is initially disabled. A disabled window cannot receive input from the user."
EndIf
If Param & #WS_DLGFRAME
Debug "WS_DLGFRAME"
Debug " Creates a window that has a border of a style typically used with dialog boxes. A window with this style cannot have a title bar."
EndIf
If Param & #WS_GROUP
Debug "WS_GROUP"
Debug "Specifies the first control of a group of controls. The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style. The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group. The user can subsequently change the keyboard focus from one control in the group to the next control in the group by using the direction keys."
EndIf
If Param & #WS_HSCROLL
Debug "WS_HSCROLL"
Debug " Creates a window that has a horizontal scroll bar."
EndIf
If Param & #WS_SYSMENU
Debug "WS_SYSMENU"
Debug " Creates a window that has a window-menu on its title bar. The WS_CAPTION style must also be specified."
EndIf
If Param & #WS_MINIMIZEBOX
Debug "WS_MINIMIZEBOX"
Debug " Creates a window that has a Minimize button. The WS_SYSMENU style must also be specified."
EndIf
If Param & #WS_MAXIMIZEBOX
Debug "WS_MAXIMIZEBOX"
Debug " Creates a window that has a Maximize button. The WS_SYSMENU style must also be specified."
EndIf
If Param & #WS_OVERLAPPED
Debug "WS_OVERLAPPED"
Debug " Creates an overlapped window. An overlapped window has a title bar and a border. Same as the WS_TILED style."
EndIf
If Param & #WS_OVERLAPPEDWINDOW
Debug "WS_OVERLAPPEDWINDOW"
Debug " Creates an overlapped window with the WS_OVERLAPPED, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_MINIMIZEBOX, and WS_MAXIMIZEBOX styles. Same as the WS_TILEDWINDOW style."
EndIf
If Param & #WS_POPUP
Debug "WS_POPUP"
Debug " Creates a pop-up window. This style cannot be used with the WS_CHILD style."
EndIf
If Param & #WS_POPUPWINDOW
Debug "WS_POPUPWINDOW"
Debug " Creates a pop-up window with WS_BORDER, WS_POPUP, and WS_SYSMENU styles. The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible."
EndIf
If Param & #WS_SIZEBOX
Debug "WS_SIZEBOX"
Debug " Creates a window that has a sizing border. Same as the WS_THICKFRAME style."
EndIf
If Param & #WS_TABSTOP
Debug "WS_TABSTOP"
Debug "Specifies a control that can receive the keyboard focus when the user presses the TAB key. Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style."
EndIf
If Param & #WS_VSCROLL
Debug "WS_VSCROLL"
Debug " Creates a window that has a vertical scroll bar."
EndIf
EndProcedure
; on ouvre le bloc note
RunProgram("notepad.exe")
Delay(1000)
; on récupère le handle de la fenêtre du bloc note
NPID = GetForegroundWindow_()
; on affiche le titre de la fenêtre pour vérifier
Titre.s = Space(100)
GetWindowText_(NPID, @Titre.s, 100)
Debug Titre
Debug ""
; on cache la fenêtre
ShowWindow_(NPID, #SW_HIDE)
; on regarde les param de la fenêtre
Debug "La fenêtre a le Style suivant :"
Debug ""
ShowStyle(NPID)
; On retire le redimensionnement de la fenêtre
SetWindowLong_(NPID, #GWL_STYLE, GetWindowLong_(NPID, #GWL_STYLE) & ~ #WS_TILEDWINDOW)
; On redimensionne la fenêtre pour que windows apporte les modifications désirées
#TailleX = 300
#TailleY = 300
MoveWindow_(NPID, 200, 200, #TailleX + 1, #TailleY + 1, 0)
MoveWindow_(NPID, 200, 200, #TailleX, #TailleY, 0)
Debug ""
; on regarde les param de la fenêtre
Debug "Il reste le Style suivant :"
Debug ""
ShowStyle(NPID)
; on affiche la fenêtre
ShowWindow_(NPID, #SW_SHOW)
Je ne suis pas à moitié Polonais mais ma moitié est polonaise ... Vous avez suivi ?
[Intel quad core Q9400 2.66mhz, ATI 4870, 4Go Ram, XP (x86) / 7 (x64)]
Le Soldat Inconnu a écrit :Non, personne bouhouhou, je suis malheureux
Allez, Régis tu vas être encore + malheureux car ton code ne marche pas sous Windows Me
J'ai juste la fenetre du notepad qui est redimensionné.
Je n'ai pas testé sur Windows 98, faut que je le remette, mais je ne pense pas que cela doit marcher