Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Obtinere semnaturi centrala termica

Mirosurile in blocurile noi

Monitor 2 blurry

Ce vrea sa zica autorul?
 Blocuri drumul taberei

Dynamic Residence 2 Brasov

Editari foto/video unice

BRICS
 Cat sa fac gratarul din caramida?

Calculator de buget

Cetatenie Romana copil nascut in ...

Ce imprimanta laser monocrom reco...
 Fisuri planșeu beton

Placa de sunet usb

Ce trebuie sa fac daca mi-am schi...

Plante fara irigatii, zona de cam...
 

Visual Basic Code Snippets

- - - - -
  • Please log in to reply
No replies to this topic

#1
ezekio

ezekio

    Active Member

  • Grup: Banned
  • Posts: 1,679
  • Înscris: 07.01.2002
Niste linii de cod care mie mi-au folosit si le-am scris/gasit destul de greu
' (1)

' disable Close Button in a window(form)



Public Declare Function GetSystemMenu Lib "user32" (ByVal hWnd As Long, ByVal bRevert As Long) As Long



Public Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long



Global Const MF_BYPOSITION = &H400



' urmatorul codul trebuie sa apara in Form_Load()



Dim SystemMenu%, Res%

 

SystemMenu% = GetSystemMenu(hWnd, 0)



' sterge butonul Close

Res% = RemoveMenu(SystemMenu%, 6, MF_BYPOSITION)



' sterge linia de separare

Res% = RemoveMenu(SystemMenu%, 5, MF_BYPOSITION)
' (2)

' OS-type. Detecteaza urm. os-uri: 

' Win 98/SP1/SE, Win ME

' Win NT 3.51/4.0, Windows 2000, Windows XP

'*************************************

'scrieti liniile acestea intr-un *.bas



Public Declare Function GetVersionExA Lib "kernel32" (lpVersionInformation As OSVERSIONINFO) As Integer



Public Type OSVERSIONINFO

    dwOSVersionInfoSize As Long

    dwMajorVersion As Long

    dwMinorVersion As Long

    dwBuildNumber As Long

    dwPlatformId As Long

    szCSDVersion As String * 128

    End Type





Public Function GetWindowsVersion() As String

    

Dim OSInfo As OSVERSIONINFO

Dim Ret As Integer

OSInfo.dwOSVersionInfoSize = 148

OSInfo.szCSDVersion = Space$(128)

Ret = GetVersionExA(OSInfo)





With OSInfo

Select Case .dwPlatformId

Case 1

If .dwMinorVersion = 10 Then

    If .dwBuildNumber = 1998 Then

        GetWindowsVersion = "Windows 98"

        ElseIf (.dwBuildNumber > 1998) And (.dwBuildNumber < 2183) Then

            GetWindowsVersion = "Windows 98 SP1"

        ElseIf .dwBuildNumber >= 2183 Then

            GetWindowsVersion = "Windows 98 SE"

    End If

    Else

        GetWindowsVersion = "Windows ME"

End If



Case 2

If .dwMajorVersion = 3 Then

    GetWindowsVersion = "Windows NT 3.51"

    ElseIf .dwMajorVersion = 4 Then

        GetWindowsVersion = "Windows NT 4.0"

    ElseIf .dwMajorVersion = 5 Then

        If .dwMinorVersion = 0 Then

             GetWindowsVersion = "Windows 2000"

        Else

            GetWindowsVersion = "Windows XP"

        End If

End If



Case Else

    GetWindowsVersion = "Unable To get Windows Version"

End Select

End With

End Function

'****************************************

'Intr-un form introduceti un label cu valoare Captionul GetWindowsVersion

Cam atat . Sper sa ajute pe careva  :cya:

Anunturi

Bun venit pe Forumul Softpedia!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate