|
begin process at 2008 07 06 03:01:00
Derniers logiciels
|
Trouver une ressource (Nouvelle version du moteur, plus rapide & pertinent, essayez le !)
Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum.
Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !
Sujet : Cherche API... [ Archives Visual Basic / API ] (SuperNoizo)
|
Cherche API...
le 23/06/2002 16:36:38

SuperNoizo
|
Boujour à tous, Je cherche un API qui me permetterais de mettre en gris la croix en haut à droite comme dans une boîte de message(msgbox). Merci
|
|
|
|
Re : Cherche API...
le 23/06/2002 18:49:31

Seb_d_angers
|
J'ai trouver ce qu'il te faut sur l'excellent site
http://docvb.free.fr/api.php --------------------------------------------------------- Fonction DeleteMenu
Declare Function DeleteMenu Lib "user32" Alias "DeleteMenu" ( _ ByVal hMenu As Long, _ ByVal nPosition As Long, _ ByVal wFlags As Long) As Long Versions : . Windows 95/98 : Oui . Windows NT : A partir de 3.1 . Windows 2000/XP : Oui
Description : Permet de supprimer un élément de menu. hMenu est le handle du menu à manipuler. nPosition est la position du menu (ou sous-menu) qui sera supprimé. wFlags est la méthode de repérage utilisée : MF_BYCOMMAND ou MF_BYPOSITION.
Exemple d'utilisation :
' Origine : fred - chapeaux.ronds@wanadoo.fr
' Le code qui suis permet de désactiver les boutons "X", "min", "max". ' Créer un nouveau projet vb et coller le code suivant dans ' "déclaration" puis essayer les trois boutons les uns après les autres ' (pour cela enlever l'apostrophe devant "no_min" et "no_max").
Option Explicit
Private Declare Function DeleteMenu Lib "user32" (ByVal _ hMenu As Long, ByVal nPosition As Long, _ ByVal wFlags As Long) As Long Private Declare Function GetSystemMenu Lib "user32" (ByVal _ hwnd As Long, ByVal bRevert As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, ByVal _ nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hwnd As Long, ByVal _ nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16) Private Const MF_BYCOMMAND = &H0& Private Const MF_BYPOSITION = &H400 Private Const SC_MINIMIZE = &HF020 Private Const SC_MAXIMIZE = &HF030 Private Const SC_CLOSE = 6 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000
Private Sub no_x() ' Désactiver X Dim hMenu As Long, k As Long hMenu = GetSystemMenu(hwnd, False) k = DeleteMenu(hMenu, SC_CLOSE, MF_BYPOSITION) End Sub
Private Sub no_min() ' Désactiver 'minimiser' Dim hMenu As Long, k As Long hMenu = GetSystemMenu(hwnd, False) k = DeleteMenu(hMenu, SC_MINIMIZE, MF_BYCOMMAND) k = GetWindowLong(hwnd, GWL_STYLE) k = k Xor WS_MINIMIZEBOX SetWindowLong hwnd, GWL_STYLE, k End Sub
Private Sub no_max() ' Désactiver 'maximiser' Dim hMenu As Long, k As Long hMenu = GetSystemMenu(hwnd, False) k = DeleteMenu(hMenu, SC_MAXIMIZE, MF_BYCOMMAND) k = GetWindowLong(hwnd, GWL_STYLE) k = k Xor WS_MAXIMIZEBOX SetWindowLong hwnd, GWL_STYLE, k End Sub
Private Sub Form_Load() no_x ' no_min ' no_max End Sub
********************************* J'espère t'avoir aider A+ Seb http://www.programmez.org
------------------------------- Réponse au message : -------------------------------
Boujour à tous, Je cherche un API qui me permetterais de mettre en gris la croix en haut à droite comme dans une boîte de message(msgbox). Merci
|
|
|
|
Re : Cherche API...
le 24/06/2002 18:50:15

SuperNoizo
|
Merci beaucoup!!!
------------------------------- Réponse au message : -------------------------------
J'ai trouver ce qu'il te faut sur l'excellent site
http://docvb.free.fr/api.php --------------------------------------------------------- Fonction DeleteMenu
Declare Function DeleteMenu Lib "user32" Alias "DeleteMenu" ( _ ByVal hMenu As Long, _ ByVal nPosition As Long, _ ByVal wFlags As Long) As Long Versions : . Windows 95/98 : Oui . Windows NT : A partir de 3.1 . Windows 2000/XP : Oui
Description : Permet de supprimer un élément de menu. hMenu est le handle du menu à manipuler. nPosition est la position du menu (ou sous-menu) qui sera supprimé. wFlags est la méthode de repérage utilisée : MF_BYCOMMAND ou MF_BYPOSITION.
Exemple d'utilisation :
' Origine : fred - chapeaux.ronds@wanadoo.fr
' Le code qui suis permet de désactiver les boutons "X", "min", "max". ' Créer un nouveau projet vb et coller le code suivant dans ' "déclaration" puis essayer les trois boutons les uns après les autres ' (pour cela enlever l'apostrophe devant "no_min" et "no_max").
Option Explicit
Private Declare Function DeleteMenu Lib "user32" (ByVal _ hMenu As Long, ByVal nPosition As Long, _ ByVal wFlags As Long) As Long Private Declare Function GetSystemMenu Lib "user32" (ByVal _ hwnd As Long, ByVal bRevert As Long) As Long Private Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hwnd As Long, ByVal _ nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hwnd As Long, ByVal _ nIndex As Long, ByVal dwNewLong As Long) As Long
Private Const GWL_STYLE = (-16) Private Const MF_BYCOMMAND = &H0& Private Const MF_BYPOSITION = &H400 Private Const SC_MINIMIZE = &HF020 Private Const SC_MAXIMIZE = &HF030 Private Const SC_CLOSE = 6 Private Const WS_MAXIMIZEBOX = &H10000 Private Const WS_MINIMIZEBOX = &H20000
Private Sub no_x() ' Désactiver X Dim hMenu As Long, k As Long hMenu = GetSystemMenu(hwnd, False) k = DeleteMenu(hMenu, SC_CLOSE, MF_BYPOSITION) End Sub
Private Sub no_min() ' Désactiver 'minimiser' Dim hMenu As Long, k As Long hMenu = GetSystemMenu(hwnd, False) k = DeleteMenu(hMenu, SC_MINIMIZE, MF_BYCOMMAND) k = GetWindowLong(hwnd, GWL_STYLE) k = k Xor WS_MINIMIZEBOX SetWindowLong hwnd, GWL_STYLE, k End Sub
Private Sub no_max() ' Désactiver 'maximiser' Dim hMenu As Long, k As Long hMenu = GetSystemMenu(hwnd, False) k = DeleteMenu(hMenu, SC_MAXIMIZE, MF_BYCOMMAND) k = GetWindowLong(hwnd, GWL_STYLE) k = k Xor WS_MAXIMIZEBOX SetWindowLong hwnd, GWL_STYLE, k End Sub
Private Sub Form_Load() no_x ' no_min ' no_max End Sub
********************************* J'espère t'avoir aider A+ Seb http://www.programmez.org
------------------------------- Réponse au message : -------------------------------
Boujour à tous, Je cherche un API qui me permetterais de mettre en gris la croix en haut à droite comme dans une boîte de message(msgbox). Merci
|
|
|
Classé sous : cherche, api
|
CalendriCode
| | | L | M | M | J | V | S | D |
| | 1 | 2 | 3 | 4 | 5 | 6 |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 | | | |
|
Téléchargements
Logiciels à télécharger sur le même thème :
|
|