一个对话框加一个shellexecute命令行。
buttonclick首次执行时对话框选了是才执行,第二次运行时首选执行了shellexecute
我的代码是:
if ShellExecute(Handle, 'open', PChar(folderURL), nil, nil, SW_SHOWMAXIMIZED)<=32 then
Application.MessageBox('路径错误!请重新指定','警告',MB_Ok+MB_ICONWarning);
else if Application.MessageBox('改变资源目录应整体移动并重新指定路径,请勿删改系统目录!','提示',MB_OkCANCEL+MB_ICONquestion)=ID_OK then
ShellExecute(Handle, 'open', PChar(folderURL), nil, nil,SW_SHOWMAXIMIZED);
buttonclick首次执行时对话框选了是才执行,第二次运行时首选执行了shellexecute
我的代码是:
if ShellExecute(Handle, 'open', PChar(folderURL), nil, nil, SW_SHOWMAXIMIZED)<=32 then
Application.MessageBox('路径错误!请重新指定','警告',MB_Ok+MB_ICONWarning);
else if Application.MessageBox('改变资源目录应整体移动并重新指定路径,请勿删改系统目录!','提示',MB_OkCANCEL+MB_ICONquestion)=ID_OK then
ShellExecute(Handle, 'open', PChar(folderURL), nil, nil,SW_SHOWMAXIMIZED);
共享一个小技巧,DrawColumnCell事件:
if DBGrid1.SelectIndex<>0 then DBGrid1.SelectIndex:=0