The following Dodgers have been smited by the JDK for their crimes against Jam:
All the girls! for picking on the JDK and damaging his already delicate self esteem!
The Basserd Who Nicked Copper's Stuff For the offense of nicking Copper's stuff. You are a tw*t, whoever you are and we all hope you get run over by a tram in Nottingham. Or Liverpool. Or whereever else they have trams!
Copper For the crime of playing with her Wii instead of her Jammie pals!
although she seems to spend more time fixing the team's holiday spreadsheet (because some fcekur keeps fcuking it up!) than doing any actual useful work "
Hmm, can't find my 'zap the jackal' code right now. I do have some code we could tie to a trigger that will crank up the PC's volume to full boar, Excel then tells the user "Guess again fcekur!" then proceeds to an immediate and warningless PC shutdown.
A little experimental in XP, but fully functional in '00/NT.
quote: Originally posted by: VicM " Not as big as Barclays, but bigger than Sony, Ford, Volkswagon and lots of others!! "
Getting back to the performance review - after really good and really really good can we put in "Really Rock God!" (just for me) and umm ehum... bigger than Sony Vic? is that strictly true......?
Love ya!
__________________
I'll take arrogance and the inevitable hubris over self-doubt and lack of confidence.
"Everyone has a plan, until they get punched in the face" - Mike Tyson
quote: Originally posted by: NateO " I do have some code we could tie to a trigger that will crank up the PC's volume to full boar, Excel then tells the user "Guess again fcekur!" then proceeds to an immediate and warningless PC shutdown. A little experimental in XP, but fully functional in '00/NT. "
In any case, I'll try to crank it out for both. It'll give me an excuse to develop for the different platforms, something I've been meaning to do, right Mitchell (where are you man? )?
You tell me the event Suey, and we'll shut 'em down.
It's an excel workbook with a month to each sheet that everyone updates with their holidays.
It has a password protected summary sheet at the back for confirmation that no-one is trying to fiddle the number of hours they are entitled to. (Only I and one other (clueless bimbo that she is) have the password to this sheet)
Unfortunately some of the formula in the monthly pages are overtyped by numerous plebs (all on NT) which bolloxes up the individual monthly sheets & the summary page.
Can't you use worksheet protection on the individual sheets? Simply toggle the locked property under Format->Cells->Protection.
Also note, worksheet protection is a joke. In Excel '00, the following code will unprotect the last worksheet in the workbook:
Sub RemSheetPassword() With Sheets(Sheets.Count) .Protect vbNullString, UserInterfaceOnly:=True .[a1].Copy .[a1] End With End Sub
Back to the code though. Are the functions that are being mucked with all in the same location on the individual sheets? Where should the code look, like an address?
Private Type Target dwType As Long dwDeviceID As Long wMid As Integer wPid As Integer vDriverVersion As Long szPname As String * MAXPNAMELEN End Type
Private Type MIXERLINE cbStruct As Long dwDestination As Long dwSource As Long dwLineID As Long fdwLine As Long dwUser As Long dwComponentType As Long cChannels As Long cConnections As Long cControls As Long szShortName As String * MIXER_SHORT_NAME_CHARS szName As String * MIXER_LONG_NAME_CHARS tTarget As Target End Type
Private Type MIXERCONTROL cbStruct As Long dwControlID As Long dwControlType As Long fdwControl As Long cMultipleItems As Long szShortName(1 To MIXER_SHORT_NAME_CHARS) As Byte szName(1 To MIXER_LONG_NAME_CHARS) As Byte lMinimum As Long lMaximum As Long RESERVED(10) As Long End Type
Private Type MIXERLINECONTROLS cbStruct As Long dwLineID As Long dwControl As Long cControls As Long cbmxctrl As Long pamxctrl As Long End Type
Private Type MIXERCONTROLDETAILS cbStruct As Long dwControlID As Long cChannels As Long item As Long cbDetails As Long paDetails As Long End Type
Private Type MIXERCONTROLDETAILS_UNSIGNED dwValue As Long End Type
Private Declare Function mixerGetNumDevs Lib "winmm.dll" () As Long Private Declare Function mixerOpen Lib "winmm.dll" (phmx As Long, _ ByVal uMxId As Long, ByVal dwCallback As Long, _ ByVal dwInstance As Long, ByVal fdwOpen As Long) As Long Private Declare Function mixerClose Lib "winmm.dll" (ByVal hmx As Long) As Long Private Declare Function mixerGetLineInfo Lib "winmm.dll" _ Alias "mixerGetLineInfoA" (ByVal hmxobj As Long, pmxl As MIXERLINE, _ ByVal fdwInfo As Long) As Long Private Declare Function mixerGetLineControls Lib "winmm.dll" _ Alias "mixerGetLineControlsA" (ByVal hmxobj As Long, pmxlc _ As MIXERLINECONTROLS, ByVal fdwControls As Long) As Long Private Declare Function mixerGetControlDetails Lib "winmm.dll" Alias _ "mixerGetControlDetailsA" (ByVal hmxobj As Long, pmxcd As _ MIXERCONTROLDETAILS, ByVal fdwDetails As Long) As Long Private Declare Function mixerSetControlDetails Lib "winmm.dll" _ (ByVal hmxobj As Long, pmxcd As MIXERCONTROLDETAILS, _ ByVal fdwDetails As Long) As Long Private Declare Sub CopyStructFromPtr Lib "kernel32" Alias _ "RtlMoveMemory" (struct As Any, ByVal ptr As Long, ByVal cb As Long) Private Declare Sub CopyPtrFromStruct Lib "kernel32" Alias _ "RtlMoveMemory" (ByVal ptr As Long, struct As Any, ByVal cb As Long) Private Declare Function GlobalAlloc Lib "kernel32" ( _ ByVal wFlags As Long, ByVal dwBytes As Long) As Long Private Declare Function GlobalLock Lib "kernel32" ( _ ByVal hMem As Long) As Long Private Declare Function GlobalFree Lib "kernel32" ( _ ByVal hMem As Long) As Long
Private uMixerControls(20) As MIXERCONTROL Private hMixerHandle As Long
Public Function OpenMixer(ByVal MixerNumber As Long) As Long Dim ret As Long If MixerNumber < 0 Or MixerNumber > mixerGetNumDevs - 1 _ Then Exit Function ret = mixerOpen(hMixerHandle, MixerNumber, 0, 0, 0) If ret MMSYSERR_NOERROR Then Exit Function ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, _ MIXERCONTROL_CONTROLTYPE_VOLUME, uMixerControls(Speaker)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, _ MIXERCONTROL_CONTROLTYPE_VOLUME, uMixerControls(MICROPHONE)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY, _ MIXERCONTROL_CONTROLTYPE_VOLUME, uMixerControls(AUXILIARY)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC, _ MIXERCONTROL_CONTROLTYPE_VOLUME, uMixerControls(COMPACTDISC)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER, _ MIXERCONTROL_CONTROLTYPE_VOLUME, uMixerControls(SYNTHESIZER)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT, _ MIXERCONTROL_CONTROLTYPE_VOLUME, uMixerControls(WAVEOUT)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_LINE, _ MIXERCONTROL_CONTROLTYPE_VOLUME, uMixerControls(LINEIN)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_DST_SPEAKERS, _ MIXERCONTROL_CONTROLTYPE_MUTE, uMixerControls(SPEAKER_MUTE)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE, _ MIXERCONTROL_CONTROLTYPE_MUTE, uMixerControls(MICROPHONE_MUTE)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY, _ MIXERCONTROL_CONTROLTYPE_MUTE, uMixerControls(AUXILIARY_MUTE)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC, _ MIXERCONTROL_CONTROLTYPE_MUTE, uMixerControls(COMPACTDISC_MUTE)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_SYNTHESIZER, _ MIXERCONTROL_CONTROLTYPE_MUTE, uMixerControls(SYNTHESIZER_MUTE)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT, _ MIXERCONTROL_CONTROLTYPE_MUTE, uMixerControls(WAVEOUT_MUTE)) ret = GetMixerControl(hMixerHandle, MIXERLINE_COMPONENTTYPE_SRC_LINE, _ MIXERCONTROL_CONTROLTYPE_MUTE, uMixerControls(LINEIN_MUTE)) OpenMixer = True End Function
Public Function CloseMixer() As Long CloseMixer = mixerClose(hMixerHandle) hMixerHandle = 0 End Function
Public Function SetVolume(Control As VOL_CONTROL, ByVal NewVolume As Long) As Long SetVolume = SetControlValue(hMixerHandle, uMixerControls(Control), NewVolume) End Function
Public Function GetVolume(Control As VOL_CONTROL) As Long GetVolume = GetControlValue(hMixerHandle, uMixerControls(Control)) End Function
Public Function SetMute(Control As MUTE_CONTROL, _ ByVal MuteState As Boolean) As Boolean Dim Mute As Long Mute = Abs(MuteState) SetMute = SetControlValue(hMixerHandle, uMixerControls(Control), Mute) End Function
Public Function GetMute(Control As MUTE_CONTROL) As Boolean GetMute = CBool(-GetControlValue(hMixerHandle, uMixerControls(Control))) End Function
Private Function GetMixerControl(ByVal hMixer As Long, ByVal componentType _ As Long, ByVal ctrlType As Long, ByRef mxc As MIXERCONTROL) As Long
Dim mxlc As MIXERLINECONTROLS Dim mxl As MIXERLINE Dim hMem As Long Dim ret As Long
ret = mixerGetLineControls(hMixer, mxlc, MIXER_GETLINECONTROLSF_ONEBYTYPE)
If ret = MMSYSERR_NOERROR Then GetMixerControl = True
CopyStructFromPtr mxc, mxlc.pamxctrl, Len(mxc) Else GetMixerControl = False End If GlobalFree (hMem) Exit Function End If
GetMixerControl = False
End Function
Private Function SetControlValue(ByVal hMixer As Long, _ mxc As MIXERCONTROL, ByVal NewVolume As Long) As Boolean Dim mxcd As MIXERCONTROLDETAILS Dim vol As MIXERCONTROLDETAILS_UNSIGNED Dim hMem As Long Dim ret As Long
If mxc.lMaximum > 100 Then vol.dwValue = NewVolume * (mxc.lMaximum 100) Else vol.dwValue = NewVolume End If If vol.dwValue > mxc.lMaximum Then vol.dwValue = mxc.lMaximum If vol.dwValue < mxc.lMinimum Then vol.dwValue = mxc.lMinimum
CopyPtrFromStruct mxcd.paDetails, vol, Len(vol)
ret = mixerSetControlDetails(hMixer, mxcd, MIXER_SETCONTROLDETAILSF_VALUE) GlobalFree (hMem)
If ret = MMSYSERR_NOERROR Then SetControlValue = True
End Function
Private Function GetControlValue(ByVal hMixer As Long, mxc As MIXERCONTROL) _ As Long 'This function gets the value for a control. Dim mxcd As MIXERCONTROLDETAILS Dim vol As MIXERCONTROLDETAILS_UNSIGNED Dim hMem As Long Dim ret As Long