Hey fellows, i have a problem i can't solve myself, check out the code first ##################################################### .data LoaderFile db "Button.ini",0 LoaderImage db "LoaderImage",0 ImageKey db "bmp",0 RegSubKey db "Software\Microsoft\Windows\CurrentVersion\Run",0 RegValue db "ButtonLoader",0 RegPath db "C:\Button\Autoload.exe",0 RegEntry db "Registry",0 RegEntryKey db "Auto",0 RegEntryOn db "1",0 RegEntryOff db 0 hKey DWORD 0 DispBuffer DWORD 0 buffer db 512 dup(?) .code .ELSEIF ax==IDC_CHECKBOX invoke IsDlgButtonChecked,hWin,IDC_CHECKBOX .IF eax==1 invoke RegCreateKeyEx,HKEY_CURRENT_USER,addr RegSubKey,NULL,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,addr hKey,addr DispBuffer invoke RegSetValueEx,hKey,addr RegValue,NULL,REG_SZ, addr RegPath,sizeof RegPath invoke RegCloseKey,hKey invoke WritePrivateProfileString,addr RegEntry,addr RegEntryKey,addr RegEntryOn,addr LoaderFile .ELSE invoke WritePrivateProfileString,addr RegEntry,addr RegEntryKey,addr RegEntryOff,addr LoaderFile .ENDIF . . . .ELSEIF uMsg==WM_CLOSE invoke GetPrivateProfileString,addr RegEntry,addr RegEntryKey,NULL,addr buffer,512,addr LoaderFile .IF buffer==0 invoke RegOpenKeyEx,HKEY_CURRENT_USER,addr RegSubKey,NULL,KEY_ALL_ACCESS,hKey invoke RegDeleteValue,hKey,addr RegValue invoke RegCloseKey,hKey .ENDIF ######################################################### ok, my prob is that this thing doesn't delete the key from the registry after checking if it is supposed to or not, lets say i open the progi with my checkbox set to checked (key is in the registry), now i uncheck it and close the program, but it doesn't erase the key Why is that ?? must be something with that buffer i suppose, huh ? Thanks so far, Typhoon
Posted on 2001-04-12 01:08:00 by Typhoon
Hi. Try this. Change RegEntryOff db 0 to RegEntryOff db "0",0 Then, in the WM_CLOSE msg, change .IF buffer==0 to mov esi,offset buffer mov al, byte ptr .IF al==30h ; check for the "0" char Start with something like this to get it working and optimize from there. Good luck, vReal
Posted on 2001-04-13 00:34:00 by vReal