Restored from previous forum. Originally posted by MrVainSCL.
This is a very small Win32 routine to rename your disk/harddrives for whatever you will need.
Here is a normal version:
Code: Select all
; ------------------------------------------------------------
;
; PureBasic Win32 API - RenameDrive - Example v1.0
;
; by MrVainSCL! aka Thorsten 21/Jan/2003 PB v3.51+
;
; ------------------------------------------------------------
;
result = SetVolumeLabel_("c:\", "PurePower")
;
If result = 1
MessageRequester("","Drive succesfull renamed",0)
Else
MessageRequester("","Couldnt rename Drive",0)
EndIf
End
;
; ------------------------------------------------------------
Code: Select all
; ------------------------------------------------------------
;
; PureBasic Win32 API - RenameDrive - Example v1.0
;
; by MrVainSCL! aka Thorsten 21/Jan/2003 PB v3.51+
;
; ------------------------------------------------------------
;
Procedure RenameDrive(drive$,name$)
result = SetVolumeLabel_(drive$, name$)
ProcedureReturn result
EndProcedure
;
; -------- Check if user is connected to a network --------
;
If RenameDrive("c:\","PurePower") = 1
state$ = "Drive succesfull renamed."
Else
state$ = "Couldnt rename Drive"
EndIf
;
MessageRequester("Result of renaming drive:",state$,0)
End
;
; ------------------------------------------------------------
Remarks
Windows 95/98/Me: SetVolumeLabelW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
Requirements
Client: Included in Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, Windows 95.
Server: Included in Windows Server 2003, Windows 2000 Server, Windows NT Server.
greetz
MrVainSCL! aka Thorsten
PIII450, 256MB Ram, 80GB HD + 6,4 GB, RivaTNT, DirectX9.0, SB AWE64, Win2000 + all Updates...