Enabling/Disabling Autoplay From Registry
Apparently it is possible to do this programaticaly (Microsoft KB Article ID: Q150449). Why am I unable to do this without crashing VB6? Autoplay hasn't worked on my machine for some time. Could somebody please bash this code out and send me the example (The key in question is in the article, along with all the API functions and key changes necessary. I just can't do it ...)? Much appreciated!
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Trouble Disabling Autoplay
I'm writing a CD audio ripper/player and I need to prevent programs like Winamp and Media Player starting automatically when an audio CD is inserted in the CD drive. I've tried hooking the app window to suppress the Autorun message but that only seems to work for data CDs. Is there a way to do this in VB through code, preferably without altering the registry? The solution would have to work for Windows 98 and Windows 2000. Any help would be appreciated.
Enabling And Disabling Buttons
Hi, I would like to know the code for the procedure where there is a Print button which is ( enabled = false) and you hit a Calculate button and the Print button is ( enabled = true ) and vice versa.. thank you in advance
Enabling/ Disabling CapsLock
HI,
I'm making a game and i need to be able to turn on and off Capslock.
Anyone know any code to do this?
Thanks in advance,
Ed
Sstabs-enabling/disabling
Hi,
The folowing line of code is giving me nightmares .
Please tell me where I am goin wrong.
Code:
Tenant.Tab.TabEnabled(INCIDENT) = False
where tenant is the form name and incident is a tab on it.I have used sstabs.
i m getting error as - Method or data member not found.I have added all the requisite ocx/dll files but the problem persists.Please help.
thanx
Disabling And Enabling MSComm1_OnComm()...
Hi. I have been using MsComm1.RThreshold = 0 then 1 to disable then enable MsComm1.OnComm() comEvReceive event. However, since I am still getting premature triggering from inbuffer "junk", I am not sure if this is the correct solution?
I would like to first disable serial input interrupt, clear all "junk" from the buffer, then enable serial interrupt.
Is this the proper way of disabling and enabling MSComm1_OnComm() interrupt? Thank you.
Enabling && Disabling Frame
I've a frame in a form(Form1). Over that frame i've some other components (option buttons. text box). What i need is, when i disable the frame, components over the frame should also become disabled. How can i do this?.
Enabling And Disabling Buttons
Hello,
I've been working on a project where employees have to punch in and punch out through buttons on a form. I managed (Thanx to Hack) to hook it up to a database that records the time where employees punched in and punched out. But, is there a way I can make the employee not accidentaly punch in or out twice. Perhaps by disabling the punch in button when this particular employee punches in and enabling it only if he punches out. Any code or advice would be really appreciated.
Enabling And Disabling Combo Box
Greetings,
I am currently using Microsoft Office in order to create a few simple VB scripts. Since I do not have much experience with VB, I was looking to see if anyone could help me.
I've created a combo box that has "None", "One" and "Two" as the options. After selecting "One" I would like for a disabled combo box to become enabled so the user can input another option. If the user changes his/her mind and switches the option to "None" or 'Two", I would like for the combo box to disable itself again. I used the following code but it did not work:
Private Sub ComboBox1_GotFocus()
ComboBox1.Clear
ComboBox1.AddItem "None", 0
ComboBox1.AddItem "One", 1
ComboBox1.AddItem "Two", 2
If ComboBox1 = "One" Then
ComboBox2.Enabled = True
Else
ComboBox2.Enabled = False
End If
End Sub
I also tried placing the If ComboBox1= "One"...... code under the Private Sub ComboBox2_Click() and was unable to make it work that way.
If I need to post more detail, please let me know.
Thanks!
Enabling/Disabling Tooltips
I've looked around but haven't found an answer yet for this...
I've got a VB6 app that I would like to add ToolTips to - no problem there. However, I would like to give the user the ability to disable the ToolTips if they don't want them poping-up all the time. I have a user preferences file that I can store the info in, but don't know how to turn the tips off for a whole app.
Anyone got an idea?
Thanks.
Enabling/disabling A Control...
hey all,
I am using the WebBrowser1 control on my app. On the form that loads the control I would like to be able to check the registry for a setting (I have code to do this), then, either enable or disable the WebBrowser1 control.
Reason being is some users don't like any apps accessing the net, this way they can enable or disable that "feature".
TIA...
Enabling And Disabling Ports (TCP/IP,FTP) Using J
How can we enable and disable TCP/IP , FTP ports on the client machine using either Visual Basic or Java, and also how we can make different ports communicate with each other programmatically ? I am a new user please help me. Thanks...
Disabling And Re-enabling Toolbars
Working on an Excel project using VBA (have been for way too long now ) and one of it's features deals with the toolbars. Basically my project has it's own toolbar that will handle all of the functions that I want the user to have. And it disables everything else (and hopefully right-click too one of these days) so that a wandering user can't do other things to the sheet. However, I also realized that the user may be working with other excel sheets at the same time, so I wanted the toolbars to toggle...here's what I've got so far:
in the modules:
Code:
Private toolview() As Integer
Private isClosing As Integer
Sub Closing()
isClosing = 1
End Sub
Sub Opening()
isClosing = 0
End Sub
Sub turnoff()
For i = 1 To 9
MenuBars(xlWorksheet).Menus(i).Enabled = False
Next
cnt = 0
i = 0
For Each Control In Application.CommandBars
cnt = cnt + 1
If Control.Visible = True Then
i = i + 1
ReDim Preserve toolview(1 To i)
toolview(i) = cnt
If cnt <> 1 Then
If cnt < 23 Then
Control.Visible = False
End If
End If
End If
Next Control
Application.CommandBars("Incentive").Visible = True
End Sub
Sub turnon()
If (isClosing = 0) Then
Application.CommandBars("Incentive").Visible = False
End If
For i = 1 To 9
MenuBars(xlWorksheet).Menus(i).Enabled = True
Next
For x = LBound(toolview) To UBound(toolview) 'Note: this is where the error occurs
Application.CommandBars(toolview(x)).Visible = True
Next
End Sub
Then in the workbook code:
Code:
Private Sub Workbook_Activate()
turnoff
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Closing
Toolbars("Incentive").Delete
End Sub
Private Sub Workbook_Deactivate()
turnon
End Sub
Private Sub Workbook_Open()
Opening
Toolbars.Add ("Incentive")
Toolbars("Incentive").Position = xlTop
Toolbars("Incentive").ToolbarButtons.Add 2
Toolbars("Incentive").ToolbarButtons.Add 3
Toolbars("Incentive").ToolbarButtons.Add 9
Toolbars("Incentive").ToolbarButtons.Add 244
turnoff
End Sub
now, most of the time it works fine...it shuts off the custom toolbar when other sheets are active, and remembers what the user was using with their other sheets, turns those on. Toggle back to my sheet, and it reactivates the custom toolbar and disables everything else. However, sometimes, like when one sheet is open and then I open this one, and toggle, and then close this one. It comes up with errors. Sometimes it just doesn't remember what the user had running....other times it comes up with subscript out of range errors in the toolview array. I'm brainfried like usual, and thought maybe you folks could take a gander at it, and see if there is something blatantly wrong with the code etc. ANY suggestions or ANY advice would be GREATLY appreciated. Thanks!
Enabling/disabling Internet In LAN
Hi vb guys! I would like to ask for ur help... I have this problem, how can enable/disable the Internet connection of a client or all of the clients from the server? Need help pretty badly... Thanks
Enabling/Disabling Screensaver
How can VB control the screensaver (Windows 95 platform)? I need to disable the screensaver when a specific window is displayed and re-enable screensaver when that window is unloaded.
Thanks for any help.
d
Enabling/disabling Many Items On A Form
I'm very new to VB, in this case within Access, and I'm a little mystified about how to complete one task. I'd like the majority of the fields and buttons on a form to go "read only" (disabled) when the selected record (part of an order) is "filled". Basically I would like to wire the fields to a method on the form that returns a bool saying whether or not that field should be enabled.
I can't see to see how to do this. The system currently allows me to set the enabled property only as Yes or No. What I want is to set it to my "shouldBeEnabled" function. Is there a way to do this?
There is a fairly similar function I would like to build to allow each field to display a colored border, red for things that need to be filled out and are currently empty, yellow for things they don't need to fill out but should, etc. For this task I would want to have a sub for each field that returns a color, but again it seems that that color can only be set to a fixed value.
Thanks!
Maury
Enabling/Disabling Toolbar Buttons
Hey everyone,
I've searched the forum and have no luck, so here we go.
I'm working on an MDI application that has cut, copy, and paste buttons.
Obviously, the cut and copy buttons should not be enabled when a command button has the focus and other situations like that.
Is there anyway to do this other than in the GotFocus and LostFocus events of every control check to see if the active control is a textbox, if text is selected, etc etc etc.
I thought of using a timer to do this, and have code to check it in the Timer event, but that seems pretty inefficient.
Any ideas??
Thanks all.
Enabling And Disabling Cells In MSFlexgrid
Just a quick question: -
How do I disable a cell in a MSFlexgrid.
basically when I click on cell (2,2) it changes its value from 0 to 1
-I want cells (2,3) and (2,4) to be disabled so when i click on those cells values will not change from 0 to 1
and then if I click on the cell and change its value from 1 to 0 I want to enable those cells again!
I hope there is a quick way of doing this!
Eb
Enabling / Disabling A Timer Via Another Form
Sorry im in a bit of a hurry so i don't have time to find this out myself, but if i have a timer on a form (lets say form1) then how can i make a radio button on another form turn it on or off? (form2)
is there a way i can modify
timer1.enabled
or a property that allows it to be changed from any form?
Disabling/enabling Ctrl+alt+del - Urgent
hi,
I tried using the SystemParameterInfo API to disable ctrl+alt+del and the WIndows key.
The code i used was:
SystemParametersInfo(97, bDisabled, ByVal 0&, 0)
I also tried:
SystemParametersInfo(97, bDisabled, CStr(1), 0)
Where bDisabled was true for disabling and false for enabling.
The former caused the system to hang(I had to restart everytime) and the latter gave me an error saying that "VB has performed an illegal operation and will be shut down"
Can someone help me out here?
Im using vb6 with windows95.
Thanks in advance,
Ramya.
P.S. Is there any way this can be done with NT???
This Is About Enabling And Disabling Text Boxes
This might sound like a dumb question but I am doing a database and I want the user to only beable to use the text box when they click on add new record or delete record or update record.
I just want to know what the code would be for this.
Thank you.
Enabling And Disabling The Command Buttons
I have this line of code which I use to confirm network connectivity:
Dim ECHO As ICMP_ECHO_REPLY
Dim pos As Long
Dim success As Long
If SocketsInitialize() Then
'ping the ip passing the address, text
'to send, and the ECHO structure.
success = Ping("10.1.1.1", "Hello", ECHO)
'display the results
If Left$(ECHO.Data, 1) <> Chr$(0) Then
pos = InStr(ECHO.Data, Chr$(0))
End If
SocketsCleanup
Text1.Text = "You are connected to the Network"
Else
MsgBox "Windows Sockets for 32 bit Windows " & _
"environments is not successfully responding."
What I want to do is if the the network is available I want the command buttons to be enabled....I have them disabled by default.
Thanks in advance for your help
Enabling And Disabling Menu Options
I have a menu with 3 parent options and about 4 child options under each of them. Based on the access, the child options should be enabled/disabled or when all the child options do not have access, the respective parent option should be disabled.
how to go about this.
Parent Menu -> MASTER TRANSACTION UTILITIES
Child Options-> Item Invoice Import
Product Payment Export
Vendor Receipt Backup
Payment Restore
Above is the look of the sample menu.
How to go about it in visual basic
Thanks in advance,
Enabling/Disabling Network Components
Hello,
Can anyone tell me how to enable/disable network component programatically (Win32/MFC)? I have attached an Image which shows about 2 network components one is local Ethernet and another one is WiFi wireless LAN. I need change among these. How ?
Thanks,
Vikas
Disabling/Re-enabling Copy && Paste Functions
Greetings,
I have created an Excel based survey system whereby people are sent individual surveys in Excel and return them to me. From there, I use another workbook to compile the data using a macro which goes from sheet to sheet copying the data.
In an effort to control responses, I have disabled copy and paste functions in each individual survey with the following code:
Code:
Private Sub Workbook_Activate()
Dim octrl As Office.CommandBarControl
'Disable all Cut Menus
For Each octrl In Application.CommandBars.FindControls(ID:=21)
octrl.Enabled = False
Next octrl
'Disable all Copy Menus
For Each octrl In Application.CommandBars.FindControls(ID:=19)
octrl.Enabled = False
Next octrl
'Disable all Paste Menus
For Each octrl In Application.CommandBars.FindControls(ID:=22)
octrl.Enabled = False
Next octrl
'Disable all Paste Special Menus
For Each octrl In Application.CommandBars.FindControls(ID:=755)
octrl.Enabled = False
Next octrl
'Disable the Edit Menu
For Each octrl In Application.CommandBars.FindControls(ID:=30003)
octrl.Enabled = False
Next octrl
Application.OnKey "^c", ""
Application.OnKey "^v", ""
Application.CellDragAndDrop = False
End Sub
Private Sub workbook_Deactivate()
Dim octrl As Office.CommandBarControl
'Enable all Cut Menus
For Each octrl In Application.CommandBars.FindControls(ID:=21)
octrl.Enabled = True
Next octrl
'Enable all Cut Menus
For Each octrl In Application.CommandBars.FindControls(ID:=19)
octrl.Enabled = True
Next octrl
'Disable all Paste Menus
For Each octrl In Application.CommandBars.FindControls(ID:=22)
octrl.Enabled = True
Next octrl
'Disable all Paste Special Menus
For Each octrl In Application.CommandBars.FindControls(ID:=755)
octrl.Enabled = True
Next octrl
'Enable the Edit Menu
For Each octrl In Application.CommandBars.FindControls(ID:=30003)
octrl.Enabled = True
Next octrl
Application.OnKey "^c"
Application.OnKey "^v"
Application.CellDragAndDrop = True
End Sub
Private Sub workbook_sheetselectionchange(ByVal sh As Object, ByVal target As Range)
With Application
.CellDragAndDrop = False
.CutCopyMode = False
End With
End Sub
My data compiling macro is as follows:
Code:
Sub Transfer()
Application.ScreenUpdating = False
x = False
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please Select a file")
Do While NewFN <> False
NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please Select a file")
If NewFN = False Then
Exit Sub
Else
Workbooks.Open Filename:=NewFN
End If
Sheets("DATA - 8").Activate
Range("A6:AV25").Select
Selection.Copy
Windows("Database Template.xls").Activate
Range("A6").Select
ActiveSheet.Range("F6").Select
Do While ActiveCell <> 0
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell.Offset(0,-5).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ActivatePrevious
Application.ScreenUpdating = True
Application.CutCopyMode = False
ActiveWindow.Close False
Loop
End Sub
My problem is that since copy and paste is disabled on each individual workbook, I cannot use the paste special function to transfer the data in my compiling macro. I have attempted various ways to reactivate copy and paste so I can transfer that data, but I haven't been successful. Is there any way to run a macro in a workbook from another workbook? Any insight would be much appreciated!!!
Enabling/Disabling Toolbar Buttons At Runtime
I am relatively new to Visual Basic and have recently started designing a practice application with one toolbar(Toolbar1). The buttons work fine but I need to enable or disable some buttons at runtime - For example, if 'Form1' is visible, the button to show that form needs to be disabled while enabling the button which shows 'Form2'. Can anyone help me out with this problem?
Enabling/Disabling Shutdown Button *RESOLVED*
I ran a source code with API to disable shut down / log off / password change / task manager, and then re enable, but it won't re enable my shut down button, so I have no way of turning off my computer without pushing the botton on my physical system. Does anyone know how to re enable the shut down button? I have the source for the program that did it. It re enabled task manager but didn't re enabled the damn shut down button!
Menu Enabling/disabling In MDI Parent Error
OK, again I must show a grey area in my knowledge of Visual Basic 6.
I am tryign to ensure that a drop-down menu in the MDI parent is disabled when loading an MDI child form, as the drop-down menu would be inappropriate for that particular form and I don't want users (who we all know do stupid things at times) trying to do things that would casue things to fall over.
Now, normally the following line of code should work.
VB Code:
frmMain.mnuJump.Enabled = False
When I start typing that in, VB6 continues to fill in the blanks for me.
Yet, when I try and load the form, it stops at that line, and gives me a Run-Time Error 426: "Only one MDI Form allowed".
I've seen two possible solutions to this problem online, both with very flaky explanations (is it just me or is this some sort of common problem among many VB sites - solutions that probably work with explanations that don't make sense to somebody else trying to work their own problems out). The solutions are:
[list=a][*]Turn the menu into a public property (I've got NFI how to do this with a menu)[*]Turn my forms into MDI children, which they already are so that's not the solution.[/list=a]
Any ideas???
Enabling And Disabling Proxy Server Through Visual Basic
hello, im currently studying at uni and i need to use a proxy server there, however when im at home i dont require a proxy, i would like to develop a little application that sits in my task bar and automattically checks to see which network i'm on, this could be done by checking the first 3 numbers of my ip, i know how to do all of this, the bit im stuck on is how to access the internet options to change the proxy server, any help would be great,
thanks alot
Enabling/Disabling Start Button On Windows 2000
I am looking for the API(s) and sample code that I can use that will allow me to enable and disable the windows start button. The reason is I am helping a friend of mine whose primary tech support person recently passed away, and he disables the start button upon loging (I assume). I was hoping to:
1) understand how that can happen
2) have a temp solution to enable it to perform some admin task - such as backup the server
Any help would be appreciated. Thank you.
Urgent Help - TreeView Enabling/Disabling Child Nodes
I'm trying to load a treeview that has upto 4 levels. The requirement is, while loading the treeview, i need to enable the Level 3 and level 4 and disable the rest.
I know that we have Treeview.enabled = false but is it possible to use this at various levels.
Root
Parent1
AA
BB
BB1
BB12
In the above, i need to enable bb1 and bb12 and disable the rest. Also, is it possible to show the treeview as expanded with the selection that was already made.
be it that im loading the treeview in a View mode where the user has already made a selection of BB12. Can the treeview be expanded while loading the second time based on the mode?
Pls provide inputs.
Enabling A NIC Through API/registry Changes
With Windows 2000 and up, if you call the GetAdaptersInfo API when your NICs are disabled, then it will not detect them. On examining the registry, I have found that the registry field to enable/disable NICs , however, I have not been able to determine a way of logically getting to it.
Is there any APIs that will enable/disable a network adapter or does anyone know a method of determining how to do so through changing registry settings?
Many thanks,
Andy
Disabling "X" On The Form And Re-enabling It Later.
Is it possible to disable the "X" on the form whenever processing is being done by the form and then re-enable it when the processing is complete. *We process data against DB2, and it takes couple of seconds (sometimes 10-15) before the operation is complete. And we don't want the user to fool around and click on "X" when the data update is taking place"
TIA.
WMP Autoplay
WindowsMediaPlayer1 &2 will play everytime i have VB change the URL. Is there anyway to stop this from playing until i play it?
AutoPlay
hi guyz
does n e know any VB program for creating an autoplay cd
bye
Totally New Need Help With Vcd Autoplay
hi, im totally new to vb and i would like help on how to make ordinary vcds autoplay when i put them in my cdrom drive. im thinking of if the same folders are present like in all vcds, then it would auto open a specific path with the file using media player. can anyone help me on this?
Disable CD Autoplay
Hi everyone,
Can somebody tell me please how can i disable (if active) using VB the autoplay feature on windows xp when you insert a CD ? The goal is not to get the anoing 'what you want to do with this cd..." xp windows when my application is running and you insert a cd with data for it... and i don't want to permanently disable it since some users might want it working
Thank you.
[help] How To Code Autoplay?
guys, can you teach me how to code autoplay in cd in vb? and how to make a background song?
thanks and advance!
Removing Autoplay In XP
This is not actually a VB question but I was programming in VB when I encountered this problem.
How do I set XP to ignore autoplay devices like CDROMs and Flash Drives? When I changed the properties settings to take no action for all file types, XP still opens an Explorer showing its contents.
Please help! Thanx.
Disable CD Autoplay
Hi everyone,
Can somebody tell me please how can i disable (if active) using VB the autoplay feature on windows xp when you insert a CD ? The goal is not to get the anoing 'what you want to do with this cd..." xp windows when my application is running and you insert a cd with data for it...
Thank you.
Killing CD Autoplay From VB6 In Win2000
I've wrestled with this one long enough. I want to prevent a CD from autoplaying when inserted from within VB6. This is mainly an issue for me in Win2000 since everything I have tried outside of VB has failed.
Programmatically Start AutoPlay
When you right click a removable drive in My Computer there is an AutoPlay option. Anyone know of code to start that (AutoPlay) with VB6 code? I already have the paths, I just need the code to start it.
Thanks
Using Windows XP
Autoplay Movie In VB6 Using Timer
Is there any way to program a code to make a movie autoplay in a stipulated time using timer??The timer is used to control the length of the movie....If yes can please show me one example on how to do it??Thanks....Any help would be appreciated..
Autoplay MediaFile On CD Insert
Hrm,
Is it possible to detect if there is a media file in the cd drive (mpeg , avi) and if there is to get the filename of it.
If anyone could help me out with the code for something like that it would be much appricated.
~T
Want To Write AUTOPLAY.EXE Code.
I want to distribute a CD to about 300 workstations throughout my company. The files are in HTML format. I would like to write an AUTOPLAY.EXE file to open the default page "Default.htm" upon insertion of the CD. Does anyone have any sample code that I can use as a guide?
Disabling Subform Without Disabling The Scrollers
Hi Eveyone,
I have a subform and i want to disable it so user can't change the values in it. However, I want the user to be able to scroll it since the subform is in Datasheet view and it has quite a lot of fields.
I tried locking it, but the user is still able to see the other options in the combo box and i don't want that to happen.
Is it possible to just disable the data entering or changing in a form directly (i want to be able to change the data through my main form)?
|