| |
|
|
Michael Axtmann | Hi,
i'd my Profan Program gladly at Computerstart Call and mach therefore one entry with way to .exe application the Profan Program under: HKey_Local_Machine\software\Microsoft\windows\CurrentVersion\Run --> way\application.exe
however reports itself Profan at Computerstart with a crash and the wars! might the jm. too time try? or. white jm. I wrong make?
Greeting Michael |
|
|
| |
|
|
|
Jörg Sellmeyer | For this must one already little more know. Z. B.: which Version have You and yet plenty importent: what power your Program. If you of your program on something zugreifst, what to that Windowsstart not yet initialized is, can the problematically his. Teste still time yourself with a basic program, the only one Window with Window ... created. If the crashes, lying it probably to profane, otherwise is well your Another code for Responsible. |
|
|
| Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/02/12 ▲ |
|
|
|
|
Julian Schmidt | here time one funktionierendes example. Perhaps helps it to you moreover... CompileMarkSeparationDef @Regopenkeyex(5) !"ADVAPI32","RegOpenKeyExA"
Def @Regdeletevalue(2) !"ADVAPI32","RegDeleteValueA"
Def @Regclosekey(1) !"ADVAPI32","RegCloseKey"
Def DateiName(1) SubStr$(@$(1),-1,"\\")
Def DateiPfad(1) Translate$(@$(1),("\\" + DateiName(@$(1))),"")
DEF GetSysColor(1)!"USER32","GetSysColor"
var Programm$=Par$(Par$(If((Upper$(SubStr$(Par$(0), -1, "\\"))="PROFAN.EXE") or (Upper$(SubStr$(Par$(0), -1, "\\"))="XPROFAN.EXE"),1,0)))
Set("ErrorLevel", 0)
Window 100,120-400,200
Windowstyle "Beispiel-Programm zum Autostart"
cls GetSysColor(15)
var speichern&=Create("Button",%hwnd,"Speichern",width(%hwnd)-120,height(%hwnd)-45,110,35)
var abbrechen&=Create("Button",%hwnd,"Abbrechen",10,height(%hwnd)-45,110,35)
Create("GroupBox",%hwnd,"Autorun:",10,10,width(%hwnd)-20,60)
var autorun&=Create("CheckBox",%hwnd,"Programm mit Windows starten?",30,35,230,20)
case Readini$("HKEY_1","Software\Microsoft\Windows\CurrentVersion\Run","Beispiel-Programm")<>"" : SetCheck autorun&,1
whilenot (getfocus(abbrechen&) or iskey(27))
waitinput
if getfocus(speichern&)
if GetCheck(autorun&)=1'autorun
Writeini "HKEY_1","Software\Microsoft\Windows\CurrentVersion\Run","Beispiel-Programm"=DateiPfad(Programm$) + "\Beispiel.exe"
else
DeleteRegEintrag("$80000001","Software\Microsoft\Windows\CurrentVersion\Run","Beispiel-Programm")
Endif
break
Endif
Endwhile
end
Proc DeleteRegEintrag
Parameters hkey$, schluessel$, name_eintrag$
Declare Handle#
Dim Handle#,4
Declare Key#
Dim Key#,100
String Key#,0=schluessel$
Declare Name#
Dim Name#,100
String Name#,0=name_eintrag$
Print Regopenkeyex(hkey$,Key#,0,$2,Handle#)
Print Regdeletevalue(@Long(Handle#,0),Name#)
Print Regclosekey(@Long(Handle#,0))
Dispose Handle#
Dispose Key#
Dispose Name#
/../Function-References/XProfan/endproc/'>ENDPROC
|
|
|
| |
|
|