如何取消CD auto play時所產生的表單 |
尚未結案
|
LeonSun
一般會員 發表:5 回覆:9 積分:2 註冊:2003-10-17 發送簡訊給我 |
|
CuteBabyBoy
初階會員 發表:18 回覆:97 積分:48 註冊:2003-07-11 發送簡訊給我 |
|
LeonSun
一般會員 發表:5 回覆:9 積分:2 註冊:2003-10-17 發送簡訊給我 |
|
LeonSun
一般會員 發表:5 回覆:9 積分:2 註冊:2003-10-17 發送簡訊給我 |
|
CuteBabyBoy
初階會員 發表:18 回覆:97 積分:48 註冊:2003-07-11 發送簡訊給我 |
|
LeonSun
一般會員 發表:5 回覆:9 積分:2 註冊:2003-10-17 發送簡訊給我 |
|
CuteBabyBoy
初階會員 發表:18 回覆:97 積分:48 註冊:2003-07-11 發送簡訊給我 |
|
LeonSun
一般會員 發表:5 回覆:9 積分:2 註冊:2003-10-17 發送簡訊給我 |
|
ttol
一般會員 發表:1 回覆:3 積分:0 註冊:2004-05-04 發送簡訊給我 |
關於 NoDriveTypeAutoRun 的詳細設定
http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/windows2000/techinfo/reskit/en-us/regentry/91525.asp 若要讓修改立即生效, 只要把 Explorer.exe 的 process 殺掉重新執行就好了
只是我在 xp 中, 把 Explorer.exe 殺掉後, xp 會自動重新載入, 就不用在自己動手了
其他的環境我就沒試過會不會自動重載了
procedure DisableAutoRun(); var reg:TRegistry; begin Reg := TRegistry.Create; try Reg.RootKey := HKEY_CURRENT_USER; if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', True) then begin reg.WriteInteger('NoDriveTypeAutoRun',$95); Reg.CloseKey; end; finally Reg.Free; end; RerunExeFile('Explorer.exe'); end; procedure EnableAutoRun(); var reg:TRegistry; begin Reg := TRegistry.Create; try Reg.RootKey := HKEY_CURRENT_USER; if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer', True) then begin reg.WriteInteger('NoDriveTypeAutoRun',$91); Reg.CloseKey; end; finally Reg.Free; end; RerunExeFile('Explorer.exe'); end; Procedure RerunExeFile(FileName:String); var Found: Boolean; AWnd, AHandle: THandle; ProcessEntry32: TProcessEntry32; APath: array [0..MAX_PATH] of Char; begin AWnd := Application.MainForm.Handle;//FindWindow('TMainForm', nil); if AWnd = 0 then Exit; AHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); try ProcessEntry32.dwSize := Sizeof(ProcessEntry32); Found := Process32First(AHandle, ProcessEntry32); while Found do begin if uppercase(StrPas(ProcessEntry32.szExeFile)) = UpperCase(FileName) then begin GetModuleFileNameEx(OpenProcess(PROCESS_QUERY_INFORMATION or PROCESS_VM_READ, False, ProcessEntry32.th32ProcessID), 0, @APath[0], SizeOf(APath));//取得進程路徑 TerminateProcess(OpenProcess(PROCESS_ALL_ACCESS, True, ProcessEntry32.th32ProcessID), 0);//結束進程 // ShellExecute(AWnd, 'open', APath, nil, nil, SW_SHOW);//重新運行程式 // Break; end; Found := Process32Next(AHandle, ProcessEntry32); end; finally CloseHandle(AHandle); end; end; |
ttol
一般會員 發表:1 回覆:3 積分:0 註冊:2004-05-04 發送簡訊給我 |
NoDriveTypeAutoRun
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer Data type : REG_DWORD
Range : 0x0–0xFF
Default value : 0x95 Description
Disables the Autoplay feature on all drives of the type specified. Autoplay begins reading from a drive as soon as media is inserted in the drive. As a result, the setup file of programs and the sound on audio media starts immediately. This entry stores the setting of the Disable Autoplay Group Policy. Group Policy adds this entry to the registry when you enable the Disable Autoplay policy. If you disable the policy or set it to Not configured, Group Policy deletes this entry from the registry, and the system behaves as though the value is 0x95. This entry is a bitmapped value. To disable Autoplay on a particular type of drive, set the bit representing that drive type to 1. To disable more than one type of drive, set the bits representing each type to 1, or sum the hexadecimal values of the representative bits. Value Meaning
0x1 Disables Autoplay on drives of unknown type.
0x4 Disables Autoplay on removable drives.
0x8 Disables Autoplay on fixed drives.
0x10 Disables Autoplay on network drives.
0x20 Disables Autoplay on CD-ROM drives.
0x40 Disables Autoplay on RAM disks.
0x80 Disables Autoplay on drives of unknown type.
0xFF Disables Autoplay on all types of drives. By default, Autoplay is disabled on removable drives, such as the floppy disk drive (but not the CD-ROM drive), and on network drives. The default value 0x95 (149) is the sum of 0x1, 0x81 (unknown types), 0x4 (floppy drives), and 0x10 (network drives).
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |